커뮤니티

신호미발생

프로필 이미지
피카2
2022-05-28 15:16:16
1300
글번호 159384
답변완료
//식수정 부탁드립니다. 1분봉에서 돌렸는데도 b2 매수신호가 발생하지 않습니다 감사드립니다 Input: DN(0.4),TS(2),AT(15),MUL(2); var : cnt(0),이익횟수(0); var : cond1(False),cond2(False); value1 = ma(C, 5); value2 = ma(C, 20); if bdate != bdate[1] Then { 이익횟수 = 0; } if TotalTrades > TotalTrades[1] Then { if PositionProfit(cnt) > 0 Then 이익횟수 = 이익횟수+1; } #당일 이익횟수는 2회이상이고 앞에100봉내에서 2회이상 이익발생 이면 cond2 = 이익횟수 >=2 and CountIf(TotalTrades > TotalTrades[1] and PositionProfit(1) = 0,200) >= 2; If MarketPosition == 0 and TotalTrades == TotalTrades[1] Then { if CrossUp(Value1,Value2) Then //cond1==True? Buy("b1"); if cond2 ==True Then //and CrossUp(Value1,Value2)?? Buy("b2"); } if MarketPosition == 1 Then { if IsEntryName("b1") Then SetStopTrailing(dn,ts,PercentStop,1); Else SetStopTrailing(0,0);#해제 if IsEntryName("b2") Then { exitlong("t청산",atstop,highest(High,barsSinceEntry)-atr(at)*mul); } } Else { SetStopTrailing(0,0);#해제 } SetStopLoss(1,PercentStop); SetStopEndofday(151000);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2022-05-30 11:38:46

안녕하세요 예스스탁입니다. 1 cond2 = 이익횟수 >=2 and CountIf(TotalTrades > TotalTrades[1] and PositionProfit(1) = 0,200) >= 2; 예스랭귀지에서 같다라는 표현은 == 입니다. 손익이 0이면 PositionProfit(1) == 0이 되어야 합니다. 100봉이내 이익이 2회이상이므로 아래와 같이 수정했습니다. cond2 = 이익횟수 >=2 and CountIf(TotalTrades > TotalTrades[1] and PositionProfit(1) > 0,100) >= 2; 2 이익횟수 체크하는 부분에 문제가 있어 수정했습니다. 3 Input: DN(0.4),TS(2),AT(15),MUL(2); var : cnt(0),이익횟수(0); var : cond1(False),cond2(False); value1 = ma(C, 5); value2 = ma(C, 20); if bdate != bdate[1] Then { 이익횟수 = 0; } if TotalTrades > TotalTrades[1] Then { if PositionProfit(1) > 0 Then 이익횟수 = 이익횟수+1; } #당일 이익횟수는 2회이상이고 앞에100봉내에서 2회이상 이익발생 이면 cond2 = 이익횟수 >=2 and CountIf(TotalTrades > TotalTrades[1] and PositionProfit(1) > 0,100) >= 2; If MarketPosition == 0 and TotalTrades == TotalTrades[1] Then { if CrossUp(Value1,Value2) Then //cond1==True? Buy("b1"); if cond2 ==True Then //and CrossUp(Value1,Value2)?? Buy("b2"); } if MarketPosition == 1 Then { if IsEntryName("b1") Then SetStopTrailing(dn,ts,PercentStop,1); Else SetStopTrailing(0,0);#해제 if IsEntryName("b2") Then { exitlong("t청산",atstop,highest(High,barsSinceEntry)-atr(at)*mul); } } Else { SetStopTrailing(0,0);#해제 } SetStopLoss(1,PercentStop); SetStopEndofday(151000); 즐거운 하루되세요 > 피카2 님이 쓴 글입니다. > 제목 : 신호미발생 > //식수정 부탁드립니다. 1분봉에서 돌렸는데도 b2 매수신호가 발생하지 않습니다 감사드립니다 Input: DN(0.4),TS(2),AT(15),MUL(2); var : cnt(0),이익횟수(0); var : cond1(False),cond2(False); value1 = ma(C, 5); value2 = ma(C, 20); if bdate != bdate[1] Then { 이익횟수 = 0; } if TotalTrades > TotalTrades[1] Then { if PositionProfit(cnt) > 0 Then 이익횟수 = 이익횟수+1; } #당일 이익횟수는 2회이상이고 앞에100봉내에서 2회이상 이익발생 이면 cond2 = 이익횟수 >=2 and CountIf(TotalTrades > TotalTrades[1] and PositionProfit(1) = 0,200) >= 2; If MarketPosition == 0 and TotalTrades == TotalTrades[1] Then { if CrossUp(Value1,Value2) Then //cond1==True? Buy("b1"); if cond2 ==True Then //and CrossUp(Value1,Value2)?? Buy("b2"); } if MarketPosition == 1 Then { if IsEntryName("b1") Then SetStopTrailing(dn,ts,PercentStop,1); Else SetStopTrailing(0,0);#해제 if IsEntryName("b2") Then { exitlong("t청산",atstop,highest(High,barsSinceEntry)-atr(at)*mul); } } Else { SetStopTrailing(0,0);#해제 } SetStopLoss(1,PercentStop); SetStopEndofday(151000);