Hi, I take orders via Basic entry panel with Quantity 3 and use ATM Strategy like below:
Order Quantity 3, and Parameter type Ticks
Target1 : Quantity 1: Stop loss 10, Profit 10
Target2 : Quantity 1: Stop loss 20, Profit 20
Target3 : Quantity 1: Stop loss 30, Profit 30
Can yoy help me to implement this logic in OnBarUpdate() ?
maybe something like this
protected override void OnBarUpdate()
{
if (BarsInProgress != 0 && CurrentBar < BarsRequiredToTrade)
return;
// Some bool variable enterBullish to take long position
if (enterBullish && Position.Quantity <= 0) {
EnterLong("First");
EnterLong("Second");
EnterLong("Third");
ExitLongStopMarket(1, Position.AveragePrice - 2.5);
ExitLongStopMarket(1, Position.AveragePrice - 5);
ExitLongStopMarket(1, Position.AveragePrice - 7.5);
}
if (GetCurrentAsk() >= Position.AveragePrice + 2.5)
ExitLong(1);
if (GetCurrentAsk() >= Position.AveragePrice + 5)
ExitLong(1);
if (GetCurrentAsk() >= Position.AveragePrice + 7.5)
ExitLong(1);
}

Comment