커뮤니티

수식 문의 드립니다.

프로필 이미지
디얼디어
2016-12-08 16:39:49
117
글번호 104804
답변완료
수식을 합치고 싶습니다. var1 = ma(c,5); var2 = ma(C,20); if var2 < var2[1] and NextBarOpen > var1 Then sell("s",AtStop,NextBarOpen-PriceScale*1); if var2 > var2[1] and NextBarOpen < var1 Then buy("b",AtStop,NextBarOpen+PriceScale*1); 위 수식이랑 아래 수식을 합치고 싶은데 어떻게 하나요? if MarketPosition == 1 Then{ ExitLong("bx1",atlimit,EntryPrice+PriceScale*25); if highest(h,BarsSinceEntry) >= EntryPrice+PriceScale*10 Then ExitLong("bx2",AtStop,EntryPrice+PriceScale*5); Else ExitLong("bx3",AtStop,EntryPrice-PriceScale*1); } if MarketPosition == -1 Then{ ExitShort("sx1",atlimit,EntryPrice-PriceScale*25); if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*10 Then ExitShort("sx2",AtStop,EntryPrice-PriceScale*5); Else ExitShort("sx3",AtStop,EntryPrice+PriceScale*1); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2016-12-08 17:03:52

안녕하세요 예스스탁입니다. 위 수식에 아래수식 내용 추가만 하시면 됩니다. var1 = ma(c,5); var2 = ma(C,20); if var2 < var2[1] and NextBarOpen > var1 Then sell("s",AtStop,NextBarOpen-PriceScale*1); if var2 > var2[1] and NextBarOpen < var1 Then buy("b",AtStop,NextBarOpen+PriceScale*1); if MarketPosition == 1 Then{ ExitLong("bx1",atlimit,EntryPrice+PriceScale*25); if highest(h,BarsSinceEntry) >= EntryPrice+PriceScale*10 Then ExitLong("bx2",AtStop,EntryPrice+PriceScale*5); Else ExitLong("bx3",AtStop,EntryPrice-PriceScale*1); } if MarketPosition == -1 Then{ ExitShort("sx1",atlimit,EntryPrice-PriceScale*25); if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*10 Then ExitShort("sx2",AtStop,EntryPrice-PriceScale*5); Else ExitShort("sx3",AtStop,EntryPrice+PriceScale*1); } 즐거운 하루되세요 > 디얼디어 님이 쓴 글입니다. > 제목 : 수식 문의 드립니다. > 수식을 합치고 싶습니다. var1 = ma(c,5); var2 = ma(C,20); if var2 < var2[1] and NextBarOpen > var1 Then sell("s",AtStop,NextBarOpen-PriceScale*1); if var2 > var2[1] and NextBarOpen < var1 Then buy("b",AtStop,NextBarOpen+PriceScale*1); 위 수식이랑 아래 수식을 합치고 싶은데 어떻게 하나요? if MarketPosition == 1 Then{ ExitLong("bx1",atlimit,EntryPrice+PriceScale*25); if highest(h,BarsSinceEntry) >= EntryPrice+PriceScale*10 Then ExitLong("bx2",AtStop,EntryPrice+PriceScale*5); Else ExitLong("bx3",AtStop,EntryPrice-PriceScale*1); } if MarketPosition == -1 Then{ ExitShort("sx1",atlimit,EntryPrice-PriceScale*25); if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*10 Then ExitShort("sx2",AtStop,EntryPrice-PriceScale*5); Else ExitShort("sx3",AtStop,EntryPrice+PriceScale*1); }