PDA

View Full Version : how to find our barid against which i enetered order.


junkone
05-26-2009, 05:36 AM
how do i find the barid against which i placed order. i want to cancel it if the orderis not filled after 2 bars.

if i stop and start a strategy. how do i detect it from my code so that i can reinitialize all my strategy values on restart.

NinjaTrader_Bertrand
05-26-2009, 06:54 AM
You would need to store the barnumber with CurrentBar you placed the order on - http://www.ninjatrader-support.com/HelpGuideV6/CurrentBar.html

Then CancelOrder it if CurrentBar is higher than your variable + x

http://www.ninjatrader-support.com/HelpGuideV6/CancelOrder.html
(sample script for this is also found on this helpguide page)

Unfortunately there's no method to detect if the strategy is started / stopped.

junkone
05-26-2009, 06:56 AM
do you ahve a eta when the cancel order prob will be resolved.

NinjaTrader_Josh
05-26-2009, 07:29 AM
Please be more specific as to what you are referring to. Thank you.

junkone
05-26-2009, 07:41 AM
there was a bug quoted earlier that if a order is cancelled, new orders cannot be placed?

http://www.ninjatrader-support2.com/vb/showthread.php?t=16974

NinjaTrader_Josh
05-26-2009, 08:17 AM
Right. If you cancel an exit order for an entry you will not be able to resubmit that same exit order for that same entry. We have already provided you workarounds for that. Unfortunately there is no ETA I can provide you at this time for when the fix will be available. This is a very sensitive area that has many implications everywhere and every precaution needs to be taken in creating this fix. Thank you for understanding.