PDA

View Full Version : Anyone used CreateOrder() to create OCO Order before?


51friend
05-20-2010, 08:24 AM
I have a strategy for a range which goes long on breakout of range and short on breakdown with attached ATM Strategy.
I realized it with OIF, it works but it is not easy to handle.

Now I found a Method in public class Account (http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://NinjaTrader.Core:6.5.1000.15/NinjaTrader.Cbi.Account) : IObjectHelper (http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://WilsonORMapper:4.2.2.0/Wilson.ORMapper.IObjectHelper), IObjectNotification (http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://WilsonORMapper:4.2.2.0/Wilson.ORMapper.IObjectNotification)

public Order (http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://NinjaTrader.Core:6.5.1000.15/NinjaTrader.Cbi.Order) CreateOrder (http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://NinjaTrader.Core:6.5.1000.15/NinjaTrader.Cbi.Account/CreateOrder%28NinjaTrader.Cbi.Instrument,NinjaTrad er.Cbi.Action,NinjaTrader.Cbi.OrderType,NinjaTrade r.Cbi.TimeInForce,Int32,Double,Double,String,Strin g%29:NinjaTrader.Cbi.Order)(Instrument (http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://NinjaTrader.Core:6.5.1000.15/NinjaTrader.Cbi.Instrument) instrument, Action (http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://NinjaTrader.Core:6.5.1000.15/NinjaTrader.Cbi.Action) action, OrderType (http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://NinjaTrader.Core:6.5.1000.15/NinjaTrader.Cbi.OrderType) orderType, TimeInForce (http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://NinjaTrader.Core:6.5.1000.15/NinjaTrader.Cbi.TimeInForce) timeInForce, int (http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Int32) quantity, double (http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Double) limitPrice, double (http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Double) stopPrice, string (http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String) oco, string (http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String) name)

Who has used this Method ?
Is it possible to attach an ATM Strategy to this created order ?

NinjaTrader_Tim
05-20-2010, 09:17 AM
Hi 51friend,

CreateOrder() is not something I can offer support for.

Consider using AtmStrategyCreate() for created strategy to call on an ATM Strategy. See the sample at "Tools>Edit NS>Strategy"

Klaus Hengher
06-01-2010, 06:23 AM
Hi 51freind, you can not create ATM Strategy with CreateOrder
You have to use OIF if you want OCO handling