But I want to protect profit if the trade starts failing.
So the strategy enters one trade with PT with qty 4 , a low target.
It also enters one trade for qty 2 next target
An lastly enters 1 trade with qty 1 which would be the runner. highest target
So in my condition if position is less than 2 (in other words the first two trades gave filled) then set stoploss to the postion.average + the first profit target, that way if the trade goes south it stops out.
When I add the first condition it creates a stop and profit target as soon as strategy is enabled.
Without it there are many $0.00 stop loss trades.
What am I missing here to accomplish my desired outcome?
/// Condition to set and reset the stoploss to the original stop
if (Position.MarketPosition == MarketPosition.Flat)
{
SetStopLoss("",CalculationMode.Ticks, Stop,false);
previousPrice = 0;
}
/// Condition to move the stop for the last trade to a new stop
if (Position.Quantity < 2 && Position.MarketPosition == MarketPosition.Long && BarsSinceEntryExecution() > 3 && previousPrice == 0)
{
newStopLossTicks = Position.AveragePrice + L_Profit;
SetStopLoss(CalculationMode.Price, newStopLossTicks);
previousPrice = Position.AveragePrice;
}
Comment