커뮤니티

청산 수식

프로필 이미지
목마와숙녀
2018-05-25 09:34:17
196
글번호 119189
답변완료
아래는 청산 수식입니다. A방식이 조건만족시 즉시(봉완성시 아님) 수식이 맞다면 A방식의 trailing stop 대신에 B방식의 trailing stop(수익감소포인트,최소수익포인트)으로 수정바랍니다. 아니면, B방식을 조건만족시 즉시로 수정해주셔도 됩니다. 끝으로, A,B 두방식의 차이는 무엇인지요? ***************************************************************** A)방식 ***BUY if MarketPosition == 1 then { if IsEntryName("b1") == true then { ExitLong("bl1",AtStop,EntryPrice-PriceScale*손절); ExitLong("bp1",Atlimit,EntryPrice+PriceScale*익절); ExitLong("btr1",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR); } ***SELL if MarketPosition == -1 then { if IsEntryName("s1") == true then { ExitShort("sl1",AtStop,EntryPrice+PriceScale*손절); ExitShort("sp1",AtLimit,EntryPrice-PriceScale*익절); ExitShort("str1",AtStop,Lowest(l,BarsSinceEntry)+PriceScale*TR); } B)방식 SetStopProfittarget(수익틱수*PriceScale,PointStop); SetStopLoss(손절틱수*PriceScale,PointStop); SetStopTrailing(수익감소틱수*PriceScale,최소수익틱수*PriceScale,PointStop);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2018-05-25 14:43:07

안녕하세요 예스스탁입니다. A방식은 조건만족즉시이고 B방식도 시스템 트레이딩 설정창의 강제청산탭 하단에 청산시점이 "조건만족즉시"로 설정되어 있으시면 조건만족즉시입니다. 다만 특정 진입명을 지정해야 하므로 A방식과 같이 풀어서 작성한것일뿐입니다. 특별히 특정진입명을 지정하지 않고 모든진입에 해당하면 B방식과 같이 지정해 사용하시면 됩니다. 이름을 한정해야 한다면 아래와 같이 변경해 사용하시면 됩니다. input : 손절틱수(10),익절틱수(30),최소수익틱수(20),수익감소틱수(10); if MarketPosition == 1 then { if IsEntryName("b1") == true then { ExitLong("bl1",AtStop,EntryPrice-PriceScale*손절틱수); ExitLong("bp1",Atlimit,EntryPrice+PriceScale*익절틱수); if highest(h,BarsSinceEntry) >= EntryPrice+최소수익틱수*PriceScale Then ExitLong("btr1",AtStop,highest(h,BarsSinceEntry)-수익감소틱수*PriceScale); } } if MarketPosition == -1 then { if IsEntryName("s1") == true then { ExitShort("sl1",AtStop,EntryPrice+PriceScale*손절틱수); ExitShort("sp1",AtLimit,EntryPrice-PriceScale*익절틱수); if Lowest(l,BarsSinceEntry) <= EntryPrice-최소수익틱수*PriceScale Then ExitShort("str1",AtStop,lowest(l,BarsSinceEntry)+수익감소틱수*PriceScale); } } 즐거운 하루되세요 > 목마와숙녀 님이 쓴 글입니다. > 제목 : 청산 수식 > 아래는 청산 수식입니다. A방식이 조건만족시 즉시(봉완성시 아님) 수식이 맞다면 A방식의 trailing stop 대신에 B방식의 trailing stop(수익감소포인트,최소수익포인트)으로 수정바랍니다. 아니면, B방식을 조건만족시 즉시로 수정해주셔도 됩니다. 끝으로, A,B 두방식의 차이는 무엇인지요? ***************************************************************** A)방식 ***BUY if MarketPosition == 1 then { if IsEntryName("b1") == true then { ExitLong("bl1",AtStop,EntryPrice-PriceScale*손절); ExitLong("bp1",Atlimit,EntryPrice+PriceScale*익절); ExitLong("btr1",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR); } ***SELL if MarketPosition == -1 then { if IsEntryName("s1") == true then { ExitShort("sl1",AtStop,EntryPrice+PriceScale*손절); ExitShort("sp1",AtLimit,EntryPrice-PriceScale*익절); ExitShort("str1",AtStop,Lowest(l,BarsSinceEntry)+PriceScale*TR); } B)방식 SetStopProfittarget(수익틱수*PriceScale,PointStop); SetStopLoss(손절틱수*PriceScale,PointStop); SetStopTrailing(수익감소틱수*PriceScale,최소수익틱수*PriceScale,PointStop);