커뮤니티

시스템 로직으로 완성해 주시면 감사하겠습니다.

프로필 이미지
하날랑
2024-06-26 11:13:33
754
글번호 180982
답변완료
다음의 로직을 시스템식으로 완성해 주시면 감사하겠습니다. input : length(20); input : len2(10); input : showsignals(true); input : highlighting(true); var : upper(0),lower(0); lower = lowest(L,length); upper = highest(H,length); var : up(0),down(0),sup(0),sdown(0); var : k1(0),k2(0),k3(0),k4(0),i1(-1),i2(-1); up=highest(high,length); down=lowest(low,length); sup=highest(high,len2); sdown=lowest(low,len2); if high >= up[1] Then i1 = 0; Else { if i1 >= 0 Then i1 = i1+1; } if Low <= down[1] Then i2 = 0; Else { if i2 >= 0 Then i2 = i2+1; } K1=iff(i1 <=i2, down , up); K2=iff(i1 <= i2,sdown,sup); K3=iff(close>K1,down,nan); K4=iff(close<K1,up,nan); var : buySignal(False),sellSignal(False),buyExit(False),sellExit(False); var : O1(-1),O2(-1),O3(-1),O4(-1); var : E1(-1),E2(-1),E3(-1),E4(-1); var : tx1(0),tx2(0),tx3(0),tx4(0); var : tx5(0),tx6(0),tx7(0),tx8(0); buySignal=high==upper[1] or CrossUp(high,upper[1]); sellSignal = low==lower[1] or CrossUp(lower[1],low); buyExit=low==sdown[1] or CrossUp(sdown[1],low); sellExit = high==sup[1] or CrossUp(high,sup[1]); if BuySignal == true Then var1 = Index; if sellSignal == true Then var2 = Index; if buyExit == true Then var3 = Index; if sellExit == true Then var4 = Index; O1= IFf(var1 > 0,Index-var1,-1); O2= IFf(var2 > 0,Index-var2,-1); O3= IFf(var3 > 0,Index-var3,-1); O4= IFf(var4 > 0,Index-var4,-1); if BuySignal[1] == true Then var5 = Index; if sellSignal[1] == true Then var6 = Index; if buyExit[1] == true Then var7 = Index; if sellExit[1] == true Then var8 = Index; E1= IFf(var5 > 0,Index-var5,-1); E2= IFf(var6 > 0,Index-var6,-1); E3= IFf(var7 > 0,Index-var7,-1); E4= IFf(var8 > 0,Index-var8,-1); if buySignal and O3<O1[1] Then { tx1 = Text_New(sDate,sTime,down,"●"); Text_SetColor(tx1,Green); playsound("C:₩KiwoomGlobal₩sound₩매수신호발생1.wav"); } if buySignal and showsignals and O3<O1[1] Then { tx2 = Text_New(sDate,sTime,down,"▲"); Text_SetColor(tx2,Green); } if sellSignal and O4<O2[1] Then { tx3 = Text_New(sDate,sTime,up,"●"); Text_SetColor(tx3,Red); playsound("C:₩KiwoomGlobal₩sound₩매도신호발생1.wav"); } if sellSignal and showsignals and O4<O2[1] Then { tx4 = Text_New(sDate,sTime,down,"▼"); Text_SetColor(tx4,Red); } if buyExit and O1<O3[1] Then { tx5 = Text_New(sDate,sTime,up,"●"); Text_SetColor(tx5,blue); playsound("C:₩KiwoomGlobal₩sound₩시세포착3.wav"); } if buyExit and showsignals and O1<O3[1] Then { tx6 = Text_New(sDate,sTime,down,"▼"); Text_SetColor(tx6,blue); } if sellExit and O2<O4[1] Then { tx7 = Text_New(sDate,sTime,down,"●"); Text_SetColor(tx7,blue); playsound("C:₩KiwoomGlobal₩sound₩시세포착1.wav"); } if sellExit and showsignals and O2<O4[1] Then { tx8 = Text_New(sDate,sTime,down,"▲"); Text_SetColor(tx8,blue); }
지표
답변 4
프로필 이미지

예스스탁 예스스탁 답변

2024-06-26 15:03:06

