커뮤니티

도사님 도움부탁드려요.

프로필 이미지
아이덜
2024-12-24 13:10:31
520
글번호 186563
답변완료
1. 두번째 갱신되었을경우, 별모양 추가해주세요. 3번째갱신되었을경우,별모양 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),tx1(0); var : TL1(0),TL2(0),TL3(0),TL4(0),TL5(0),TL6(0),TL7(0),TL8(0),t(0); Plot1 (0); 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; t = 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; ZigZagTL = TL_New(LD[0],LT[0],LV[0],HD[0],HT[0],HV[0]); TL_SetColor(ZigZagTL,Gold); TL_SetSize(ZigZagTL,1); 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,25); Text_SetBold(tx,1); var2 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(23.6/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]))*(76.4/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,Gold); TL_SetColor(TL3,Orange); TL_SetColor(TL4,Green); TL_SetColor(TL5,Orange); TL_SetColor(TL6,Gold); TL_SetColor(TL7,Magenta); TL_SetSize(TL1,1); t = t+1; if t == 1 Then { tx1 = Text_New(NextBarSdate,NextBarStime,LV[0]-PriceScale*2,"■"); } } 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; ZigZagTL = TL_New(HD[0],HT[0],HV[0],LD[0],LT[0],LV[0]); TL_SetColor(ZigZagTL,Gold); TL_SetSize(ZigZagTL,1); 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,25); Text_SetBold(tx,1); var2 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(23.6/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]))*(76.4/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,Gold); TL_SetColor(TL3,Orange); TL_SetColor(TL4,Green); TL_SetColor(TL5,Orange); TL_SetColor(TL6,Gold); TL_SetColor(TL7,Magenta); TL_SetSize(TL7,1); t = t+1; if t == 1 Then { tx1 = Text_New(NextBarSdate,NextBarStime,HV[0]+PriceScale*2,"■"); } } 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; TL_SetEnd(ZigZagTL,HD[0],HT[0],HV[0]); 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]))*(23.6/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]))*(76.4/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]); if t == 1 Then Text_SetLocation(tx1,sDate,sTime,LV[0]-PriceScale*2); } } 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; TL_SetEnd(ZigZagTL,LD[0],LT[0],LV[0]); 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]))*(23.6/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]))*(76.4/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]); if t == 1 Then Text_SetLocation(tx1,sDate,sTime,HV[0]+PriceScale*2); } } } }
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2024-12-24 14:54:05

