you gived me a lot of hints i will try to do something !
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
OCO Orders between different futures
Collapse
X
-
Originally posted by kevinenergy View Post
you gived me a lot of hints i will try to do something !
-
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.
Leave a 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
Leave a comment:
-
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 ?
Leave a comment:
-
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.
Leave a comment:
-
OCO Orders between different futures
Hello, I am going crazy to figure out how to put oco orders between two different futures (for example, one order on ES and one on MES to do hedging). Can anyone help me ?Tags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Nebula94, 04-15-2025, 02:41 AM
|
2 responses
30 views
0 likes
|
Last Post
![]()
by Nebula94
Today, 01:27 AM
|
||
Started by Mindset, Today, 12:46 AM
|
0 responses
9 views
0 likes
|
Last Post
![]()
by Mindset
Today, 12:46 AM
|
||
Started by moneymaster, Today, 12:38 AM
|
0 responses
5 views
0 likes
|
Last Post
![]()
by moneymaster
Today, 12:38 AM
|
||
Started by WilsonFoster, Yesterday, 11:35 PM
|
0 responses
12 views
0 likes
|
Last Post
![]()
by WilsonFoster
Yesterday, 11:35 PM
|
||
Started by MiCe1999, Yesterday, 09:26 PM
|
0 responses
16 views
0 likes
|
Last Post
![]()
by MiCe1999
Yesterday, 09:26 PM
|
Leave a comment: