Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Let the user to update managed orders in chart
Collapse
X
-
Let the user to update managed orders in chart
I am trying to figure a way to let the user to update or take control of the managed orders (created by SetStoploss and SetProfitTarget). I know that disabling the strategy will give user total control of the orders, but I'd like to know if we can do that without disabling the strategy.Tags: None
-
Hello FutureDragon,
You would need to avoid using the set methods if the user is intended to interact with the orders in some way. The strategy controls the set methods and as long as the strategy continues to call order methods the user changes will be reset. You can submit standard orders of the same type as the set methods and ensure you do not call them again and that would allow the user to move them. An is live until cancelled order can be submitted one time and then stay active untill filled or cancelled, normal orders will expire after 1 bar if you do not call them again which is why user changes are ignored with those.
-
Well, I went on that route before, and had to write code to deal with the issues with Rithmic and Interactive Brokers, and ended up doing everything in unmanaged order. It's working, but it's a lot of complexity and potential risks. I'd rather stay with the simple set methods for now, until the issues with Rithmic and Interactive Brokers are resolved by the platform itself.
Comment
-
Hello FutureDragon,
It sounds like you have already gone down the right path based on your specific requirements.
Rithmic and interactive brokers send order event updates and position updates differently than other brokers so if you use either of those two brokers and use OnOrderUpdate/OnExecutionUpdate from a strategy then you need to also accommodate how those brokers events work. There is not going to be any changes for that on the platform side because that is how the data sent by the broker and not something which can be altered locally. If you continue to use these brokers you will always need to make this consideration if you plan to use OnOrderUpdate/OnExecutionUpdate as mentioned in the help guide pages.
In regard to manual order changes, that is also something which won't change with strategies because there is already an existing type which is intended for that purpose. The addon framework is the specific framework that is used to work with orders on the account or manual actions. Strategies have never been intended to be used to work with manual changes to orders. Although strategies can technically be used for that use case and there are ways to work around the platform there are many issues that can arise from working with manual modifications to strategy based orders.
We generally suggest using an indicator for the use case you described, you could listen to the accounts Execution/Order/Position events and also submit orders based on logic just like a strategy. You can also work with manual order change events or even fully manually placed orders because you are just working directly on the account instead of the virtual strategy environment.
Comment
-
Thanks for the detailed reply Jesse. Strategies do have its advantages: such as backtesting, optimization, and scheduling to multiple accounts without the need for a chart. I understand I can not have it both ways. Can I add user interaction in the indicator used by the strategy, and still place orders from strategy?
Comment
-
Hello FutureDragon,
Yes that a correct understanding, strategies have the ability to be historically tested because they exist in a virtual environment. A strategy doesn't use the account directly, it relies on its own internal reporting to produce the PnL/Position/TrackedOrders etc. This is why you can't use it for manual orders because it simply won't know about those orders or manual changes made to its orders.
Using a strategy won't really allow you to fully work with the account like you are asking. Manually changing an order outside of a strategy won't trigger the strategies OnOrderUpdate event and the existing order variables you have won't be updated. You can at best have the strategy stop managing that order so it can be manually modified.
To fully support manual actions and stay in sync with those changes the addon framework can be used for that purpose. An indicator is suggested here because that strips away the conflicting strategy based logic that won't work with manual changes/orders. If you were to use the addon framework from a strategy that would greatly increase the complexity of the strategy and also will make it unable to backtest. The addon framework account is not used in historical tests so that would still only be helpful in a live use case.
From what you described the easiest available solutions would be to:- Use your existing strategy and have it stop managing the order (dont call the order in code again), this allows the user to manually move the order but you can't manually close the order
- Use an indicator instead of a strategy, This cant be backtested but could be used to submit and control orders. This would also let you manually change or close orders from any tool. You can also submit orders from any tool and observe those order events using the indicator.
- Create an indicator that has your strategies logic inside of it, this indicator can be used to plot a result when a trade should be placed
- Create a strategy that reads the indicators plot so it knows when to place trades, set it up to place trades based on the indicators value.
- At this point you can use this strategy to backtest and get results based on the logic inside the indicator. You can also use this strategy to trade in realtime, its effectively your existing strategy like there were no changes.
- Create a second indicator and inside this indicator you would read the value from the first indicator so it knows when to trade. This indicator can now use the addon framework to place trades based on the first indicator. That effectively makes it just the same as the realtime portion of your strategy. This indicator can have additional logic now to use the account directly. This could be used instead of the strategy when you wanted to manually control orders in addition to the existing strategy logic. You can otherwise use the strategy for any use case where you don't need to trade manually or wanted it to run in the background from the control center.
The reason to split it like this would be so that when you work on your strategies conditions (inside indicator 1) that updates both of the scripts which use that indicator. This keeps the strategy backtestable and the live trading indicator confined in its own area to prevent the backtestable strategy and its logic from being overly complex.
Comment
-
Jesse, thanks for the suggestion. The second indicator sounds like a trade copier to me. Can it place trades to multiple accounts? Also, does NinjaTrader has a standard remote protocol to place trade across machines/networks?
Comment
-
Hello FutureDragon,
In what I had described there is no copying happening, the indicator is actually placing the trades based on your existing conditions. That is however how a trade copier would be made, you would use the addon framework and subscribe to accounts which you wanted to place trades on or listen to events on.
There is not a protocol in place for remote operations between instances of platforms. You can use any C# means to do that, NinjaScript is C# language.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Yesterday, 05:17 AM
|
0 responses
65 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
139 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
75 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
45 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
50 views
0 likes
|
Last Post
|

Comment