커뮤니티

청산식 요청

프로필 이미지
요타
2019-02-25 21:10:53
137
글번호 126552
답변완료
* 많은 도움에 고맙습니다. * 아래 식에서 1차로 청산후 다시 매매(매수 or 매도) 해서 10틱 수익후 청산 하려는데 안되네요 수식좀 봐주십시요. 즉 1차 청산후 청산명칭으로 바로 재매매(매수 or매도)해서 무조간 10틱 수익이면 청산 입니다. if MarketPosition == 1 and highest(h,BarsSinceEntry) >= EntryPrice+PriceScale*14 Then ExitLong("청산후매도",AtStop,highest(h,BarsSinceEntry)-PriceScale-5); if MarketPosition == -1 and Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*14 Then ExitShort("청산후매수",AtStop,Lowest(L,BarsSinceEntry)+PriceScale-5); ## 명칭에 따른 수익 청산 if MarketPosition == -1 and IsEntryName("청산후매도") == true then {sell"sx",AtStop,EntryPrice+PriceScale*10);} if MarketPosition == 1 and IsEntryName("청산후매수") == true then {buy("bx",AtStop,EntryPrice-PriceScale*10); } * 고맙 습니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2019-02-26 14:13:30

안녕하세요 예스스탁입니다. 진입청산함수를 잘못사용하셨습니다. if MarketPosition == 1 and highest(h,BarsSinceEntry) >= EntryPrice+PriceScale*14 Then Sell("청산후매도",AtStop,highest(h,BarsSinceEntry)-PriceScale-5); if MarketPosition == -1 and Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*14 Then Buy("청산후매수",AtStop,Lowest(L,BarsSinceEntry)+PriceScale-5); ## 명칭에 따른 수익 청산 if MarketPosition == -1 and IsEntryName("청산후매도") == true then { ExitShort("sx",AtStop,EntryPrice+PriceScale*10); } if MarketPosition == 1 and IsEntryName("청산후매수") == true then { ExitLong("bx",AtStop,EntryPrice-PriceScale*10); } 즐거운 하루되세요 > 요타 님이 쓴 글입니다. > 제목 : 청산식 요청 > * 많은 도움에 고맙습니다. * 아래 식에서 1차로 청산후 다시 매매(매수 or 매도) 해서 10틱 수익후 청산 하려는데 안되네요 수식좀 봐주십시요. 즉 1차 청산후 청산명칭으로 바로 재매매(매수 or매도)해서 무조간 10틱 수익이면 청산 입니다. if MarketPosition == 1 and highest(h,BarsSinceEntry) >= EntryPrice+PriceScale*14 Then ExitLong("청산후매도",AtStop,highest(h,BarsSinceEntry)-PriceScale-5); if MarketPosition == -1 and Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*14 Then ExitShort("청산후매수",AtStop,Lowest(L,BarsSinceEntry)+PriceScale-5); ## 명칭에 따른 수익 청산 if MarketPosition == -1 and IsEntryName("청산후매도") == true then {sell"sx",AtStop,EntryPrice+PriceScale*10);} if MarketPosition == 1 and IsEntryName("청산후매수") == true then {buy("bx",AtStop,EntryPrice-PriceScale*10); } * 고맙 습니다.