커뮤니티

진입가격별(시가대비) 청산수식

프로필 이미지
목마와숙녀
2024-08-01 13:50:06
968
글번호 177882
답변완료
sell 수식에 a,b 두번의 진입이 있는 수식입니다. 진입가격이 시가 위 진입가격이 시가 아래 두 개로 구분하여 청산하고 싶습니다. 수식이 맞는지요? ***************************************************************************** if MarketPosition== -1 and entryprice > dayopen Then { if IsEntryName("a") == true Then { SetStopLoss(PriceScale*hals,PointStop); SetStopTrailing(PriceScale*hatr2,PriceScale*hatr1,PointStop,1); SetStopProfittarget(PriceScale*hagl,PointStop); } Else if IsEntryName("b") == true Then { SetStopLoss(PriceScale*hbls,PointStop); SetStopTrailing(PriceScale*hbtr2,PriceScale*hbtr1,PointStop,1); SetStopProfittarget(PriceScale*hbgl,PointStop); } Else { SetStopLoss(0); SetStopTrailing(0,0); SetStopProfittarget(0); } } if MarketPosition== -1 and entryprice <= dayopen Then { if IsEntryName("a") == true Then { SetStopLoss(PriceScale*als,PointStop); SetStopTrailing(PriceScale*atr2,PriceScale*atr1,PointStop,1); SetStopProfittarget(PriceScale*agl,PointStop); } Else if IsEntryName("b") == true Then { SetStopLoss(PriceScale*bls,PointStop); SetStopTrailing(PriceScale*btr2,PriceScale*btr1,PointStop,1); SetStopProfittarget(PriceScale*bgl,PointStop); } Else { SetStopLoss(0); SetStopTrailing(0,0); SetStopProfittarget(0); } }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2024-03-25 18:04:34

안녕하세요 예스스탁입니다. 작성하신 내용으로 사용하셔도 됩니다. 아래는 조금더 간략히 작성한 내용입니다. if MarketPosition== -1 Then { if IsEntryName("a") == true Then { if entryprice > dayopen Then { SetStopLoss(PriceScale*hals,PointStop); SetStopTrailing(PriceScale*hatr2,PriceScale*hatr1,PointStop,1); SetStopProfittarget(PriceScale*hagl,PointStop); } Else { SetStopLoss(PriceScale*als,PointStop); SetStopTrailing(PriceScale*atr2,PriceScale*atr1,PointStop,1); SetStopProfittarget(PriceScale*agl,PointStop); } } Else if IsEntryName("b") == true Then { if entryprice > dayopen Then { SetStopLoss(PriceScale*hbls,PointStop); SetStopTrailing(PriceScale*hbtr2,PriceScale*hbtr1,PointStop,1); SetStopProfittarget(PriceScale*hbgl,PointStop); } Else { SetStopLoss(PriceScale*bls,PointStop); SetStopTrailing(PriceScale*btr2,PriceScale*btr1,PointStop,1); SetStopProfittarget(PriceScale*bgl,PointStop); } } Else { SetStopLoss(0); SetStopTrailing(0,0); SetStopProfittarget(0); } } 즐거운 하루되세요 > 목마와숙녀 님이 쓴 글입니다. > 제목 : 문의 > sell 수식에 a,b 두번의 진입이 있는 수식입니다. 진입가격이 시가 위 진입가격이 시가 아래 두 개로 구분하여 청산하고 싶습니다. 수식이 맞는지요? ***************************************************************************** if MarketPosition== -1 and entryprice > dayopen Then { if IsEntryName("a") == true Then { SetStopLoss(PriceScale*hals,PointStop); SetStopTrailing(PriceScale*hatr2,PriceScale*hatr1,PointStop,1); SetStopProfittarget(PriceScale*hagl,PointStop); } Else if IsEntryName("b") == true Then { SetStopLoss(PriceScale*hbls,PointStop); SetStopTrailing(PriceScale*hbtr2,PriceScale*hbtr1,PointStop,1); SetStopProfittarget(PriceScale*hbgl,PointStop); } Else { SetStopLoss(0); SetStopTrailing(0,0); SetStopProfittarget(0); } } if MarketPosition== -1 and entryprice <= dayopen Then { if IsEntryName("a") == true Then { SetStopLoss(PriceScale*als,PointStop); SetStopTrailing(PriceScale*atr2,PriceScale*atr1,PointStop,1); SetStopProfittarget(PriceScale*agl,PointStop); } Else if IsEntryName("b") == true Then { SetStopLoss(PriceScale*bls,PointStop); SetStopTrailing(PriceScale*btr2,PriceScale*btr1,PointStop,1); SetStopProfittarget(PriceScale*bgl,PointStop); } Else { SetStopLoss(0); SetStopTrailing(0,0); SetStopProfittarget(0); } }