커뮤니티

함수식

프로필 이미지
달마7
2019-01-24 09:35:28
143
글번호 125503
답변완료

첨부 이미지

안녕하세요 항상감사드려요 보내주신 아래식에서 매수 방향손절후 연속 매수방향 진입신호가 발생합니다 매수방향 손절후 매도방향으로만 신호가 나오도록 부탁드립니다 매도방향쪽도 부탁드립니다 Input : short(12), long(26), signal(9); Input : Period(20), LPercent(100), SPercent(100); Var : MACDV(0) , MACDS(0),T(0),value(0); var : Hi1(0),Hi2(0),Hc1(0),Hc2(0),Li1(0),Li2(0),Lc1(0),Lc2(0); var : S(0); MACDV = MACD(short, long); MACDS = ema(MACDV,signal); value = Disparity(Period) ; Condition1 = MarketPosition == 0 and MarketPosition(1) == 1 and IsExitName("StopLoss",1) == true; Condition2 = MarketPosition == 0 and MarketPosition(1) == -1 and IsExitName("StopLoss",1) == true; if crossup(MACDV,MACDS) Then { T = 1; Hi1 = MACDV; Hi2 = Hi1[1]; Hc1 = C; Hc2 = Hc1[1]; if S <= 0 and value >= LPercent and Li1 > Li2 and Lc1 < Lc2 and Lc2 > 0 Then { S = 1; var1 = C; } } if CrossDown(MACDV,MACDS) Then { T = -1; Li1 = MACDV; Li2 = Li1[1]; Lc1 = C; Lc2 = Lc1[1]; if S >= 0 and value >= SPercent and Hi1 < Hi2 and Hc1 > Hc2 and Hc2 > 0 Then { S = -1; var1 = C; } } if T == 1 and MACDV > Hi1 Then { Hi1 = MACDV; HC1 = C; } if T == -1 and MACDV < Li1 Then { Li1 = MACDV; LC1 = C; } if S == 1 and Condition1 == false Then buy("b",atlimit,var1-PriceScale*10); if S == -1 and Condition2 == false Then sell("s",atlimit,var1+PriceScale*10); 수고하세요
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2019-01-24 14:01:34

안녕하세요 예스스탁입니다. 식을 수정했습니다. Input : short(12), long(26), signal(9); Input : Period(20), LPercent(100), SPercent(100); Var : MACDV(0) , MACDS(0),T(0),value(0); var : Hi1(0),Hi2(0),Hc1(0),Hc2(0),Li1(0),Li2(0),Lc1(0),Lc2(0); var : S(0); MACDV = MACD(short, long); MACDS = ema(MACDV,signal); value = Disparity(Period) ; Condition1 = MarketPosition == 0 and MarketPosition(1) == 1 and IsExitName("StopLoss",1) == true; Condition2 = MarketPosition == 0 and MarketPosition(1) == -1 and IsExitName("StopLoss",1) == true; if crossup(MACDV,MACDS) Then { T = 1; Hi1 = MACDV; Hi2 = Hi1[1]; Hc1 = C; Hc2 = Hc1[1]; if S <= 0 and value >= LPercent and Li1 > Li2 and Lc1 < Lc2 and Lc2 > 0 Then { S = 1; var1 = C; } } if CrossDown(MACDV,MACDS) Then { T = -1; Li1 = MACDV; Li2 = Li1[1]; Lc1 = C; Lc2 = Lc1[1]; if S >= 0 and value >= SPercent and Hi1 < Hi2 and Hc1 > Hc2 and Hc2 > 0 Then { S = -1; var1 = C; } } if T == 1 and MACDV > Hi1 Then { Hi1 = MACDV; HC1 = C; } if T == -1 and MACDV < Li1 Then { Li1 = MACDV; LC1 = C; } if S == 1 and Condition1 == false and MarketPosition <= 0 Then buy("b",atlimit,var1-PriceScale*10); if S == -1 and Condition2 == false and MarketPosition >= 0 Then sell("s",atlimit,var1+PriceScale*10); 즐거운 하루되세요 > 달마7 님이 쓴 글입니다. > 제목 : 함수식 > 안녕하세요 항상감사드려요 보내주신 아래식에서 매수 방향손절후 연속 매수방향 진입신호가 발생합니다 매수방향 손절후 매도방향으로만 신호가 나오도록 부탁드립니다 매도방향쪽도 부탁드립니다 Input : short(12), long(26), signal(9); Input : Period(20), LPercent(100), SPercent(100); Var : MACDV(0) , MACDS(0),T(0),value(0); var : Hi1(0),Hi2(0),Hc1(0),Hc2(0),Li1(0),Li2(0),Lc1(0),Lc2(0); var : S(0); MACDV = MACD(short, long); MACDS = ema(MACDV,signal); value = Disparity(Period) ; Condition1 = MarketPosition == 0 and MarketPosition(1) == 1 and IsExitName("StopLoss",1) == true; Condition2 = MarketPosition == 0 and MarketPosition(1) == -1 and IsExitName("StopLoss",1) == true; if crossup(MACDV,MACDS) Then { T = 1; Hi1 = MACDV; Hi2 = Hi1[1]; Hc1 = C; Hc2 = Hc1[1]; if S <= 0 and value >= LPercent and Li1 > Li2 and Lc1 < Lc2 and Lc2 > 0 Then { S = 1; var1 = C; } } if CrossDown(MACDV,MACDS) Then { T = -1; Li1 = MACDV; Li2 = Li1[1]; Lc1 = C; Lc2 = Lc1[1]; if S >= 0 and value >= SPercent and Hi1 < Hi2 and Hc1 > Hc2 and Hc2 > 0 Then { S = -1; var1 = C; } } if T == 1 and MACDV > Hi1 Then { Hi1 = MACDV; HC1 = C; } if T == -1 and MACDV < Li1 Then { Li1 = MACDV; LC1 = C; } if S == 1 and Condition1 == false Then buy("b",atlimit,var1-PriceScale*10); if S == -1 and Condition2 == false Then sell("s",atlimit,var1+PriceScale*10); 수고하세요