I have been looking at past threads on updating stop losses to attempt to get my initial stop loss to update. I believe I need to set a new order to cancel the initial stop loss once I am in the trade, however, even if I completely take out the initial stop loss I cannot get the Stop Loss to update as it should. Any help is greatly appreciated.
protectedoverridevoid Initialize()
{
SetStopLoss(CalculationMode.Ticks, 100);
CalculateOnBarClose = true;
}
///<summary>
/// Called on each bar update event (incoming tick)
///</summary>
protectedoverridevoid OnBarUpdate()
{
// Condition set 1
if (Close[0] > Close[1]
&& Close[1] > Close[2])
{
EnterLong(DefaultQuantity, "");
}
//Change Trail Stop to Min last two bars
{
SetTrailStop(CalculationMode.Price, MIN(Low,2)[0]);
CalculateOnBarClose = true;
}
}

Comment