Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OCO Orders between different futures

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • sn0z33r
    replied
    Originally posted by kevinenergy View Post
    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 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.
    thanks kevin !
    you gived me a lot of hints i will try to do something !

    Leave a comment:


  • NinjaTrader_Clayton
    replied
    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:


  • kevinenergy
    replied
    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.

    Leave a comment:


  • sn0z33r
    replied
    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:


  • NinjaTrader_Clayton
    replied
    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:


  • sn0z33r
    started a topic OCO Orders between different futures

    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 ?

Latest Posts

Collapse

Topics Statistics Last Post
Started by Nebula94, 04-15-2025, 02:41 AM
2 responses
30 views
0 likes
Last Post Nebula94  
Started by Mindset, Today, 12:46 AM
0 responses
9 views
0 likes
Last Post Mindset
by Mindset
 
Started by moneymaster, Today, 12:38 AM
0 responses
5 views
0 likes
Last Post moneymaster  
Started by WilsonFoster, Yesterday, 11:35 PM
0 responses
12 views
0 likes
Last Post WilsonFoster  
Started by MiCe1999, Yesterday, 09:26 PM
0 responses
16 views
0 likes
Last Post MiCe1999  
Working...
X