안녕하세요 예스스탁입니다. input : length(20); input : len2(10); input : showsignals(true); input : highlighting(true); var : upper(0),lower(0); lower = lowest(L,length); upper = highest(H,length); var : up(0),down(0),sup(0),sdown(0); var : k1(0),k2(0),k3(0),k4(0),i1(-1),i2(-1); up=highest(high,length); down=lowest(low,length); sup=highest(high,len2); sdown=lowest(low,len2); if high >= up[1] Then i1 = 0; Else { if i1 >= 0 Then i1 = i1+1; } if Low <= down[1] Then i2 = 0; Else { if i2 >= 0 Then i2 = i2+1; } K1=iff(i1 <=i2, down , up); K2=iff(i1 <= i2,sdown,sup); K3=iff(close>K1,down,nan); K4=iff(close<K1,up,nan); var : buySignal(False),sellSignal(False),buyExit(False),sellExit(False); var : O1(-1),O2(-1),O3(-1),O4(-1); var : E1(-1),E2(-1),E3(-1),E4(-1); var : tx1(0),tx2(0),tx3(0),tx4(0); var : tx5(0),tx6(0),tx7(0),tx8(0); buySignal=high==upper[1] or CrossUp(high,upper[1]); sellSignal = low==lower[1] or CrossUp(lower[1],low); buyExit=low==sdown[1] or CrossUp(sdown[1],low); sellExit = high==sup[1] or CrossUp(high,sup[1]); if BuySignal == true Then var1 = Index; if sellSignal == true Then var2 = Index; if buyExit == true Then var3 = Index; if sellExit == true Then var4 = Index; O1= IFf(var1 > 0,Index-var1,-1); O2= IFf(var2 > 0,Index-var2,-1); O3= IFf(var3 > 0,Index-var3,-1); O4= IFf(var4 > 0,Index-var4,-1); if BuySignal[1] == true Then var5 = Index; if sellSignal[1] == true Then var6 = Index; if buyExit[1] == true Then var7 = Index; if sellExit[1] == true Then var8 = Index; E1= IFf(var5 > 0,Index-var5,-1); E2= IFf(var6 > 0,Index-var6,-1); E3= IFf(var7 > 0,Index-var7,-1); E4= IFf(var8 > 0,Index-var8,-1); if buySignal and O3<O1[1] Then { Buy("b"); } if sellSignal and O4<O2[1] Then { Sell("s"); } if buyExit and O1<O3[1] Then { ExitLong("bx"); } if sellExit and O2<O4[1] Then { ExitShort("sx"); } 즐거운 하루되세요 > 하날랑 님이 쓴 글입니다. > 제목 : 시스템 로직으로 완성해 주시면 감사하겠습니다. > 다음의 로직을 시스템식으로 완성해 주시면 감사하겠습니다. input : length(20); input : len2(10); input : showsignals(true); input : highlighting(true); var : upper(0),lower(0); lower = lowest(L,length); upper = highest(H,length); var : up(0),down(0),sup(0),sdown(0); var : k1(0),k2(0),k3(0),k4(0),i1(-1),i2(-1); up=highest(high,length); down=lowest(low,length); sup=highest(high,len2); sdown=lowest(low,len2); if high >= up[1] Then i1 = 0; Else { if i1 >= 0 Then i1 = i1+1; } if Low <= down[1] Then i2 = 0; Else { if i2 >= 0 Then i2 = i2+1; } K1=iff(i1 <=i2, down , up); K2=iff(i1 <= i2,sdown,sup); K3=iff(close>K1,down,nan); K4=iff(close<K1,up,nan); var : buySignal(False),sellSignal(False),buyExit(False),sellExit(False); var : O1(-1),O2(-1),O3(-1),O4(-1); var : E1(-1),E2(-1),E3(-1),E4(-1); var : tx1(0),tx2(0),tx3(0),tx4(0); var : tx5(0),tx6(0),tx7(0),tx8(0); buySignal=high==upper[1] or CrossUp(high,upper[1]); sellSignal = low==lower[1] or CrossUp(lower[1],low); buyExit=low==sdown[1] or CrossUp(sdown[1],low); sellExit = high==sup[1] or CrossUp(high,sup[1]); if BuySignal == true Then var1 = Index; if sellSignal == true Then var2 = Index; if buyExit == true Then var3 = Index; if sellExit == true Then var4 = Index; O1= IFf(var1 > 0,Index-var1,-1); O2= IFf(var2 > 0,Index-var2,-1); O3= IFf(var3 > 0,Index-var3,-1); O4= IFf(var4 > 0,Index-var4,-1); if BuySignal[1] == true Then var5 = Index; if sellSignal[1] == true Then var6 = Index; if buyExit[1] == true Then var7 = Index; if sellExit[1] == true Then var8 = Index; E1= IFf(var5 > 0,Index-var5,-1); E2= IFf(var6 > 0,Index-var6,-1); E3= IFf(var7 > 0,Index-var7,-1); E4= IFf(var8 > 0,Index-var8,-1); if buySignal and O3<O1[1] Then { tx1 = Text_New(sDate,sTime,down,"●"); Text_SetColor(tx1,Green); playsound("C:₩KiwoomGlobal₩sound₩매수신호발생1.wav"); } if buySignal and showsignals and O3<O1[1] Then { tx2 = Text_New(sDate,sTime,down,"▲"); Text_SetColor(tx2,Green); } if sellSignal and O4<O2[1] Then { tx3 = Text_New(sDate,sTime,up,"●"); Text_SetColor(tx3,Red); playsound("C:₩KiwoomGlobal₩sound₩매도신호발생1.wav"); } if sellSignal and showsignals and O4<O2[1] Then { tx4 = Text_New(sDate,sTime,down,"▼"); Text_SetColor(tx4,Red); } if buyExit and O1<O3[1] Then { tx5 = Text_New(sDate,sTime,up,"●"); Text_SetColor(tx5,blue); playsound("C:₩KiwoomGlobal₩sound₩시세포착3.wav"); } if buyExit and showsignals and O1<O3[1] Then { tx6 = Text_New(sDate,sTime,down,"▼"); Text_SetColor(tx6,blue); } if sellExit and O2<O4[1] Then { tx7 = Text_New(sDate,sTime,down,"●"); Text_SetColor(tx7,blue); playsound("C:₩KiwoomGlobal₩sound₩시세포착1.wav"); } if sellExit and showsignals and O2<O4[1] Then { tx8 = Text_New(sDate,sTime,down,"▲"); Text_SetColor(tx8,blue); }
프로필 이미지

