직전포지션에서 손실이 20이 났는데 현재 진입 포지션에서 수익이 20이상 나고 있는데 만약 수익이 20이하의 몇프로 떨어지면 청산하는 수식 부탁드립니다.
PositionProfit(1)
시스템
답변 1
예스스탁
2025-10-20 13:19:44
안녕하세요
예스스탁입니다.
input : Per(10);
if MarketPosition == 1 Then
{
if PositionProfit(1) <= -20 and highest(H,BarsSinceEntry) >= EntryPrice+20 Then
ExitLong("bx",AtStop,EntryPrice+(20*(Per/100)));
}
if MarketPosition == -1 Then
{
if PositionProfit(1) <= -20 and lowest(L,BarsSinceEntry) <= EntryPrice-20 Then
ExitShort("sx",AtStop,EntryPrice-(20*(Per/100)));
}
즐거운 하루되세요