I am trying to figure out how to keep a stop order active until I set parameters to cancel it.
Currently have:
protected override void OnBarUpdate()
{
if (BarsInProgress!= 0)
return;
if (CurrentBars[0] < 1)
return;
// Set 1
if (Open[0] > (Close[1] * 1.0025))
{
openBarHigh = High[0];
EnterLongStopLimit(Convert.ToInt32(DefaultQuantity ), openBarHigh + (10 + TickSize), (openBarHigh + (1 * TickSize)) , "R");
}
This seems to work fine so long as the stop order is triggered on the next candle.
Why doesn't the variable openBarHigh not store the value and keep the stop order open indefinitely? The direction I am going is to cancel the stop order if price trades below openBarHigh Low and keep the order open until end of day.
Any help would be greatly appreciated.
Thank you.

Comment