하날랑

2024-06-26 16:55:09

대단히 감사합니다. 시뮬레이션을 돌려 보려고 하니 논리값(참/거짓)이나 논리표현식이 와야합니다라는 메세지가 뜨고 있습니다. 죄송하지만 한번만 더 보완을 해주시면 고맙겠습니다. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 시스템 로직으로 완성해 주시면 감사하겠습니다. > 안녕하세요 예스스탁입니다. input : length(20); input : len2(10); input : showsignals(true); input : highlighting(true); var : upper(0),lower(0); lower = lowest(L,length); upper = highest(H,length); var : up(0),down(0),sup(0),sdown(0); var : k1(0),k2(0),k3(0),k4(0),i1(-1),i2(-1); up=highest(high,length); down=lowest(low,length); sup=highest(high,len2); sdown=lowest(low,len2); if high >= up[1] Then i1 = 0; Else { if i1 >= 0 Then i1 = i1+1; } if Low <= down[1] Then i2 = 0; Else { if i2 >= 0 Then i2 = i2+1; } K1=iff(i1 <=i2, down , up); K2=iff(i1 <= i2,sdown,sup); K3=iff(close>K1,down,nan); K4=iff(close<K1,up,nan); var : buySignal(False),sellSignal(False),buyExit(False),sellExit(False); var : O1(-1),O2(-1),O3(-1),O4(-1); var : E1(-1),E2(-1),E3(-1),E4(-1); var : tx1(0),tx2(0),tx3(0),tx4(0); var : tx5(0),tx6(0),tx7(0),tx8(0); buySignal=high==upper[1] or CrossUp(high,upper[1]); sellSignal = low==lower[1] or CrossUp(lower[1],low); buyExit=low==sdown[1] or CrossUp(sdown[1],low); sellExit = high==sup[1] or CrossUp(high,sup[1]); if BuySignal == true Then var1 = Index; if sellSignal == true Then var2 = Index; if buyExit == true Then var3 = Index; if sellExit == true Then var4 = Index; O1= IFf(var1 > 0,Index-var1,-1); O2= IFf(var2 > 0,Index-var2,-1); O3= IFf(var3 > 0,Index-var3,-1); O4= IFf(var4 > 0,Index-var4,-1); if BuySignal[1] == true Then var5 = Index; if sellSignal[1] == true Then var6 = Index; if buyExit[1] == true Then var7 = Index; if sellExit[1] == true Then var8 = Index; E1= IFf(var5 > 0,Index-var5,-1); E2= IFf(var6 > 0,Index-var6,-1); E3= IFf(var7 > 0,Index-var7,-1); E4= IFf(var8 > 0,Index-var8,-1); if buySignal and O3<O1[1] Then { Buy("b"); } if sellSignal and O4<O2[1] Then { Sell("s"); } if buyExit and O1<O3[1] Then { ExitLong("bx"); } if sellExit and O2<O4[1] Then { ExitShort("sx"); } 즐거운 하루되세요 > 하날랑 님이 쓴 글입니다. > 제목 : 시스템 로직으로 완성해 주시면 감사하겠습니다. > 다음의 로직을 시스템식으로 완성해 주시면 감사하겠습니다. input : length(20); input : len2(10); input : showsignals(true); input : highlighting(true); var : upper(0),lower(0); lower = lowest(L,length); upper = highest(H,length); var : up(0),down(0),sup(0),sdown(0); var : k1(0),k2(0),k3(0),k4(0),i1(-1),i2(-1); up=highest(high,length); down=lowest(low,length); sup=highest(high,len2); sdown=lowest(low,len2); if high >= up[1] Then i1 = 0; Else { if i1 >= 0 Then i1 = i1+1; } if Low <= down[1] Then i2 = 0; Else { if i2 >= 0 Then i2 = i2+1; } K1=iff(i1 <=i2, down , up); K2=iff(i1 <= i2,sdown,sup); K3=iff(close>K1,down,nan); K4=iff(close<K1,up,nan); var : buySignal(False),sellSignal(False),buyExit(False),sellExit(False); var : O1(-1),O2(-1),O3(-1),O4(-1); var : E1(-1),E2(-1),E3(-1),E4(-1); var : tx1(0),tx2(0),tx3(0),tx4(0); var : tx5(0),tx6(0),tx7(0),tx8(0); buySignal=high==upper[1] or CrossUp(high,upper[1]); sellSignal = low==lower[1] or CrossUp(lower[1],low); buyExit=low==sdown[1] or CrossUp(sdown[1],low); sellExit = high==sup[1] or CrossUp(high,sup[1]); if BuySignal == true Then var1 = Index; if sellSignal == true Then var2 = Index; if buyExit == true Then var3 = Index; if sellExit == true Then var4 = Index; O1= IFf(var1 > 0,Index-var1,-1); O2= IFf(var2 > 0,Index-var2,-1); O3= IFf(var3 > 0,Index-var3,-1); O4= IFf(var4 > 0,Index-var4,-1); if BuySignal[1] == true Then var5 = Index; if sellSignal[1] == true Then var6 = Index; if buyExit[1] == true Then var7 = Index; if sellExit[1] == true Then var8 = Index; E1= IFf(var5 > 0,Index-var5,-1); E2= IFf(var6 > 0,Index-var6,-1); E3= IFf(var7 > 0,Index-var7,-1); E4= IFf(var8 > 0,Index-var8,-1); if buySignal and O3<O1[1] Then { tx1 = Text_New(sDate,sTime,down,"●"); Text_SetColor(tx1,Green); playsound("C:₩KiwoomGlobal₩sound₩매수신호발생1.wav"); } if buySignal and showsignals and O3<O1[1] Then { tx2 = Text_New(sDate,sTime,down,"▲"); Text_SetColor(tx2,Green); } if sellSignal and O4<O2[1] Then { tx3 = Text_New(sDate,sTime,up,"●"); Text_SetColor(tx3,Red); playsound("C:₩KiwoomGlobal₩sound₩매도신호발생1.wav"); } if sellSignal and showsignals and O4<O2[1] Then { tx4 = Text_New(sDate,sTime,down,"▼"); Text_SetColor(tx4,Red); } if buyExit and O1<O3[1] Then { tx5 = Text_New(sDate,sTime,up,"●"); Text_SetColor(tx5,blue); playsound("C:₩KiwoomGlobal₩sound₩시세포착3.wav"); } if buyExit and showsignals and O1<O3[1] Then { tx6 = Text_New(sDate,sTime,down,"▼"); Text_SetColor(tx6,blue); } if sellExit and O2<O4[1] Then { tx7 = Text_New(sDate,sTime,down,"●"); Text_SetColor(tx7,blue); playsound("C:₩KiwoomGlobal₩sound₩시세포착1.wav"); } if sellExit and showsignals and O2<O4[1] Then { tx8 = Text_New(sDate,sTime,down,"▲"); Text_SetColor(tx8,blue); }
프로필 이미지

