Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
OCO Orders between different futures
Collapse
X
-
Hello sn0z33r,
Thank you for the message.
There is no default way within the NinjaTrader platform to have an OCO order placed between two different instruments.- You would only be able to use OCO on the same instrument.
If you wanted this ability, you would have to look into creating an automated NinjaScript Strategy that allows you to place orders in this manner or do some internet searches to see if there is an add-on out there that already does this.
Please let us know if we may provide any further assistance.Clayton G.NinjaTrader Customer Service
-
thank you, it sounds crazy but I thought so. In other platforms the "OCO" field is customizable and editable manually. Just set the orders and then add them to the same OCO group manually but in control center > orders the oco field is not editable.
I know a little bit of programming, is there any example to "copy" into the ninjascript reference ?
Comment
-
The account class has a CreateOrder() and Submit() methods.
https://ninjatrader.com/support/help...reateorder.htm
I use this extensively for custom ChartTrader code. You can manually assign an OCO. I use Guid.NewGuid().ToString("N") as an OCO for Stop-loss target brackets.
I've never done this between different instruments though. I don't know if it works.
The CreateOrder API is absolutely horrific.
You could also try the Change() method...
https://ninjatrader.com/support/help...nt8/change.htm
If you get a reference to an existing order you could try changing the OCO and then calling _account.Change(order)
I've only ever used Change for changing prices/quantities etc via the QuantityChanged, XXPriceChanged properties.....I don't know if it works for changing an OCO. I think it probably won't work, but I'm not sure about it.Last edited by kevinenergy; 09-29-2023, 07:42 PM.
- Likes 1
Comment
-
Hello Everyone,
Thank you for the updates.
If you would like to ask additional questions about creating your own NinjaScript Strategy to do this, please re-post your question and what you are trying to do over in the "Strategy Development" or "Indicator Development" section of the NinjaTrader Forum.- This will ensure the correct team and users are seeing the post to help contribute their advice.
This section of the forum is for Platform and Technical questions.
Please let us know if we may provide any further assistance.Clayton G.NinjaTrader Customer Service
Comment
-
Originally posted by kevinenergy View PostThe account class has a CreateOrder() and Submit() methods.
https://ninjatrader.com/support/help...reateorder.htm
I use this extensively for custom ChartTrader code. You can manually assign an OCO. I use Guid.NewGuid().ToString("N") as an OCO for Stop-loss target brackets.
I've never done this between different instruments though. I don't know if it works.
The CreateOrder API is absolutely horrific.
You could also try the Change() method...
https://ninjatrader.com/support/help...nt8/change.htm
If you get a reference to an existing order you could try changing the OCO and then calling _account.Change(order)
I've only ever used Change for changing quantities etc.I don't know if it works for changing an OCO. I think it probably won't work, but I'm not sure about it.
you gived me a lot of hints i will try to do something !
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by paulo_br, 09-13-2024, 08:41 AM
|
8 responses
1,152 views
0 likes
|
Last Post
![]()
by AppleID25
Today, 08:49 PM
|
||
Started by mno_om, Today, 08:44 PM
|
0 responses
6 views
0 likes
|
Last Post
![]()
by mno_om
Today, 08:44 PM
|
||
Started by MiCe1999, Today, 07:36 PM
|
0 responses
13 views
0 likes
|
Last Post
![]()
by MiCe1999
Today, 07:36 PM
|
||
Started by maggo123, Today, 08:25 AM
|
6 responses
177 views
1 like
|
Last Post
![]()
by DAANIIK
Today, 07:45 PM
|
||
Started by TrippTraders, Today, 07:14 PM
|
0 responses
7 views
0 likes
|
Last Post
![]()
by TrippTraders
Today, 07:14 PM
|
Comment