Trying to create a Bracket Trade;
I am using "SubmitOrder" in conjunction with "Unmanaged = True" as depicted in the snippet of code below.
the problem however is that no orders are executed when the "if (entryOrder == null)" statement is included. without it the orders are made - just on every tick which is of course not the intention.
Please assist
private IOrder entryOrder = null; // This variable holds an object representing our entry order
protected override void Initialize()
{
CalculateOnBarClose = false;
Unmanaged = true;
}
if (entryOrder == null)
{
/* The entryOrder object will take on a unique ID from our SubmitOrder()
that we can use later for order identification purposes in the OnOrderUpdate() method. */
entryOrder = SubmitOrder(0, OrderAction.Buy, OrderType.Market, 1, 0, 0, "", "Enter Long");
}

Comment