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
How to set OnOrderUpdate to allow manual adjustment to ProfitTarget Order
Collapse
X
-
How to set OnOrderUpdate to allow manual adjustment to ProfitTarget Order
I am having the same issue needing to Manually adjust the stop loss and profit target orders once in a trade. I read something about OnOrderUpdate() which seems to imply that an updated order (which manually moving would be OrderUpdate but I need some help figuring our how to include in strategy.Tags: None
-
Hello DTSSTS,
You would need to use Exit methods and you would not be able to use Set methods. (Set methods continuously update and will undue any manual changes to the order)
Then be sure that the order is only submitted once and the script does not update the price of the order at a later time.
A good place to do this would be from OnExecutionUpdate() or OnOrderUpdate() when the entry order's OrderState is OrderState.Filled.
An example of placing orders in OnOrderUpdate can be found here. However, you would not want to include the logic that causes the trailing / chasing behavior in OnBarUpdate().
Chelsea B.NinjaTrader Customer Service
-
THOUGHT this could possibly be the answer
not sure how to impliment
I will read the links you posted, Thanks
Comment
-
what do i do with these ? import into ninja
Comment
-
Hello DTSSTS,
The examples you can import and view the code and use this as working example when designing your own scripts.
To import a NinjaScript into NinjaTrader 8 do the following:- Download the script to your desktop, keep it in the compressed .zip file.
- From the Control Center window select Tools -> Import -> NinjaScript...
- Click the Desktop icon on the left to navigate to the desktop
- Select the downloaded .zip file -> then click Open
- NinjaTrader will then confirm if the import has been successful.
You can place orders using Atm Strategy methods with AtmStrategyCreate() using an Atm Strategy template (setup on the SuperDOM or ChartTrader) and then once the stop is working change the price of the stop with AtmStrategyChangeStopTarget().
As a heads up, orders placed with Atm Strategy methods are basically the same as manually placed orders and do not affect the strategy position and do not trigger order methods such as OnOrderUpdate(), OnExecutionUpdate(), or OnPositionUpdate().
Included with NinjaTrader is the SampleAtmStrategy script that demonstrates how to place orders using Atm Strategy methods.
Below are links to the help guide on Atm Strategy Methods, AtmStrategyCreate(), GetAtmStrategyStopTargetOrderStatus(), and AtmStrategyChangeStopTarget().
Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Brevo, Today, 01:45 AM
|
0 responses
6 views
0 likes
|
Last Post
by Brevo
Today, 01:45 AM
|
||
Started by aussugardefender, Today, 01:07 AM
|
0 responses
3 views
0 likes
|
Last Post Today, 01:07 AM | ||
Started by pvincent, 06-23-2022, 12:53 PM
|
14 responses
242 views
0 likes
|
Last Post
by Nyman
Today, 12:47 AM
|
||
Started by TraderG23, 12-08-2023, 07:56 AM
|
9 responses
384 views
1 like
|
Last Post
by Gavini
Today, 12:29 AM
|
||
Started by oviejo, Today, 12:28 AM
|
0 responses
6 views
0 likes
|
Last Post
by oviejo
Today, 12:28 AM
|
Comment