예스스탁
예스스탁 답변
2024-10-11 16:14:42
안녕하세요
예스스탁입니다.
input : 전환포인트(0.8);
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),ZigZagTL(0),TX(0);
var : TL1(0),TL2(0),TL3(0),TL4(0),TL5(0),TL6(0),TL7(0),TL8(0),tl99(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,Black);
Text_SetSize(tx,27);
Text_SetBold(tx,1);
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));
TL1 = TL_New(LD[0],LT[0],HV[0],NextBarSdate,NextBarStime,HV[0]);
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);
TL7 = TL_New(LD[0],LT[0],LV[0],NextBarSdate,NextBarStime,LV[0]);
TL_SetColor(TL1,Magenta);
TL_SetColor(TL3,Orange);
TL_SetColor(TL4,Blue);
TL_SetColor(TL5,Orange);
TL_SetColor(TL7,Blue);
Tl99 = TL_New(LD[0],LT[0],HV[0],LD[0],LT[0],LV[0]);
TL_SetColor(tl99,Green);
}
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,Black);
Text_SetSize(tx,27);
Text_SetBold(tx,1);
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));
TL1 = TL_New(HD[0],HT[0],HV[0],NextBarSdate,NextBarStime,HV[0]);
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);
TL7 = TL_New(HD[0],HT[0],LV[0],NextBarSdate,NextBarStime,LV[0]);
TL_SetColor(TL1,Blue);
TL_SetColor(TL3,Orange);
TL_SetColor(TL4,Blue);
TL_SetColor(TL5,Orange);
TL_SetColor(TL7,Magenta);
Tl99 = TL_New(HD[0],HT[0],HV[0],HD[0],HT[0],LV[0]);
TL_SetColor(tl99,Green);
}
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)+" ");
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));
TL_SetBegin(TL1,LD[0],LT[0],HV[0]);
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(TL7,LD[0],LT[0],LV[0]);
TL_SetEnd(TL1,Sdate,Stime,HV[0]);
TL_SetEnd(TL3,Sdate,Stime,Var3);
TL_SetEnd(TL4,Sdate,Stime,Var4);
TL_SetEnd(TL5,Sdate,Stime,Var5);
TL_SetEnd(TL7,Sdate,Stime,LV[0]);
TL_SetBegin(TL99,LD[0],LT[0],HV[0]);
TL_SetEnd(TL99,LD[0],LT[0],LV[0]);
}
}
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)+" ");
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));
TL_SetBegin(TL1,HD[0],HT[0],HV[0]);
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(TL7,HD[0],HT[0],LV[0]);
TL_SetEnd(TL1,Sdate,Stime,HV[0]);
TL_SetEnd(TL3,Sdate,Stime,Var3);
TL_SetEnd(TL4,Sdate,Stime,Var4);
TL_SetEnd(TL5,Sdate,Stime,Var5);
TL_SetEnd(TL7,Sdate,Stime,LV[0]);
TL_SetBegin(TL99,HD[0],HT[0],HV[0]);
TL_SetEnd(TL99,HD[0],HT[0],LV[0]);
}
}
}
}
즐거운 하루되세요
> 고성 님이 쓴 글입니다.
> 제목 : 피보나치 세로선
> input : 전환포인트(0.8);
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),ZigZagTL(0),TX(0);
var : TL1(0),TL2(0),TL3(0),TL4(0),TL5(0),TL6(0),TL7(0),TL8(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,Black);
Text_SetSize(tx,27);
Text_SetBold(tx,1);
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));
TL1 = TL_New(LD[0],LT[0],HV[0],NextBarSdate,NextBarStime,HV[0]);
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);
TL7 = TL_New(LD[0],LT[0],LV[0],NextBarSdate,NextBarStime,LV[0]);
TL_SetColor(TL1,Magenta);
TL_SetColor(TL3,Orange);
TL_SetColor(TL4,Blue);
TL_SetColor(TL5,Orange);
TL_SetColor(TL7,Blue);
}
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,Black);
Text_SetSize(tx,27);
Text_SetBold(tx,1);
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));
TL1 = TL_New(HD[0],HT[0],HV[0],NextBarSdate,NextBarStime,HV[0]);
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);
TL7 = TL_New(HD[0],HT[0],LV[0],NextBarSdate,NextBarStime,LV[0]);
TL_SetColor(TL1,Blue);
TL_SetColor(TL3,Orange);
TL_SetColor(TL4,Blue);
TL_SetColor(TL5,Orange);
TL_SetColor(TL7,Magenta);
}
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)+" ");
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));
TL_SetBegin(TL1,LD[0],LT[0],HV[0]);
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(TL7,LD[0],LT[0],LV[0]);
TL_SetEnd(TL1,Sdate,Stime,HV[0]);
TL_SetEnd(TL3,Sdate,Stime,Var3);
TL_SetEnd(TL4,Sdate,Stime,Var4);
TL_SetEnd(TL5,Sdate,Stime,Var5);
TL_SetEnd(TL7,Sdate,Stime,LV[0]);
}
}
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)+" ");
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));
TL_SetBegin(TL1,HD[0],HT[0],HV[0]);
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(TL7,HD[0],HT[0],LV[0]);
TL_SetEnd(TL1,Sdate,Stime,HV[0]);
TL_SetEnd(TL3,Sdate,Stime,Var3);
TL_SetEnd(TL4,Sdate,Stime,Var4);
TL_SetEnd(TL5,Sdate,Stime,Var5);
TL_SetEnd(TL7,Sdate,Stime,LV[0]);
}
}
}
}
하락 피보나치 선이 새로 생성되면 시작점(왼쪽만) 상단에서 아래로 하단까지 세로선. (그림)
상승은 반대. 감사합니다.