커뮤니티

시스템 수정 부탁드립니다.

프로필 이미지
고박사122
2018-04-05 13:25:13
132
글번호 117975
답변완료
안녕하세요 아래 수식에서 진입시 수량을 3개로 하고 수익청산 시 3개의 수량을 차례로 6틱/12틱/18틱 수익 시 순차적으로 청산이 가능하도록 하며 변수로 처리해서 최적화가 가능하도록 해주셨으면 합니다. 손절 시는 3개의 수량을 모두 10틱으로 하고 이것역시 변수로 처리해서 최적화가 가능하도록 해주셨으면 합니다. input : 거래시간 (1), 시작시간 (160000), 끝시간 (045000),익절틱수 (10),손절틱수 (10); input : P1(40), ADXP(9); Var: value(0), HH(0), LL(0), HHH(0), LLL(0), FK(0), Condition3(false); HHH = highest(H,P1); LLL = lowest(L,P1); FK = (C-LLL) / (HHH-LLL) * 100; var1 = adx(ADXP); if 거래시간 == 1 then condition3 = (stime>=시작시간 or stime<=끝시간); Else if 거래시간 == 2 then condition3 = (stime>=시작시간 and stime<=끝시간); Else condition3 = true; # 매수/매도청산 If MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and var1 < 25 and crossup(FK,80) Then { Sell(); } # 매도/매수청산 If MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and var1 < 25 and CrossDown(FK,20) Then { Buy(); } if MarketPosition == 1 Then{ LL = Floor((highest(H,BarsSinceEntry) - EntryPrice)/(PriceScale*손절틱수 )); ExitLong("bx",AtStop,(EntryPrice-(PriceScale*손절틱수 ))+(PriceScale*손절틱수 )*LL); } if MarketPosition == -1 Then{ HH = Floor((EntryPrice-Lowest(L,BarsSinceEntry))/(PriceScale*손절틱수 )); ExitShort("sx",AtStop,(EntryPrice+(PriceScale*손절틱수))-(PriceScale*손절틱수 )*HH); } SetStopProfittarget(PriceScale*익절틱수,PointStop); if stime == 끝시간 or (stime > 끝시간 and stime[1] < 끝시간 ) Then{ if MarketPosition == 1 Then ExitLong(); if MarketPosition == -1 Then ExitShort(); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2018-04-05 17:32:54

안녕하세요 예스스탁입니다. input : 거래시간 (1), 시작시간 (160000), 끝시간 (045000),익절틱수1(6),익절틱수2(12),익절틱수3(18),손절틱수 (10); input : P1(40), ADXP(9); Var: value(0), HH(0), LL(0), HHH(0), LLL(0), FK(0), Condition3(false); HHH = highest(H,P1); LLL = lowest(L,P1); FK = (C-LLL) / (HHH-LLL) * 100; var1 = adx(ADXP); if 거래시간 == 1 then condition3 = (stime>=시작시간 or stime<=끝시간); Else if 거래시간 == 2 then condition3 = (stime>=시작시간 and stime<=끝시간); Else condition3 = true; # 매수/매도청산 If MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and var1 < 25 and crossup(FK,80) Then { Sell("s",OnClose,def,3); } # 매도/매수청산 If MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and var1 < 25 and CrossDown(FK,20) Then { Buy("b",OnClose,def,3); } if MarketPosition == 1 Then{ ExitLong("bp1",atlimit,EntryPrice+PriceScale*익절틱수1,"",1,1); ExitLong("bp2",atlimit,EntryPrice+PriceScale*익절틱수2,"",1,1); ExitLong("bp3",atlimit,EntryPrice+PriceScale*익절틱수3); } if MarketPosition == 1 Then{ ExitShort("sp1",atlimit,EntryPrice-PriceScale*익절틱수1,"",1,1); ExitShort("sp2",atlimit,EntryPrice-PriceScale*익절틱수2,"",1,1); ExitShort("sp3",atlimit,EntryPrice-PriceScale*익절틱수3); } SetStopLoss(PriceScale*손절틱수,PointStop); if stime == 끝시간 or (stime > 끝시간 and stime[1] < 끝시간 ) Then{ if MarketPosition == 1 Then ExitLong(); if MarketPosition == -1 Then ExitShort(); } 즐거운 하루되세요 > 고박사122 님이 쓴 글입니다. > 제목 : 시스템 수정 부탁드립니다. > 안녕하세요 아래 수식에서 진입시 수량을 3개로 하고 수익청산 시 3개의 수량을 차례로 6틱/12틱/18틱 수익 시 순차적으로 청산이 가능하도록 하며 변수로 처리해서 최적화가 가능하도록 해주셨으면 합니다. 손절 시는 3개의 수량을 모두 10틱으로 하고 이것역시 변수로 처리해서 최적화가 가능하도록 해주셨으면 합니다. input : 거래시간 (1), 시작시간 (160000), 끝시간 (045000),익절틱수 (10),손절틱수 (10); input : P1(40), ADXP(9); Var: value(0), HH(0), LL(0), HHH(0), LLL(0), FK(0), Condition3(false); HHH = highest(H,P1); LLL = lowest(L,P1); FK = (C-LLL) / (HHH-LLL) * 100; var1 = adx(ADXP); if 거래시간 == 1 then condition3 = (stime>=시작시간 or stime<=끝시간); Else if 거래시간 == 2 then condition3 = (stime>=시작시간 and stime<=끝시간); Else condition3 = true; # 매수/매도청산 If MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and var1 < 25 and crossup(FK,80) Then { Sell(); } # 매도/매수청산 If MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and var1 < 25 and CrossDown(FK,20) Then { Buy(); } if MarketPosition == 1 Then{ LL = Floor((highest(H,BarsSinceEntry) - EntryPrice)/(PriceScale*손절틱수 )); ExitLong("bx",AtStop,(EntryPrice-(PriceScale*손절틱수 ))+(PriceScale*손절틱수 )*LL); } if MarketPosition == -1 Then{ HH = Floor((EntryPrice-Lowest(L,BarsSinceEntry))/(PriceScale*손절틱수 )); ExitShort("sx",AtStop,(EntryPrice+(PriceScale*손절틱수))-(PriceScale*손절틱수 )*HH); } SetStopProfittarget(PriceScale*익절틱수,PointStop); if stime == 끝시간 or (stime > 끝시간 and stime[1] < 끝시간 ) Then{ if MarketPosition == 1 Then ExitLong(); if MarketPosition == -1 Then ExitShort(); }