PDA

View Full Version : Order handling and Order valid for x minutes


nt2010
08-06-2010, 03:00 PM
Hello i have two questions regarding order handling with NT7,

1) Is it possible to let Ninjatrader send the orders from NT7 to IB without transfering them to the exchange ?

2) Is it possible to send a time restricted order from NT7 to IB. e.g. once a condition is met, a order gets sent to ib and keeps valid for a specified time.

What is the syntax i would use to do this.

Thank you

NinjaTrader_RyanM
08-06-2010, 03:12 PM
Hello nt2010,

1) This isn't possible. Once the order has arrived to IB, NinjaTrader has no control on if it's submitted to the exchange.

2) By Default orders are canceled if not filled on the bar they're submitted on. To change this you have to work with the order method signatures that support liveUntilCanceled property. All order methods have this - below are links to a couple of them:
http://www.ninjatrader-support.com/HelpGuideV6/ExitShort.html
http://www.ninjatrader-support.com/HelpGuideV6/EnterLong.html

As the name suggests, these orders will remain open until Canceled. This reference sample can help with CancelOrder() and the needed IOrder object structure:
Using CancelOrder() method to cancel orders (http://www.ninjatrader-support2.com/vb/showthread.php?t=18890)

nt2010
08-24-2010, 11:08 PM
Hello,

regarding the time how long an order is valid i have read about the time in force in the help section. this might would do what i want.
But i can only read about "day" and "GTC".

What would be the setting, if every order should only be valid for 5 minutes and then cancels automaticly ?
(in the unmanaged aproach).

Thank you for your help
NT2010

_____________________
Definition
Sets the time in force property for all orders generated by a strategy. This property is dependant on what time in force your broker may or may not support.

Property Value
Cbi.TimeInForce.Day
Cbi.TimeInForce.Gtc

Syntax
TimeInForce


Examples
protected override void Initialize()
{
TimeInForce = Cbi.TimeInForce.Day;
___________________________

NinjaTrader_Bertrand
08-25-2010, 04:40 AM
nt2010, then you would need to custom code cancelling the order after your desired timespan, or you submit them from a 5 minute chart so they last one bar before expiring (default NT behavior if not sent with the liveUntilCancelled property = true)