View Full Version : in an automated strategy can you do a OCO order
HelloHello
08-28-2007, 12:13 PM
In an automated stategy is it possible to do an OCO order?
THanks
NinjaTrader_Ray
08-28-2007, 12:22 PM
Could you clarify....Automated from where? NinjaScript strategy? Easy Language Strategy?
HelloHello
08-28-2007, 12:31 PM
easy language
NinjaTrader_Ryan
08-28-2007, 12:44 PM
Hello:
If you have a strategy from Easy Language that uses OCO order function, it is possible to route this strategy to NT using the TS email interface or the TS Dll integration methods.
Instructions on using the TS email interface can be found here:
http://www.ninjatrader-support.com/HelpGuideV6/Overview31.html
Instructions on using the TS Dll intergration can be found here:
http://www.ninjatrader-support.com/HelpGuideV6/Overview9.html
Best regards,
NinjaTrader_Ray
08-28-2007, 12:49 PM
Yes you can using our DLL interface. The NTCommand() function allows you to place orders with associated OCO id's used to link orders together.
Additional information - http://www.ninjatrader-support.com/HelpGuideV6/Functions.html
HelloHello
08-28-2007, 01:05 PM
as always thank you very much for your help
Nathamus
08-29-2007, 01:34 PM
Is it possible to create a (pair of) OCO Order(s) from within a NinjaScript strategy?
thx
Nathamus
NinjaTrader_Ray
08-29-2007, 01:51 PM
Not directly. However, stops and tagets themselves are internally tied via OCO.
Nathamus
08-29-2007, 02:05 PM
I know. This can be found in the help file.
Letīs say I work on a t Tick Chart. I want to enter the market long above and below the current ask with a certain number of shares, but I do not want both orders ot be executed. How can this be realized?
e.g.
if (Bars.CurrentAsk >= Level1 && Bars.CurrentAsk < Level1+z*TickSize ) {
EnterLongStop (x, Level1, "buy_low");
EnterLongLimit (y, Level1+z*TickSize , "buy_high");
}
could cause a double execution on this single bar, right? (assumed that I use: calculate on bar close = true)
NinjaTrader_Ray
08-29-2007, 02:57 PM
Yes, this could cause a double execution. We will be providing a reference sample to accomplish this in the next few weeks at most.
HelloHello
09-14-2007, 09:09 PM
Ray,
Has the Reference sample been completed?
Thanks
NinjaTrader_Ray
09-14-2007, 10:23 PM
Take a look at the following examples:
http://www.ninjatrader-support.com/vb/showthread.php?t=3224
http://www.ninjatrader-support.com/vb/showthread.php?t=3223