예스스탁 예스스탁 답변

2024-06-26 17:22:09

안녕하세요 예스스탁입니다. 시뮬레이션 차트에서는 변수최적화 기능이 있어 모든 input변수가 숫자형이어야 합니다. 전략실행차트는 관계가 없습니다. input : showsignals(true); input : highlighting(true); 수식에 위 input변수가 있는데 시스템식에서는 사용하지 않습니다. 2개 삭제하시면 됩니다. input : length(20); input : len2(10); var : upper(0),lower(0); lower = lowest(L,length); upper = highest(H,length); var : up(0),down(0),sup(0),sdown(0); var : k1(0),k2(0),k3(0),k4(0),i1(-1),i2(-1); up=highest(high,length); down=lowest(low,length); sup=highest(high,len2); sdown=lowest(low,len2); if high >= up[1] Then i1 = 0; Else { if i1 >= 0 Then i1 = i1+1; } if Low <= down[1] Then i2 = 0; Else { if i2 >= 0 Then i2 = i2+1; } K1=iff(i1 <=i2, down , up); K2=iff(i1 <= i2,sdown,sup); K3=iff(close>K1,down,nan); K4=iff(close<K1,up,nan); var : buySignal(False),sellSignal(False),buyExit(False),sellExit(False); var : O1(-1),O2(-1),O3(-1),O4(-1); var : E1(-1),E2(-1),E3(-1),E4(-1); var : tx1(0),tx2(0),tx3(0),tx4(0); var : tx5(0),tx6(0),tx7(0),tx8(0); buySignal=high==upper[1] or CrossUp(high,upper[1]); sellSignal = low==lower[1] or CrossUp(lower[1],low); buyExit=low==sdown[1] or CrossUp(sdown[1],low); sellExit = high==sup[1] or CrossUp(high,sup[1]); if BuySignal == true Then var1 = Index; if sellSignal == true Then var2 = Index; if buyExit == true Then var3 = Index; if sellExit == true Then var4 = Index; O1= IFf(var1 > 0,Index-var1,-1); O2= IFf(var2 > 0,Index-var2,-1); O3= IFf(var3 > 0,Index-var3,-1); O4= IFf(var4 > 0,Index-var4,-1); if BuySignal[1] == true Then var5 = Index; if sellSignal[1] == true Then var6 = Index; if buyExit[1] == true Then var7 = Index; if sellExit[1] == true Then var8 = Index; E1= IFf(var5 > 0,Index-var5,-1); E2= IFf(var6 > 0,Index-var6,-1); E3= IFf(var7 > 0,Index-var7,-1); E4= IFf(var8 > 0,Index-var8,-1); if buySignal and O3<O1[1] Then { Buy("b"); } if sellSignal and O4<O2[1] Then { Sell("s"); } if buyExit and O1<O3[1] Then { ExitLong("bx"); } if sellExit and O2<O4[1] Then { ExitShort("sx"); } 즐거운 하루되세요 > 하날랑 님이 쓴 글입니다. > 제목 : 논리값(참/거짓)이나 논리표현식? > 대단히 감사합니다. 시뮬레이션을 돌려 보려고 하니 논리값(참/거짓)이나 논리표현식이 와야합니다라는 메세지가 뜨고 있습니다. 죄송하지만 한번만 더 보완을 해주시면 고맙겠습니다. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 시스템 로직으로 완성해 주시면 감사하겠습니다. > 안녕하세요 예스스탁입니다. input : length(20); input : len2(10); input : showsignals(true); input : highlighting(true); var : upper(0),lower(0); lower = lowest(L,length); upper = highest(H,length); var : up(0),down(0),sup(0),sdown(0); var : k1(0),k2(0),k3(0),k4(0),i1(-1),i2(-1); up=highest(high,length); down=lowest(low,length); sup=highest(high,len2); sdown=lowest(low,len2); if high >= up[1] Then i1 = 0; Else { if i1 >= 0 Then i1 = i1+1; } if Low <= down[1] Then i2 = 0; Else { if i2 >= 0 Then i2 = i2+1; } K1=iff(i1 <=i2, down , up); K2=iff(i1 <= i2,sdown,sup); K3=iff(close>K1,down,nan); K4=iff(close<K1,up,nan); var : buySignal(False),sellSignal(False),buyExit(False),sellExit(False); var : O1(-1),O2(-1),O3(-1),O4(-1); var : E1(-1),E2(-1),E3(-1),E4(-1); var : tx1(0),tx2(0),tx3(0),tx4(0); var : tx5(0),tx6(0),tx7(0),tx8(0); buySignal=high==upper[1] or CrossUp(high,upper[1]); sellSignal = low==lower[1] or CrossUp(lower[1],low); buyExit=low==sdown[1] or CrossUp(sdown[1],low); sellExit = high==sup[1] or CrossUp(high,sup[1]); if BuySignal == true Then var1 = Index; if sellSignal == true Then var2 = Index; if buyExit == true Then var3 = Index; if sellExit == true Then var4 = Index; O1= IFf(var1 > 0,Index-var1,-1); O2= IFf(var2 > 0,Index-var2,-1); O3= IFf(var3 > 0,Index-var3,-1); O4= IFf(var4 > 0,Index-var4,-1); if BuySignal[1] == true Then var5 = Index; if sellSignal[1] == true Then var6 = Index; if buyExit[1] == true Then var7 = Index; if sellExit[1] == true Then var8 = Index; E1= IFf(var5 > 0,Index-var5,-1); E2= IFf(var6 > 0,Index-var6,-1); E3= IFf(var7 > 0,Index-var7,-1); E4= IFf(var8 > 0,Index-var8,-1); if buySignal and O3<O1[1] Then { Buy("b"); } if sellSignal and O4<O2[1] Then { Sell("s"); } if buyExit and O1<O3[1] Then { ExitLong("bx"); } if sellExit and O2<O4[1] Then { ExitShort("sx"); } 즐거운 하루되세요 > 하날랑 님이 쓴 글입니다. > 제목 : 시스템 로직으로 완성해 주시면 감사하겠습니다. > 다음의 로직을 시스템식으로 완성해 주시면 감사하겠습니다. input : length(20); input : len2(10); input : showsignals(true); input : highlighting(true); var : upper(0),lower(0); lower = lowest(L,length); upper = highest(H,length); var : up(0),down(0),sup(0),sdown(0); var : k1(0),k2(0),k3(0),k4(0),i1(-1),i2(-1); up=highest(high,length); down=lowest(low,length); sup=highest(high,len2); sdown=lowest(low,len2); if high >= up[1] Then i1 = 0; Else { if i1 >= 0 Then i1 = i1+1; } if Low <= down[1] Then i2 = 0; Else { if i2 >= 0 Then i2 = i2+1; } K1=iff(i1 <=i2, down , up); K2=iff(i1 <= i2,sdown,sup); K3=iff(close>K1,down,nan); K4=iff(close<K1,up,nan); var : buySignal(False),sellSignal(False),buyExit(False),sellExit(False); var : O1(-1),O2(-1),O3(-1),O4(-1); var : E1(-1),E2(-1),E3(-1),E4(-1); var : tx1(0),tx2(0),tx3(0),tx4(0); var : tx5(0),tx6(0),tx7(0),tx8(0); buySignal=high==upper[1] or CrossUp(high,upper[1]); sellSignal = low==lower[1] or CrossUp(lower[1],low); buyExit=low==sdown[1] or CrossUp(sdown[1],low); sellExit = high==sup[1] or CrossUp(high,sup[1]); if BuySignal == true Then var1 = Index; if sellSignal == true Then var2 = Index; if buyExit == true Then var3 = Index; if sellExit == true Then var4 = Index; O1= IFf(var1 > 0,Index-var1,-1); O2= IFf(var2 > 0,Index-var2,-1); O3= IFf(var3 > 0,Index-var3,-1); O4= IFf(var4 > 0,Index-var4,-1); if BuySignal[1] == true Then var5 = Index; if sellSignal[1] == true Then var6 = Index; if buyExit[1] == true Then var7 = Index; if sellExit[1] == true Then var8 = Index; E1= IFf(var5 > 0,Index-var5,-1); E2= IFf(var6 > 0,Index-var6,-1); E3= IFf(var7 > 0,Index-var7,-1); E4= IFf(var8 > 0,Index-var8,-1); if buySignal and O3<O1[1] Then { tx1 = Text_New(sDate,sTime,down,"●"); Text_SetColor(tx1,Green); playsound("C:₩KiwoomGlobal₩sound₩매수신호발생1.wav"); } if buySignal and showsignals and O3<O1[1] Then { tx2 = Text_New(sDate,sTime,down,"▲"); Text_SetColor(tx2,Green); } if sellSignal and O4<O2[1] Then { tx3 = Text_New(sDate,sTime,up,"●"); Text_SetColor(tx3,Red); playsound("C:₩KiwoomGlobal₩sound₩매도신호발생1.wav"); } if sellSignal and showsignals and O4<O2[1] Then { tx4 = Text_New(sDate,sTime,down,"▼"); Text_SetColor(tx4,Red); } if buyExit and O1<O3[1] Then { tx5 = Text_New(sDate,sTime,up,"●"); Text_SetColor(tx5,blue); playsound("C:₩KiwoomGlobal₩sound₩시세포착3.wav"); } if buyExit and showsignals and O1<O3[1] Then { tx6 = Text_New(sDate,sTime,down,"▼"); Text_SetColor(tx6,blue); } if sellExit and O2<O4[1] Then { tx7 = Text_New(sDate,sTime,down,"●"); Text_SetColor(tx7,blue); playsound("C:₩KiwoomGlobal₩sound₩시세포착1.wav"); } if sellExit and showsignals and O2<O4[1] Then { tx8 = Text_New(sDate,sTime,down,"▲"); Text_SetColor(tx8,blue); }
프로필 이미지

