Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Change SL/TP size in chart and transfer to strategy logic
Collapse
X
-
Change SL/TP size in chart and transfer to strategy logic
Tags: None
-
Hello sidlercom80,
This would not be able to be done by using a Strategy, that will only see updates it makes to the orders. Any manual changes would not be observed by the script. You could use an indicator with the addon account to do this type of interaction. Watching the account directly would let you observe all order events like manual changes. https://ninjatrader.com/support/help...ount_class.htm
I look forward to being of further assistance.JesseNinjaTrader Customer Service
-
Originally posted by NinjaTrader_Jesse View PostHello sidlercom80,
This would not be able to be done by using a Strategy, that will only see updates it makes to the orders. Any manual changes would not be observed by the script. You could use an indicator with the addon account to do this type of interaction. Watching the account directly would let you observe all order events like manual changes. https://ninjatrader.com/support/help...ount_class.htm
I look forward to being of further assistance.
From another post discussed with _Jim: you do not have to worry about the strategy position stating it is out of sync because the strategy is not following the internal strategy position. It would be following the Position object we created within the strategy, that is updated with OrderUpdate events.
https://ninjatrader.com/support/foru...kers-api/page2
Comment
-
Hello sidlercom80,
The comments Jim provided are for a different subject, that relates to how the override is called in relation to how the broker provides that information.
OnOrderUpdate is not called for manual orders or manual changes, you would need to avoid using a strategy to execute this type of goal. Strategy overrides are based on the changes which the strategy makes and not what you are doing outside of the strategy.
If you want to make a tool that works with manual changes you could use an indicator for that purpose and the addon account to work with the manual orders/events/changes. Strategies are generally intended to work for you and without your interaction based on its virtual information.
Please let me know if I may be of additional assistance.
JesseNinjaTrader Customer Service
Comment
-
Hi _Jesse, I only need the changes for already submitted orders and not for a new order. My solution is:
Code:protected override void OnOrderUpdate(...) //OrderState Working if (orderState == OrderState.Working) { targetPrice = limitPrice; quantityTP = quantity; }
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by r68cervera, Today, 05:29 AM
|
0 responses
2 views
0 likes
|
Last Post
by r68cervera
Today, 05:29 AM
|
||
Started by geddyisodin, Today, 05:20 AM
|
0 responses
3 views
0 likes
|
Last Post
by geddyisodin
Today, 05:20 AM
|
||
Started by JonesJoker, 04-22-2024, 12:23 PM
|
6 responses
35 views
0 likes
|
Last Post
by JonesJoker
Today, 05:14 AM
|
||
Started by GussJ, 03-04-2020, 03:11 PM
|
12 responses
3,239 views
0 likes
|
Last Post
by Leafcutter
Today, 05:08 AM
|
||
Hi
by AveryFlynn
Started by AveryFlynn, Today, 04:57 AM
|
0 responses
6 views
0 likes
|
Last Post
by AveryFlynn
Today, 04:57 AM
|
Comment