커뮤니티

수식요청드립니다.

프로필 이미지
dandy
2016-12-28 14:06:22
93
글번호 105368
답변완료
안녕하세요. 연결선물 당일청산 아래수식의 점검과 매도수식 추가 부탁 드립니다. 감사합니다. var1 = ma(c,30); var2 = -0; var3 = C-var2; input : atr추적(5.0), atr손절(2.0); var : poshigh(0), poslow(0); Input : shortPeriod(5), longPeriod(20); value1 = ma(C, shortPeriod); value2 = ma(C, longPeriod); if var3 > var3[1] and var3 > 0 and var3[1] > 0 Then value1 = var3[1]; if MarketPosition <= 0 and ((C > var1 and C > C[1]) or (var3 > 0 and var3 < value1)) Then{ if TotalTrades == 0 or (TotalTrades > 0 and BarsSinceExit(1) != 0) Then buy("매수"); } # 매도수식 추가요청 poshigh = highest(h, BarsSinceEntry+1); poslow = Lowest(l, BarsSinceEntry+1); if MarketPosition == 1 then{ ExitLong("EL_추적art", AtStop, poshigh-atr(20)*atr추적); ExitLong("EL_손절art", AtStop, EntryPrice-atr(20)*atr손절); ExitLong("상수익", AtLimit, int(bp*1.1/0.05+0.00001)*0.1); ExitLong("하손절", Atstop, bp-int(bp*0.1/0.05)*0.05+0.5); } if MarketPosition == -1 Then{ Exitshort("ES_추적art", AtStop, poslow+atr(20)*atr추적); Exitshort("ES_손절art", AtStop, EntryPrice+atr(20)*atr손절); ExitShort("하수익", AtLimit, bp-int(bp*0.1/0.05)*0.05); ExitShort("상손절", Atstop, int(bp*1.1/0.05+0.00001)*0.05-0.5); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2016-12-29 09:30:20

안녕하세요 예스스탁입니다. input : atr추적(5.0), atr손절(2.0); var : poshigh(0), poslow(0); Input : shortPeriod(5), longPeriod(20); var1 = ma(c,30); var2 = -0; var3 = C-var2; value1 = ma(C, shortPeriod); value2 = ma(C, longPeriod); if var3 > var3[1] and var3 > 0 and var3[1] > 0 Then value1 = var3[1]; if MarketPosition <= 0 and ((C > var1 and C > C[1]) or (var3 > 0 and var3 < value1)) Then{ if TotalTrades == 0 or (TotalTrades > 0 and BarsSinceExit(1) != 0) Then buy("매수"); } if var3 < var3[1] and var3 < 0 and var3[1] < 0 Then value2 = var3[1]; if MarketPosition >= 0 and ((C < var1 and C < C[1]) or (var3 < 0 and var3 > value2)) Then{ if TotalTrades == 0 or (TotalTrades > 0 and BarsSinceExit(1) != 0) Then sell("매도"); } poshigh = highest(h, BarsSinceEntry+1); poslow = Lowest(l, BarsSinceEntry+1); if MarketPosition == 1 then{ ExitLong("EL_추적art", AtStop, poshigh-atr(20)*atr추적); ExitLong("EL_손절art", AtStop, EntryPrice-atr(20)*atr손절); ExitLong("상수익", AtLimit, int(bp*1.1/0.05+0.00001)*0.1); ExitLong("하손절", Atstop, bp-int(bp*0.1/0.05)*0.05+0.5); } if MarketPosition == -1 Then{ Exitshort("ES_추적art", AtStop, poslow+atr(20)*atr추적); Exitshort("ES_손절art", AtStop, EntryPrice+atr(20)*atr손절); ExitShort("하수익", AtLimit, bp-int(bp*0.1/0.05)*0.05); ExitShort("상손절", Atstop, int(bp*1.1/0.05+0.00001)*0.05-0.5); } 즐거운 하루되세요 > dandy 님이 쓴 글입니다. > 제목 : 수식요청드립니다. > 안녕하세요. 연결선물 당일청산 아래수식의 점검과 매도수식 추가 부탁 드립니다. 감사합니다. var1 = ma(c,30); var2 = -0; var3 = C-var2; input : atr추적(5.0), atr손절(2.0); var : poshigh(0), poslow(0); Input : shortPeriod(5), longPeriod(20); value1 = ma(C, shortPeriod); value2 = ma(C, longPeriod); if var3 > var3[1] and var3 > 0 and var3[1] > 0 Then value1 = var3[1]; if MarketPosition <= 0 and ((C > var1 and C > C[1]) or (var3 > 0 and var3 < value1)) Then{ if TotalTrades == 0 or (TotalTrades > 0 and BarsSinceExit(1) != 0) Then buy("매수"); } # 매도수식 추가요청 poshigh = highest(h, BarsSinceEntry+1); poslow = Lowest(l, BarsSinceEntry+1); if MarketPosition == 1 then{ ExitLong("EL_추적art", AtStop, poshigh-atr(20)*atr추적); ExitLong("EL_손절art", AtStop, EntryPrice-atr(20)*atr손절); ExitLong("상수익", AtLimit, int(bp*1.1/0.05+0.00001)*0.1); ExitLong("하손절", Atstop, bp-int(bp*0.1/0.05)*0.05+0.5); } if MarketPosition == -1 Then{ Exitshort("ES_추적art", AtStop, poslow+atr(20)*atr추적); Exitshort("ES_손절art", AtStop, EntryPrice+atr(20)*atr손절); ExitShort("하수익", AtLimit, bp-int(bp*0.1/0.05)*0.05); ExitShort("상손절", Atstop, int(bp*1.1/0.05+0.00001)*0.05-0.5); }