커뮤니티

수식추가 부탁드립니다.

프로필 이미지
대구어린울프
2022-01-11 06:34:15
909
글번호 155321
답변완료
안녕하세요? 아래의 수식에서 추가하고싶은게 두가지가 있는데 잘 안되네요. 1. 당일 시작시간(외부변수) 2. 진입후 바로다음캔들이 진입캔들과 반대가 나올시 청산후 역진입. 부탁드립니다. 감사합니다. input : 진입음봉(5),진입양봉(5); input : P1(5),P2(20),진입횟수(3); input : 익절틱수(50),손절틱수(50); var : entry(0); if bdate != Bdate[1] Then entry = 0; if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; var1 = ma(C,P1); Var2 = ma(C,P2); if MarketPosition == 0 and entry < 진입횟수 and var1 > Var2 and C[1] == O[1] and C[0] <= O[0]-PriceScale*진입음봉 Then Sell(); if MarketPosition == 0 and entry < 진입횟수 and var1 < Var2 and C[1] == O[1] and C[0] >= O[0]+PriceScale*진입양봉 Then Buy(); SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2022-01-11 12:45:43

안녕하세요 예스스탁입니다. input : 진입음봉(5),진입양봉(5),StartTime(93000); input : P1(5),P2(20),진입횟수(3); input : 익절틱수(50),손절틱수(50); var : entry(0),Tcond(False); if bdate != Bdate[1] Then { entry = 0; tcond = False; } if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then Tcond = true; if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; var1 = ma(C,P1); Var2 = ma(C,P2); if Tcond == true and entry < 진입횟수 and var1 > Var2 and C[1] == O[1] and C[0] <= O[0]-PriceScale*진입음봉 Then { if MarketPosition == 0 or (MarketPosition == 1 and BarsSinceEntry == 1) Then Sell(); } if Tcond == true and entry < 진입횟수 and var1 < Var2 and C[1] == O[1] and C[0] >= O[0]+PriceScale*진입양봉 Then { if MarketPosition == 0 or (MarketPosition == -1 and BarsSinceEntry == 1) Then Buy(); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 즐거운 하루되세요 > 대구어린울프 님이 쓴 글입니다. > 제목 : 수식추가 부탁드립니다. > 안녕하세요? 아래의 수식에서 추가하고싶은게 두가지가 있는데 잘 안되네요. 1. 당일 시작시간(외부변수) 2. 진입후 바로다음캔들이 진입캔들과 반대가 나올시 청산후 역진입. 부탁드립니다. 감사합니다. input : 진입음봉(5),진입양봉(5); input : P1(5),P2(20),진입횟수(3); input : 익절틱수(50),손절틱수(50); var : entry(0); if bdate != Bdate[1] Then entry = 0; if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; var1 = ma(C,P1); Var2 = ma(C,P2); if MarketPosition == 0 and entry < 진입횟수 and var1 > Var2 and C[1] == O[1] and C[0] <= O[0]-PriceScale*진입음봉 Then Sell(); if MarketPosition == 0 and entry < 진입횟수 and var1 < Var2 and C[1] == O[1] and C[0] >= O[0]+PriceScale*진입양봉 Then Buy(); SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop);