커뮤니티

수식추가 부탁드립니다.

프로필 이미지
대구어린울프
2021-06-01 20:22:46
355
글번호 149516
답변완료
안녕하세요? 아래의 수식에서 하루 진입횟수를 추가하고 싶습니다. input : P1(5),P2(20),n(0); input : 익절틱수(50),손절틱수(50); var1 = ma(C,5); Var2 = ma(C,20); if var1 > Var2 and ((O > C[1] and C == O) or (C>O)) Then { value1 = Index; Condition1 = False; } if MarketPosition == 0 and Condition1 == False and Index > value1 and Index < value1+n and C < O Then { Condition1 = true; Sell(); } if var1 < Var2 and ((O < C[1] and C == O) or (C<O)) Then { value2 = Index; Condition2 = False; } if MarketPosition == 0 and Condition2 == False and Index > value2 and Index < value2+n and C > O Then { Condition2 = true; Buy(); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); ---------------------------------------------------------------- ps : 사실 전에 피드백 해주신것중에, 매매횟수 추가가 있어서 아래의 수식을 참고하여 적용해보려했지만, 단순히 붙여넣기만 해보니 매매횟수 적용이 전혀안되더라구요. 제가 잘못 파악한건지요? 늘 도움에 감사합니다 영자님. input : 매매횟수(3); 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;
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2021-06-02 09:12:04

안녕하세요 예스스탁입니다. input : 매매횟수(3); 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; 위 내용은 당일 진입횟수를 카운트 해서 entry라는 변수에 저장을 하는 계산식입니다. 수식안에 계산식이 있다고 진입이 제어되는 것이 아닙니다. 각 진입식에 if문에 entry < 매매횟수 라는 조건이 들어가야 매매횟수 제한이 됩니다. input : 매매횟수(3); input : P1(5),P2(20),n(0); 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,5); Var2 = ma(C,20); if var1 > Var2 and ((O > C[1] and C == O) or (C>O)) Then { value1 = Index; Condition1 = False; } if MarketPosition == 0 and Condition1 == False and Index > value1 and Index < value1+n and C < O and entry < 매매횟수 Then { Condition1 = true; Sell(); } if var1 < Var2 and ((O < C[1] and C == O) or (C<O)) Then { value2 = Index; Condition2 = False; } if MarketPosition == 0 and Condition2 == False and Index > value2 and Index < value2+n and C > O and entry < 매매횟수 Then { Condition2 = true; Buy(); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 즐거운 하루되세요 > 대구어린울프 님이 쓴 글입니다. > 제목 : 수식추가 부탁드립니다. > 안녕하세요? 아래의 수식에서 하루 진입횟수를 추가하고 싶습니다. input : P1(5),P2(20),n(0); input : 익절틱수(50),손절틱수(50); var1 = ma(C,5); Var2 = ma(C,20); if var1 > Var2 and ((O > C[1] and C == O) or (C>O)) Then { value1 = Index; Condition1 = False; } if MarketPosition == 0 and Condition1 == False and Index > value1 and Index < value1+n and C < O Then { Condition1 = true; Sell(); } if var1 < Var2 and ((O < C[1] and C == O) or (C<O)) Then { value2 = Index; Condition2 = False; } if MarketPosition == 0 and Condition2 == False and Index > value2 and Index < value2+n and C > O Then { Condition2 = true; Buy(); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); ---------------------------------------------------------------- ps : 사실 전에 피드백 해주신것중에, 매매횟수 추가가 있어서 아래의 수식을 참고하여 적용해보려했지만, 단순히 붙여넣기만 해보니 매매횟수 적용이 전혀안되더라구요. 제가 잘못 파악한건지요? 늘 도움에 감사합니다 영자님. input : 매매횟수(3); 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;