Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Custom User Made ATM for Indicator Trail Stop Possible?
Collapse
X
-
Custom User Made ATM for Indicator Trail Stop Possible?
Hello I would like to know if it is at all possible to create a custom ATM that is scripted to trail a stop using an indicator plot such as 9 SMA? Any way to add a different ATM than what is available in the drop down? I know we can add strategies outside of it, but I would like to ideally apply the strategy after a trade is initiated.Tags: None
-
Hello shodown888,
Thanks for your message.
First, be aware that it's not possible to add an ATM Strategy once a position has been opened, as there's no supported method to add an ATM to a position from NinjaScript.
While not officially documented or supported, there is an unsupported code to protect an open position, which was shared on our Forum website.
AtmStrategy.ProtectPosition(selector.SelectedAtmSt rategy, Position);
Another alternative is to use Set Methods to protect your position. The link below contains examples on how to do so.
Also, the NinjaTrader platform comes with a built-in sample ATM strategy code that demonstrates how the ATM is created within NinjaScript. On the Control Center, Click on New>NinjaScript Editor. On the right side of the window, open the strategy folder, and you will see the file SampleAtmStrategy. This sample will give you a breakdown of all the steps that are taken to create an ATM strategy within your script.
Next, the add-on approach would be needed to modify any of your orders using Account.Change().
AddOn Development Overview
Developing Add Ons
Other uses for Add-ons
Account Class
Note that an Atm with a stop strategy would supersede any modifications made by a script.
Finally, the most efficient approach would probably be to submit the entry through a script ( via a button click in a custom Add-On), and then automatically submit associated stop and target orders once the entry is filled. The stop and target prices should be dynamically controlled through code.
Feel free to reach out with any other questions or concerns.
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
23 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
120 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
63 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
41 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
45 views
0 likes
|
Last Post
|

Comment