I am running NT7.
I used mainly the strategy wizard to create my logic and unlock if needed for more custom work.
I use the following in my code
EnterShortLimit
EnterLongLimit
SetProfitTarget
SetStopLoss
Questions:
1. If a limit order is pending to be filled, are the setstoploss and setprofittarget order set once the limit order is filled?
2. I would like to cancel a long pending limit order if say Close[0] >= EnterLongLimit_Price + 28*ticks AND Pending Order Open. So in other words, if market price exceeds 28 ticks from pending long limit order price AND there is an pending order open, then cancel the order.
I added the attached code to Cancel order if a pending order is waiting and pending limit price (Variable2) price is 28 above market price. Does my code make sense.
How can I determine if pending limit order is open or not filled? Is it how i did in the attachment?
3. Please answer questions on the attachment.
4. what does this mean "private IOrder myEntryOrder = null; " http://ninjatrader.com/support/helpG...ancelorder.htm
5. If a limit order is pending at 2005.50 to be filled, can I use Position.AvgPrice in the code to reference this price? If not, how can I reference a pending limit order price to be filled?
6. Once the limit order is cancel, do i need do anything with the setstoploss and setprofittarget orders?
7. Does the CancelOrder(myEntryLongOrder) work in historical back testing?
Thank you for your help
Comment