Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Please use a new OCO ID
Collapse
X
-
Hello,
Thank you for your post.
For your inquiry, this means that you have OCO mode enabled and the original OCO order was canceled. Press Control+z on your keyboard to turn off OCO mode, you should see a small green "OCO" icon get disabled when you do this.
Stop loss and profit target orders (submitted automatically via an ATM strategy) are always sent as OCO, however, you can submit entry or exit orders as OCO orders as well. Why? The market may be trading in a channel and you wish to sell at resistance or buy at support, whichever comes first by placing two limit orders at either end of the channel. To place OCO orders, via the right mouse click context menu select the menu name "OCO Order" or use the shortcut key Ctrl + Z. The "oc" (OCO indicator) will light up green. All orders placed while this indicator is lit will be part of the same OCO group. Once an order of this group is either filled or canceled, all other orders that belong to this group will be canceled.
Note: If an order which was part of an OCO group has already been filled or canceled, you will need to submit the pending order with a new OCO ID otherwise the pending order will be rejected. To reset an OCO ID, simply disable the OCO function, and re-enable. This will generate a new OCO ID and allow you to place new orders.
Please let me know if I can assist any further.
Please let me know if I can help you any further.
-
Comment
-
-
Hello stevenrosenquist,
If you are making your own OCO strings in NinjaScript they need to be unique, you can use the GetAtmStrategyUniqueId method for that purpose. You otherwise can't reset an OCO, once its been used you cannot re use that same OCO string again.
JesseNinjaTrader Customer Service
Comment
-
Hey Jesse,
I am not, I am running a strategy made on the platform and for some reason it send that error every time I run it. is there anything on the ninja trader platform that will allow RealtimeErrorHandling.IgnoreAllErrors without stopping the strategy or having to go in and edit code? If there is not is there literature on how to write this code?Last edited by stevenrosenquist; 07-07-2023, 07:51 PM.
Comment
-
Hello stevenrosenquist,
If you are running into a oco already used error that could be happening based on what you made. If you use the unmanaged approach you can create your own OCO id's which is where you would need GetAtmStrategyUniqueId. If you did not make a unmanaged strategy meaning you used the builder or coded it as a normal managed strategy there are situations where you could see that error reported if you have conflicting logic.
The ignore all errors will keep a strategy running for any order based errors meaning the broker sent back an error or rejection. For any runtime errors like reusing an oco that would need to be handled by modifying the code so that does not happen.JesseNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by MiCe1999, Today, 05:55 PM
|
0 responses
4 views
0 likes
|
Last Post
![]()
by MiCe1999
Today, 05:55 PM
|
||
Started by volIQ, Today, 05:43 PM
|
0 responses
7 views
0 likes
|
Last Post
![]()
by volIQ
Today, 05:43 PM
|
||
Started by afoschini, 05-18-2020, 09:03 AM
|
6 responses
866 views
0 likes
|
Last Post
![]()
by shodown888
Today, 04:40 PM
|
||
Started by M_ichel, Yesterday, 02:21 PM
|
6 responses
38 views
1 like
|
Last Post
![]()
by M_ichel
Today, 04:10 PM
|
||
Started by daledg28098, Today, 03:19 AM
|
2 responses
20 views
0 likes
|
Last Post
![]()
by bltdavid
Today, 04:09 PM
|
Comment