커뮤니티

수식질문입니다

프로필 이미지
엉기
2013-05-09 00:07:08
202
글번호 62983
답변완료
20mbo는 0.5손절 0.8익절 120mbo는 0.6손절 1.0익절 이렇게 다르게 적용하고 싶습니다 또 20mbo가 청산되지 않은상태에서 120mbo가 반대방향으로 걸리면 청산후 바로진입하고 동방향으로 걸리면 120mbo 진입시점부터 0.6손절 1.0익절 원칙을 다시 계산하는 식을 부탁합니다. (예를들어 250에 20mbo진입하여 청산되지 않은 상태에서 250.30에 120mbo가 발동하면 250.80청산이 아니고 250.30에 120mbo진입으로 보고 260.00이 목표가가 되는것입니다)
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2013-05-09 14:25:17

안녕하세요 예스스탁입니다. if stime < 92000 Then{ var1 = dayhigh; var2 = daylow; } if stime < 110000 Then{ var3 = dayhigh; var4 = daylow; } if stime >= 92000 and stime < 110000 and MarketPosition == 0 Then{ if crossup(c,var1) Then buy("20mbo-Buy"); if CrossDown(c,var2) Then sell("20mbo-Sell"); } if stime >= 110000 and MarketPosition == 0 Then{ if crossup(c,var3) Then buy("120mbo-Buy"); if CrossDown(c,var4) Then sell("120mbo-Sell"); } if MarketPosition == 1 Then{ if IsEntryName("20mbo-Buy") == true and Condition1 == false and stime >= 110000 and crossup(c,var3) Then{ Condition1 = true; value1 = C; } if IsEntryName("20mbo-Buy") == true and Condition1 == false Then{ ExitLong("BL1",AtStop,EntryPrice-0.5); ExitLong("BP1",AtLimit,EntryPrice+0.8); } if stime >= 110000 and IsEntryName("20mbo-Buy") == true and Condition1 == true Then{ ExitLong("BL2",AtStop,value1-0.6); ExitLong("BP2",AtLimit,value1+1.0); } if stime >= 110000 and IsEntryName("120mbo-Buy") == true Then{ ExitLong("BL3",AtStop,EntryPrice-0.6); ExitLong("BP3",AtLimit,EntryPrice+1.0); } } Else Condition1 = false; if MarketPosition == -1 Then{ if IsEntryName("20mbo-Sell") == true and Condition2 == false and stime >= 110000 and crossup(c,var3) Then{ Condition2 = true; value2 = C; } if IsEntryName("20mbo-Sell") == true and Condition2 == false Then{ ExitShort("SL1",AtStop,EntryPrice+0.5); ExitShort("SP1",AtLimit,EntryPrice-0.8); } if stime >= 110000 and IsEntryName("20mbo-Buy") == true and Condition1 == true Then{ ExitShort("SL2",AtStop,value2+0.6); ExitShort("SP2",AtLimit,value2-1.0); } if stime >= 110000 and IsEntryName("120mbo-Buy") == true Then{ ExitShort("SL3",AtStop,EntryPrice+0.6); ExitShort("SP3",AtLimit,EntryPrice-1.0); } } Else Condition2 = false; 즐거운 하루되세요 > 엉기 님이 쓴 글입니다. > 제목 : 수식질문입니다 > 20mbo는 0.5손절 0.8익절 120mbo는 0.6손절 1.0익절 이렇게 다르게 적용하고 싶습니다 또 20mbo가 청산되지 않은상태에서 120mbo가 반대방향으로 걸리면 청산후 바로진입하고 동방향으로 걸리면 120mbo 진입시점부터 0.6손절 1.0익절 원칙을 다시 계산하는 식을 부탁합니다. (예를들어 250에 20mbo진입하여 청산되지 않은 상태에서 250.30에 120mbo가 발동하면 250.80청산이 아니고 250.30에 120mbo진입으로 보고 260.00이 목표가가 되는것입니다)