하날랑

2024-06-26 20:09:56

대단히 감사합니다. 덕분에 해결하였습니다. 잘 사용해 보겠습니다. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 논리값(참/거짓)이나 논리표현식? > 안녕하세요 예스스탁입니다. 시뮬레이션 차트에서는 변수최적화 기능이 있어 모든 input변수가 숫자형이어야 합니다. 전략실행차트는 관계가 없습니다. input : showsignals(true); input : highlighting(true); 수식에 위 input변수가 있는데 시스템식에서는 사용하지 않습니다. 2개 삭제하시면 됩니다. input : length(20); input : len2(10); var : upper(0),lower(0); lower = lowest(L,length); upper = highest(H,length); var : up(0),down(0),sup(0),sdown(0); var : k1(0),k2(0),k3(0),k4(0),i1(-1),i2(-1); up=highest(high,length); down=lowest(low,length); sup=highest(high,len2); sdown=lowest(low,len2); if high >= up[1] Then i1 = 0; Else { if i1 >= 0 Then i1 = i1+1; } if Low <= down[1] Then i2 = 0; Else { if i2 >= 0 Then i2 = i2+1; } K1=iff(i1 <=i2, down , up); K2=iff(i1 <= i2,sdown,sup); K3=iff(close>K1,down,nan); K4=iff(close<K1,up,nan); var : buySignal(False),sellSignal(False),buyExit(False),sellExit(False); var : O1(-1),O2(-1),O3(-1),O4(-1); var : E1(-1),E2(-1),E3(-1),E4(-1); var : tx1(0),tx2(0),tx3(0),tx4(0); var : tx5(0),tx6(0),tx7(0),tx8(0); buySignal=high==upper[1] or CrossUp(high,upper[1]); sellSignal = low==lower[1] or CrossUp(lower[1],low); buyExit=low==sdown[1] or CrossUp(sdown[1],low); sellExit = high==sup[1] or CrossUp(high,sup[1]); if BuySignal == true Then var1 = Index; if sellSignal == true Then var2 = Index; if buyExit == true Then var3 = Index; if sellExit == true Then var4 = Index; O1= IFf(var1 > 0,Index-var1,-1); O2= IFf(var2 > 0,Index-var2,-1); O3= IFf(var3 > 0,Index-var3,-1); O4= IFf(var4 > 0,Index-var4,-1); if BuySignal[1] == true Then var5 = Index; if sellSignal[1] == true Then var6 = Index; if buyExit[1] == true Then var7 = Index; if sellExit[1] == true Then var8 = Index; E1= IFf(var5 > 0,Index-var5,-1); E2= IFf(var6 > 0,Index-var6,-1); E3= IFf(var7 > 0,Index-var7,-1); E4= IFf(var8 > 0,Index-var8,-1); if buySignal and O3<O1[1] Then { Buy("b"); } if sellSignal and O4<O2[1] Then { Sell("s"); } if buyExit and O1<O3[1] Then { ExitLong("bx"); } if sellExit and O2<O4[1] Then { ExitShort("sx"); } 즐거운 하루되세요 > 하날랑 님이 쓴 글입니다. > 제목 : 논리값(참/거짓)이나 논리표현식? > 대단히 감사합니다. 시뮬레이션을 돌려 보려고 하니 논리값(참/거짓)이나 논리표현식이 와야합니다라는 메세지가 뜨고 있습니다. 죄송하지만 한번만 더 보완을 해주시면 고맙겠습니다. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 시스템 로직으로 완성해 주시면 감사하겠습니다. > 안녕하세요 예스스탁입니다. input : length(20); input : len2(10); input : showsignals(true); input : highlighting(true); var : upper(0),lower(0); lower = lowest(L,length); upper = highest(H,length); var : up(0),down(0),sup(0),sdown(0); var : k1(0),k2(0),k3(0),k4(0),i1(-1),i2(-1); up=highest(high,length); down=lowest(low,length); sup=highest(high,len2); sdown=lowest(low,len2); if high >= up[1] Then i1 = 0; Else { if i1 >= 0 Then i1 = i1+1; } if Low <= down[1] Then i2 = 0; Else { if i2 >= 0 Then i2 = i2+1; } K1=iff(i1 <=i2, down , up); K2=iff(i1 <= i2,sdown,sup); K3=iff(close>K1,down,nan); K4=iff(close<K1,up,nan); var : buySignal(False),sellSignal(False),buyExit(False),sellExit(False); var : O1(-1),O2(-1),O3(-1),O4(-1); var : E1(-1),E2(-1),E3(-1),E4(-1); var : tx1(0),tx2(0),tx3(0),tx4(0); var : tx5(0),tx6(0),tx7(0),tx8(0); buySignal=high==upper[1] or CrossUp(high,upper[1]); sellSignal = low==lower[1] or CrossUp(lower[1],low); buyExit=low==sdown[1] or CrossUp(sdown[1],low); sellExit = high==sup[1] or CrossUp(high,sup[1]); if BuySignal == true Then var1 = Index; if sellSignal == true Then var2 = Index; if buyExit == true Then var3 = Index; if sellExit == true Then var4 = Index; O1= IFf(var1 > 0,Index-var1,-1); O2= IFf(var2 > 0,Index-var2,-1); O3= IFf(var3 > 0,Index-var3,-1); O4= IFf(var4 > 0,Index-var4,-1); if BuySignal[1] == true Then var5 = Index; if sellSignal[1] == true Then var6 = Index; if buyExit[1] == true Then var7 = Index; if sellExit[1] == true Then var8 = Index; E1= IFf(var5 > 0,Index-var5,-1); E2= IFf(var6 > 0,Index-var6,-1); E3= IFf(var7 > 0,Index-var7,-1); E4= IFf(var8 > 0,Index-var8,-1); if buySignal and O3<O1[1] Then { Buy("b"); } if sellSignal and O4<O2[1] Then { Sell("s"); } if buyExit and O1<O3[1] Then { ExitLong("bx"); } if sellExit and O2<O4[1] Then { ExitShort("sx"); } 즐거운 하루되세요 > 하날랑 님이 쓴 글입니다. > 제목 : 시스템 로직으로 완성해 주시면 감사하겠습니다. > 다음의 로직을 시스템식으로 완성해 주시면 감사하겠습니다. input : length(20); input : len2(10); input : showsignals(true); input : highlighting(true); var : upper(0),lower(0); lower = lowest(L,length); upper = highest(H,length); var : up(0),down(0),sup(0),sdown(0); var : k1(0),k2(0),k3(0),k4(0),i1(-1),i2(-1); up=highest(high,length); down=lowest(low,length); sup=highest(high,len2); sdown=lowest(low,len2); if high >= up[1] Then i1 = 0; Else { if i1 >= 0 Then i1 = i1+1; } if Low <= down[1] Then i2 = 0; Else { if i2 >= 0 Then i2 = i2+1; } K1=iff(i1 <=i2, down , up); K2=iff(i1 <= i2,sdown,sup); K3=iff(close>K1,down,nan); K4=iff(close<K1,up,nan); var : buySignal(False),sellSignal(False),buyExit(False),sellExit(False); var : O1(-1),O2(-1),O3(-1),O4(-1); var : E1(-1),E2(-1),E3(-1),E4(-1); var : tx1(0),tx2(0),tx3(0),tx4(0); var : tx5(0),tx6(0),tx7(0),tx8(0); buySignal=high==upper[1] or CrossUp(high,upper[1]); sellSignal = low==lower[1] or CrossUp(lower[1],low); buyExit=low==sdown[1] or CrossUp(sdown[1],low); sellExit = high==sup[1] or CrossUp(high,sup[1]); if BuySignal == true Then var1 = Index; if sellSignal == true Then var2 = Index; if buyExit == true Then var3 = Index; if sellExit == true Then var4 = Index; O1= IFf(var1 > 0,Index-var1,-1); O2= IFf(var2 > 0,Index-var2,-1); O3= IFf(var3 > 0,Index-var3,-1); O4= IFf(var4 > 0,Index-var4,-1); if BuySignal[1] == true Then var5 = Index; if sellSignal[1] == true Then var6 = Index; if buyExit[1] == true Then var7 = Index; if sellExit[1] == true Then var8 = Index; E1= IFf(var5 > 0,Index-var5,-1); E2= IFf(var6 > 0,Index-var6,-1); E3= IFf(var7 > 0,Index-var7,-1); E4= IFf(var8 > 0,Index-var8,-1); if buySignal and O3<O1[1] Then { tx1 = Text_New(sDate,sTime,down,"●"); Text_SetColor(tx1,Green); playsound("C:₩KiwoomGlobal₩sound₩매수신호발생1.wav"); } if buySignal and showsignals and O3<O1[1] Then { tx2 = Text_New(sDate,sTime,down,"▲"); Text_SetColor(tx2,Green); } if sellSignal and O4<O2[1] Then { tx3 = Text_New(sDate,sTime,up,"●"); Text_SetColor(tx3,Red); playsound("C:₩KiwoomGlobal₩sound₩매도신호발생1.wav"); } if sellSignal and showsignals and O4<O2[1] Then { tx4 = Text_New(sDate,sTime,down,"▼"); Text_SetColor(tx4,Red); } if buyExit and O1<O3[1] Then { tx5 = Text_New(sDate,sTime,up,"●"); Text_SetColor(tx5,blue); playsound("C:₩KiwoomGlobal₩sound₩시세포착3.wav"); } if buyExit and showsignals and O1<O3[1] Then { tx6 = Text_New(sDate,sTime,down,"▼"); Text_SetColor(tx6,blue); } if sellExit and O2<O4[1] Then { tx7 = Text_New(sDate,sTime,down,"●"); Text_SetColor(tx7,blue); playsound("C:₩KiwoomGlobal₩sound₩시세포착1.wav"); } if sellExit and showsignals and O2<O4[1] Then { tx8 = Text_New(sDate,sTime,down,"▲"); Text_SetColor(tx8,blue); }