커뮤니티

수정 부탁드립니다.

프로필 이미지
대구어린울프
2020-07-10 16:03:27
1783
글번호 140580
답변완료
안녕하세요? 아래의 수식에서 하루매매횟를 외부변수로 넣고싶습니다. 부탁드립니다. 감사합니다. Input : 단기(5), 장기(20), profit_pt(0.5), loss_pt(0.5), 장종료청산(151000); Variable : ent_position(0); if MarketPosition == 0 Then{ var1 = 0; ent_position = 0; } //If ma(C,단기)>ma(C,장기) and ( C>O and L==O ) or ( C[1]<O[1] and H[1]==O[1] and C>O ) Then { If ma(C,단기)>ma(C,장기) and ( C>O and L==O ) and ent_position == 0 Then { Buy("매수",AtMarket); Var1 = NextBarOpen; ent_position = 1; } //If ma(C,단기)<ma(C,장기) and ( C<O and H==O ) or ( C[1]>O[1] and L[1]==O[1] and C<O ) Then { If ma(C,단기)<ma(C,장기) and ( C<O and H==O ) and ent_position == 0 Then { Sell("매도",AtMarket); Var1 = NextBarOpen; ent_position = -1; } if PositionProfit >= profit_pt and ent_position<>0 Then{ if ent_position == 1 and C<O Then { ExitLong("매수청산"); } if ent_position == -1 and C>O Then { ExitLong("매도청산"); } } SetStopLoss(loss_pt,PointStop); SetStopEndofday(장종료청산);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2020-07-13 09:28:01

안녕하세요 예스스탁입니다. Input : 단기(5), 장기(20), profit_pt(0.5), loss_pt(0.5), 장종료청산(151000),진입횟수(3); Variable : ent_position(0),entry(0); if MarketPosition == 0 Then{ var1 = 0; ent_position = 0; entry = 0; } if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition != MarketPosition[1] and TotalTrades > TotalTrades[1]) then entry = entry+1; //If ma(C,단기)>ma(C,장기) and ( C>O and L==O ) or ( C[1]<O[1] and H[1]==O[1] and C>O ) Then { If ma(C,단기)>ma(C,장기) and ( C>O and L==O ) and ent_position == 0 and entry < 진입횟수 Then { Buy("매수",AtMarket); Var1 = NextBarOpen; ent_position = 1; } //If ma(C,단기)<ma(C,장기) and ( C<O and H==O ) or ( C[1]>O[1] and L[1]==O[1] and C<O ) Then { If ma(C,단기)<ma(C,장기) and ( C<O and H==O ) and ent_position == 0 and entry < 진입횟수 Then { Sell("매도",AtMarket); Var1 = NextBarOpen; ent_position = -1; } if PositionProfit >= profit_pt and ent_position<>0 Then{ if ent_position == 1 and C<O Then { ExitLong("매수청산"); } if ent_position == -1 and C>O Then { ExitLong("매도청산"); } } SetStopLoss(loss_pt,PointStop); SetStopEndofday(장종료청산); 즐거운 하루되세요 > 대구어린울프 님이 쓴 글입니다. > 제목 : 수정 부탁드립니다. > 안녕하세요? 아래의 수식에서 하루매매횟를 외부변수로 넣고싶습니다. 부탁드립니다. 감사합니다. Input : 단기(5), 장기(20), profit_pt(0.5), loss_pt(0.5), 장종료청산(151000); Variable : ent_position(0); if MarketPosition == 0 Then{ var1 = 0; ent_position = 0; } //If ma(C,단기)>ma(C,장기) and ( C>O and L==O ) or ( C[1]<O[1] and H[1]==O[1] and C>O ) Then { If ma(C,단기)>ma(C,장기) and ( C>O and L==O ) and ent_position == 0 Then { Buy("매수",AtMarket); Var1 = NextBarOpen; ent_position = 1; } //If ma(C,단기)<ma(C,장기) and ( C<O and H==O ) or ( C[1]>O[1] and L[1]==O[1] and C<O ) Then { If ma(C,단기)<ma(C,장기) and ( C<O and H==O ) and ent_position == 0 Then { Sell("매도",AtMarket); Var1 = NextBarOpen; ent_position = -1; } if PositionProfit >= profit_pt and ent_position<>0 Then{ if ent_position == 1 and C<O Then { ExitLong("매수청산"); } if ent_position == -1 and C>O Then { ExitLong("매도청산"); } } SetStopLoss(loss_pt,PointStop); SetStopEndofday(장종료청산);