예스스탁
예스스탁 답변
2024-12-26 10:40:39
안녕하세요
예스스탁입니다.
input : 전환포인트(1.9);
Array : HD[10](0),HT[10](0),HV[10](0);
Array : LD[10](0),LT[10](0),LV[10](0);
var : cnt(0),Hprice(0),Lprice(0);
var : UpTrend(false),DownTrend(False),Trend(0),Trend1(0),TX(0);
var : TL1(0),TL2(0),TL3(0),TL4(0),TL5(0),TL6(0),TL7(0),box1(0),box2(0);
Plot1 (c);
HPrice = H;
LPrice = L;
if Index == 0 Then
{
HD[0] = sDate;
HT[0] = sTime;
HV[0] = HPrice;
LD[0] = sDate;
LT[0] = sTime;
LV[0] = LPrice;
trend = 0;
trend1 = 0;
}
Else
{
if Trend == 0 Then
{
if L < LV[0] Then
{
LD[0] = sDate;
LT[0] = sTime;
LV[0] = LPrice;
}
if H > HV[0] Then
{
HD[0] = sDate;
HT[0] = sTime;
HV[0] = HPrice;
}
}
UpTrend = HPrice >= LV[0]+전환포인트;
DownTrend = LPrice <= HV[0]-전환포인트;
if trend <= 0 and UpTrend == true Then
{
trend = 1;
trend1 = trend[1];
For cnt = 9 DownTo 1
{
HD[cnt] = HD[cnt-1];
HT[cnt] = HT[cnt-1];
HV[cnt] = HV[cnt-1];
}
HD[0] = sDate;
HT[0] = sTime;
HV[0] = HPrice;
TX = Text_New(HD[0],HT[0],HV[0],NumToStr(HV[0]-LV[0],2));
Text_SetStyle(TX,1,1);
Text_SetColor(TX,Red);
Text_SetSize(tx,25);
Text_SetBold(tx,1);
var2 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(33.3/100));
var3 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(38.2/100));
var4 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(50/100));
var5 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(61.8/100));
var6 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(66.7/100));
TL1 = TL_New(LD[0],LT[0],HV[0],NextBarSdate,NextBarStime,HV[0]);
TL2 = TL_New(LD[0],LT[0],var2,NextBarSdate,NextBarStime,var2);
TL3 = TL_New(LD[0],LT[0],var3,NextBarSdate,NextBarStime,var3);
TL4 = TL_New(LD[0],LT[0],var4,NextBarSdate,NextBarStime,var4);
TL5 = TL_New(LD[0],LT[0],var5,NextBarSdate,NextBarStime,var5);
TL6 = TL_New(LD[0],LT[0],var6,NextBarSdate,NextBarStime,var6);
TL7 = TL_New(LD[0],LT[0],LV[0],NextBarSdate,NextBarStime,LV[0]);
TL_SetColor(TL1,Magenta);
TL_SetColor(TL2,Green);
TL_SetColor(TL3,Red);
TL_SetColor(TL4,Blue);
TL_SetColor(TL5,Red);
TL_SetColor(TL6,Green);
TL_SetColor(TL7,Magenta);
TL_SetSize(TL4,1);
box1 = Box_New(LD[0],LT[0],Var2,NextBarSdate,NextBarStime,Var3);
Box_SetColor(box1,Yellow);
Box_SetFill(box1,true,50);
box2 = Box_New(LD[0],LT[0],Var5,NextBarSdate,NextBarStime,Var6);
Box_SetColor(box2,Yellow);
Box_SetFill(box2,true,50);
}
Else if trend >= 0 and DownTrend Then//하락추세 전환
{
trend = -1;
trend1 = trend[1];
For cnt = 9 DownTo 1
{
LD[cnt] = LD[cnt-1];
LT[cnt] = LT[cnt-1];
LV[cnt] = LV[cnt-1];
}
LD[0] = sDate;
LT[0] = sTime;
LV[0] = LPrice;
TX = Text_New(LD[0],LT[0],LV[0],NumToStr(HV[0]-LV[0],2));
Text_SetStyle(TX,1,0);
Text_SetColor(TX,Blue);
Text_SetSize(tx,25);
Text_SetBold(tx,1);
var2 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(33.3/100));
var3 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(38.2/100));
var4 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(50/100));
var5 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(61.8/100));
var6 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(66.7/100));
TL1 = TL_New(HD[0],HT[0],HV[0],NextBarSdate,NextBarStime,HV[0]);
TL2 = TL_New(HD[0],HT[0],var2,NextBarSdate,NextBarStime,var2);
TL3 = TL_New(HD[0],HT[0],var3,NextBarSdate,NextBarStime,var3);
TL4 = TL_New(HD[0],HT[0],var4,NextBarSdate,NextBarStime,var4);
TL5 = TL_New(HD[0],HT[0],var5,NextBarSdate,NextBarStime,var5);
TL6 = TL_New(HD[0],HT[0],var6,NextBarSdate,NextBarStime,var6);
TL7 = TL_New(HD[0],HT[0],LV[0],NextBarSdate,NextBarStime,LV[0]);
TL_SetColor(TL1,Magenta);
TL_SetColor(TL2,Green);
TL_SetColor(TL3,Red);
TL_SetColor(TL4,Blue);
TL_SetColor(TL5,Red);
TL_SetColor(TL6,Green);
TL_SetColor(TL7,Magenta);
TL_SetSize(TL4,1);
box1 = Box_New(HD[0],HT[0],Var2,NextBarSdate,NextBarStime,Var3);
Box_SetColor(box1,Yellow);
Box_SetFill(box1,true,50);
box2 = Box_New(HD[0],HT[0],Var5,NextBarSdate,NextBarStime,Var6);
Box_SetColor(box2,Yellow);
Box_SetFill(box2,true,50);
}
Else
{
if trend == 1 Then
{
if trend1 == 0 Then
{
LV[0] = DayLow;
}
if HPrice > HV[0] Then
{
HD[0] = sDate;
HT[0] = sTime;
HV[0] = HPrice;
Text_SetLocation(TX,HD[0],HT[0],HV[0]);
Text_SetString(TX,NumToStr(HV[0]-LV[0],2));
var2 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(33.3/100));
var3 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(38.2/100));
var4 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(50/100));
var5 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(61.8/100));
var6 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(66.7/100));
TL_SetBegin(TL1,LD[0],LT[0],HV[0]);
TL_SetBegin(TL2,LD[0],LT[0],Var2);
TL_SetBegin(TL3,LD[0],LT[0],Var3);
TL_SetBegin(TL4,LD[0],LT[0],Var4);
TL_SetBegin(TL5,LD[0],LT[0],Var5);
TL_SetBegin(TL6,LD[0],LT[0],Var6);
TL_SetBegin(TL7,LD[0],LT[0],LV[0]);
TL_SetEnd(TL1,Sdate,Stime,HV[0]);
TL_SetEnd(TL2,Sdate,Stime,Var2);
TL_SetEnd(TL3,Sdate,Stime,Var3);
TL_SetEnd(TL4,Sdate,Stime,Var4);
TL_SetEnd(TL5,Sdate,Stime,Var5);
TL_SetEnd(TL6,Sdate,Stime,Var6);
TL_SetEnd(TL7,Sdate,Stime,LV[0]);
Box_SetBegin(Box1,LD[0],LT[0],Var2);
Box_SetEnd(Box1,sDate,sTime,Var3);
Box_SetBegin(Box2,LD[0],LT[0],Var5);
Box_SetEnd(Box2,sDate,sTime,Var6);
}
}
if trend == -1 Then
{
if trend1 == 0 Then
{
HV[0] = DayHigh;
}
if LPrice < LV[0] Then
{
LD[0] = sDate;
LT[0] = sTime;
LV[0] = LPrice;
Text_SetLocation(TX,LD[0],LT[0],LV[0]);
Text_SetString(TX,NumToStr(HV[0]-LV[0],2));
var2 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(33.3/100));
var3 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(38.2/100));
var4 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(50/100));
var5 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(61.8/100));
var6 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(66.7/100));
TL_SetBegin(TL1,HD[0],HT[0],HV[0]);
TL_SetBegin(TL2,HD[0],HT[0],Var2);
TL_SetBegin(TL3,HD[0],HT[0],Var3);
TL_SetBegin(TL4,HD[0],HT[0],Var4);
TL_SetBegin(TL5,HD[0],HT[0],Var5);
TL_SetBegin(TL6,HD[0],HT[0],Var6);
TL_SetBegin(TL7,HD[0],HT[0],LV[0]);
TL_SetEnd(TL1,Sdate,Stime,HV[0]);
TL_SetEnd(TL2,Sdate,Stime,Var2);
TL_SetEnd(TL3,Sdate,Stime,Var3);
TL_SetEnd(TL4,Sdate,Stime,Var4);
TL_SetEnd(TL5,Sdate,Stime,Var5);
TL_SetEnd(TL6,Sdate,Stime,Var6);
TL_SetEnd(TL7,Sdate,Stime,LV[0]);
Box_SetBegin(Box1,HD[0],HT[0],Var2);
Box_SetEnd(Box1,sDate,sTime,Var3);
Box_SetBegin(Box2,HD[0],HT[0],Var5);
Box_SetEnd(Box2,sDate,sTime,Var6);
}
}
}
}
즐거운 하루되세요
> 고성 님이 쓴 글입니다.
> 제목 : 전환 피보나치 전체
> input : 전환포인트(1.9);
Array : HD[10](0),HT[10](0),HV[10](0);
Array : LD[10](0),LT[10](0),LV[10](0);
var : cnt(0),Hprice(0),Lprice(0);
var : UpTrend(false),DownTrend(False),Trend(0),Trend1(0),TX(0);
var : TL1(0),TL2(0),TL3(0),TL4(0),TL5(0),TL6(0),TL7(0),box1(0),box2(0);
Plot1 (c);
HPrice = H;
LPrice = L;
if Index == 0 or Bdate != Bdate[1] Then
{
HD[0] = sDate;
HT[0] = sTime;
HV[0] = HPrice;
LD[0] = sDate;
LT[0] = sTime;
LV[0] = LPrice;
trend = 0;
trend1 = 0;
}
Else
{
if Trend == 0 Then
{
if L < LV[0] Then
{
LD[0] = sDate;
LT[0] = sTime;
LV[0] = LPrice;
}
if H > HV[0] Then
{
HD[0] = sDate;
HT[0] = sTime;
HV[0] = HPrice;
}
}
UpTrend = HPrice >= LV[0]+전환포인트;
DownTrend = LPrice <= HV[0]-전환포인트;
if trend <= 0 and UpTrend == true Then
{
trend = 1;
trend1 = trend[1];
For cnt = 9 DownTo 1
{
HD[cnt] = HD[cnt-1];
HT[cnt] = HT[cnt-1];
HV[cnt] = HV[cnt-1];
}
HD[0] = sDate;
HT[0] = sTime;
HV[0] = HPrice;
TX = Text_New(HD[0],HT[0],HV[0],NumToStr(HV[0]-LV[0],2));
Text_SetStyle(TX,1,1);
Text_SetColor(TX,Red);
Text_SetSize(tx,25);
Text_SetBold(tx,1);
var2 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(33.3/100));
var3 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(38.2/100));
var4 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(50/100));
var5 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(61.8/100));
var6 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(66.7/100));
TL1 = TL_New(LD[0],LT[0],HV[0],NextBarSdate,NextBarStime,HV[0]);
TL2 = TL_New(LD[0],LT[0],var2,NextBarSdate,NextBarStime,var2);
TL3 = TL_New(LD[0],LT[0],var3,NextBarSdate,NextBarStime,var3);
TL4 = TL_New(LD[0],LT[0],var4,NextBarSdate,NextBarStime,var4);
TL5 = TL_New(LD[0],LT[0],var5,NextBarSdate,NextBarStime,var5);
TL6 = TL_New(LD[0],LT[0],var6,NextBarSdate,NextBarStime,var6);
TL7 = TL_New(LD[0],LT[0],LV[0],NextBarSdate,NextBarStime,LV[0]);
TL_SetColor(TL1,Magenta);
TL_SetColor(TL2,Green);
TL_SetColor(TL3,Red);
TL_SetColor(TL4,Blue);
TL_SetColor(TL5,Red);
TL_SetColor(TL6,Green);
TL_SetColor(TL7,Magenta);
TL_SetSize(TL4,1);
box1 = Box_New(LD[0],LT[0],Var2,NextBarSdate,NextBarStime,Var3);
Box_SetColor(box1,Yellow);
Box_SetFill(box1,true,50);
box2 = Box_New(LD[0],LT[0],Var5,NextBarSdate,NextBarStime,Var6);
Box_SetColor(box2,Yellow);
Box_SetFill(box2,true,50);
}
Else if trend >= 0 and DownTrend Then//하락추세 전환
{
trend = -1;
trend1 = trend[1];
For cnt = 9 DownTo 1
{
LD[cnt] = LD[cnt-1];
LT[cnt] = LT[cnt-1];
LV[cnt] = LV[cnt-1];
}
LD[0] = sDate;
LT[0] = sTime;
LV[0] = LPrice;
TX = Text_New(LD[0],LT[0],LV[0],NumToStr(HV[0]-LV[0],2));
Text_SetStyle(TX,1,0);
Text_SetColor(TX,Blue);
Text_SetSize(tx,25);
Text_SetBold(tx,1);
var2 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(33.3/100));
var3 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(38.2/100));
var4 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(50/100));
var5 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(61.8/100));
var6 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(66.7/100));
TL1 = TL_New(HD[0],HT[0],HV[0],NextBarSdate,NextBarStime,HV[0]);
TL2 = TL_New(HD[0],HT[0],var2,NextBarSdate,NextBarStime,var2);
TL3 = TL_New(HD[0],HT[0],var3,NextBarSdate,NextBarStime,var3);
TL4 = TL_New(HD[0],HT[0],var4,NextBarSdate,NextBarStime,var4);
TL5 = TL_New(HD[0],HT[0],var5,NextBarSdate,NextBarStime,var5);
TL6 = TL_New(HD[0],HT[0],var6,NextBarSdate,NextBarStime,var6);
TL7 = TL_New(HD[0],HT[0],LV[0],NextBarSdate,NextBarStime,LV[0]);
TL_SetColor(TL1,Magenta);
TL_SetColor(TL2,Green);
TL_SetColor(TL3,Red);
TL_SetColor(TL4,Blue);
TL_SetColor(TL5,Red);
TL_SetColor(TL6,Green);
TL_SetColor(TL7,Magenta);
TL_SetSize(TL4,1);
box1 = Box_New(HD[0],HT[0],Var2,NextBarSdate,NextBarStime,Var3);
Box_SetColor(box1,Yellow);
Box_SetFill(box1,true,50);
box2 = Box_New(HD[0],HT[0],Var5,NextBarSdate,NextBarStime,Var6);
Box_SetColor(box2,Yellow);
Box_SetFill(box2,true,50);
}
Else
{
if trend == 1 Then
{
if trend1 == 0 Then
{
LV[0] = DayLow;
}
if HPrice > HV[0] Then
{
HD[0] = sDate;
HT[0] = sTime;
HV[0] = HPrice;
Text_SetLocation(TX,HD[0],HT[0],HV[0]);
Text_SetString(TX,NumToStr(HV[0]-LV[0],2));
var2 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(33.3/100));
var3 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(38.2/100));
var4 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(50/100));
var5 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(61.8/100));
var6 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(66.7/100));
TL_SetBegin(TL1,LD[0],LT[0],HV[0]);
TL_SetBegin(TL2,LD[0],LT[0],Var2);
TL_SetBegin(TL3,LD[0],LT[0],Var3);
TL_SetBegin(TL4,LD[0],LT[0],Var4);
TL_SetBegin(TL5,LD[0],LT[0],Var5);
TL_SetBegin(TL6,LD[0],LT[0],Var6);
TL_SetBegin(TL7,LD[0],LT[0],LV[0]);
TL_SetEnd(TL1,Sdate,Stime,HV[0]);
TL_SetEnd(TL2,Sdate,Stime,Var2);
TL_SetEnd(TL3,Sdate,Stime,Var3);
TL_SetEnd(TL4,Sdate,Stime,Var4);
TL_SetEnd(TL5,Sdate,Stime,Var5);
TL_SetEnd(TL6,Sdate,Stime,Var6);
TL_SetEnd(TL7,Sdate,Stime,LV[0]);
Box_SetBegin(Box1,LD[0],LT[0],Var2);
Box_SetEnd(Box1,sDate,sTime,Var3);
Box_SetBegin(Box2,LD[0],LT[0],Var5);
Box_SetEnd(Box2,sDate,sTime,Var6);
}
}
if trend == -1 Then
{
if trend1 == 0 Then
{
HV[0] = DayHigh;
}
if LPrice < LV[0] Then
{
LD[0] = sDate;
LT[0] = sTime;
LV[0] = LPrice;
Text_SetLocation(TX,LD[0],LT[0],LV[0]);
Text_SetString(TX,NumToStr(HV[0]-LV[0],2));
var2 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(33.3/100));
var3 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(38.2/100));
var4 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(50/100));
var5 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(61.8/100));
var6 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(66.7/100));
TL_SetBegin(TL1,HD[0],HT[0],HV[0]);
TL_SetBegin(TL2,HD[0],HT[0],Var2);
TL_SetBegin(TL3,HD[0],HT[0],Var3);
TL_SetBegin(TL4,HD[0],HT[0],Var4);
TL_SetBegin(TL5,HD[0],HT[0],Var5);
TL_SetBegin(TL6,HD[0],HT[0],Var6);
TL_SetBegin(TL7,HD[0],HT[0],LV[0]);
TL_SetEnd(TL1,Sdate,Stime,HV[0]);
TL_SetEnd(TL2,Sdate,Stime,Var2);
TL_SetEnd(TL3,Sdate,Stime,Var3);
TL_SetEnd(TL4,Sdate,Stime,Var4);
TL_SetEnd(TL5,Sdate,Stime,Var5);
TL_SetEnd(TL6,Sdate,Stime,Var6);
TL_SetEnd(TL7,Sdate,Stime,LV[0]);
Box_SetBegin(Box1,HD[0],HT[0],Var2);
Box_SetEnd(Box1,sDate,sTime,Var3);
Box_SetBegin(Box2,HD[0],HT[0],Var5);
Box_SetEnd(Box2,sDate,sTime,Var6);
}
}
}
}
전일과 분리된 계산을, 여러날을 통합하여 전체적인 계산으로 변경. 감사합니다.