entryOrderL/entryOrderS are the IO entry order tags for Long and Short positions respectivel
stopOrderL/stopOrderS are the protective stop orders for long and short position respectively
StopLevelL/StopLevelS are doubles that store specific price levels to enter the protective stop order and are stored when the entry signal is triggered.
Any suggestions would be much appreciated.
Mark
protected override void OnExecution(IExecution execution)
{
// Long Execution Stop
if (entryOrderL != null && entryOrderL.Token == execution.Order.Token)
{
if (execution.Order.OrderState == OrderState.Filled)
{
// Long Stop at low of signal
stopOrderL = ExitLongStop(0, true, 1, StoplevelL, "stop", "long entry");
// Resets the entryOrder object to null after the order has been filled
if (execution.Order.OrderState != OrderState.PartFilled)
{
entryOrderL = null;
}
}
}
// Short execution stop
if (entryOrderS != null && entryOrderS.Token == execution.Order.Token)
{
if (execution.Order.OrderState == OrderState.Filled)
{
// Short Stop
stopOrderS = ExitShortStop(0, true, 1, StoplevelS, "stop", "Short entry");
if (execution.Order.OrderState != OrderState.PartFilled)
{
entryOrderS = null;
}
}

Speak to you soon!
Comment