안녕하세요 예스스탁입니다. 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),tx1(0); var : TL1(0),TL2(0),TL3(0),TL4(0),TL5(0),TL6(0),TL7(0),TL8(0),t(0); var :tx11(0),tx12(0),tx13(0),tx21(0),tx22(0),tx23(0); Plot1 (0); 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; t = 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; ZigZagTL = TL_New(LD[0],LT[0],LV[0],HD[0],HT[0],HV[0]); TL_SetColor(ZigZagTL,Gold); TL_SetSize(ZigZagTL,1); 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,25); Text_SetBold(tx,1); var2 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(23.6/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]))*(76.4/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,Gold); TL_SetColor(TL3,Orange); TL_SetColor(TL4,Green); TL_SetColor(TL5,Orange); TL_SetColor(TL6,Gold); TL_SetColor(TL7,Magenta); TL_SetSize(TL1,1); t = t+1; if t == 1 Then { tx11 = Text_New(NextBarSdate,NextBarStime,LV[0]-PriceScale*2,"■"); Text_SetStyle(tx11,2,0); } if t == 2 Then { tx12 = Text_New(NextBarSdate,NextBarStime,LV[0]-PriceScale*2,"★"); Text_SetStyle(tx12,2,0); } if t == 3 Then { tx13 = Text_New(NextBarSdate,NextBarStime,LV[0]-PriceScale*2,"★"); Text_SetStyle(tx13,2,0); } } 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; ZigZagTL = TL_New(HD[0],HT[0],HV[0],LD[0],LT[0],LV[0]); TL_SetColor(ZigZagTL,Gold); TL_SetSize(ZigZagTL,1); 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,25); Text_SetBold(tx,1); var2 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(23.6/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]))*(76.4/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,Gold); TL_SetColor(TL3,Orange); TL_SetColor(TL4,Green); TL_SetColor(TL5,Orange); TL_SetColor(TL6,Gold); TL_SetColor(TL7,Magenta); TL_SetSize(TL7,1); t = t+1; if t == 1 Then { tx21 = Text_New(NextBarSdate,NextBarStime,HV[0]+PriceScale*2,"■"); Text_SetStyle(tx21,2,1); } if t == 2 Then { tx22 = Text_New(NextBarSdate,NextBarStime,HV[0]+PriceScale*2,"★"); Text_SetStyle(tx22,2,1); } if t == 3 Then { tx23 = Text_New(NextBarSdate,NextBarStime,HV[0]+PriceScale*2,"★"); Text_SetStyle(tx23,2,1); } } 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; TL_SetEnd(ZigZagTL,HD[0],HT[0],HV[0]); 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]))*(23.6/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]))*(76.4/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]); if t == 1 Then Text_SetLocation(tx11,sDate,sTime,LV[0]-PriceScale*2); if t == 2 Then Text_SetLocation(tx12,sDate,sTime,LV[0]-PriceScale*2); if t == 3 Then Text_SetLocation(tx13,sDate,sTime,LV[0]-PriceScale*2); } } 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; TL_SetEnd(ZigZagTL,LD[0],LT[0],LV[0]); 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]))*(23.6/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]))*(76.4/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]); if t == 1 Then Text_SetLocation(tx21,sDate,sTime,HV[0]+PriceScale*2); if t == 1 Then Text_SetLocation(tx22,sDate,sTime,HV[0]+PriceScale*2); if t == 1 Then Text_SetLocation(tx23,sDate,sTime,HV[0]+PriceScale*2); } } } } 즐거운 크리스마스 보내세요 > 아이덜 님이 쓴 글입니다. > 제목 : 도사님 도움부탁드려요. > 1. 두번째 갱신되었을경우, 별모양 추가해주세요. 3번째갱신되었을경우,별모양 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),tx1(0); var : TL1(0),TL2(0),TL3(0),TL4(0),TL5(0),TL6(0),TL7(0),TL8(0),t(0); Plot1 (0); 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; t = 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; ZigZagTL = TL_New(LD[0],LT[0],LV[0],HD[0],HT[0],HV[0]); TL_SetColor(ZigZagTL,Gold); TL_SetSize(ZigZagTL,1); 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,25); Text_SetBold(tx,1); var2 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(23.6/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]))*(76.4/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,Gold); TL_SetColor(TL3,Orange); TL_SetColor(TL4,Green); TL_SetColor(TL5,Orange); TL_SetColor(TL6,Gold); TL_SetColor(TL7,Magenta); TL_SetSize(TL1,1); t = t+1; if t == 1 Then { tx1 = Text_New(NextBarSdate,NextBarStime,LV[0]-PriceScale*2,"■"); } } 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; ZigZagTL = TL_New(HD[0],HT[0],HV[0],LD[0],LT[0],LV[0]); TL_SetColor(ZigZagTL,Gold); TL_SetSize(ZigZagTL,1); 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,25); Text_SetBold(tx,1); var2 = 10^(LOG10(HV[0])-(LOG10(HV[0])-LOG10(LV[0]))*(23.6/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]))*(76.4/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,Gold); TL_SetColor(TL3,Orange); TL_SetColor(TL4,Green); TL_SetColor(TL5,Orange); TL_SetColor(TL6,Gold); TL_SetColor(TL7,Magenta); TL_SetSize(TL7,1); t = t+1; if t == 1 Then { tx1 = Text_New(NextBarSdate,NextBarStime,HV[0]+PriceScale*2,"■"); } } 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; TL_SetEnd(ZigZagTL,HD[0],HT[0],HV[0]); 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]))*(23.6/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]))*(76.4/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]); if t == 1 Then Text_SetLocation(tx1,sDate,sTime,LV[0]-PriceScale*2); } } 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; TL_SetEnd(ZigZagTL,LD[0],LT[0],LV[0]); 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]))*(23.6/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]))*(76.4/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]); if t == 1 Then Text_SetLocation(tx1,sDate,sTime,HV[0]+PriceScale*2); } } } }