Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
attaching stop to an indicator
Collapse
X
-
Hello babouin77,
Thank you for your post.
Is this a strategy you're coding manually in the NinjaScript Editor or in the Strategy Builder?
If in the Strategy Builder, you will need to use Exit orders in the Conditions and Actions screen so the price the order is placed at may be updated to trail the indicator in question. I've created a simple example of this approach that enters long and submits a stop that will trail along with the EMA as long as the EMA is below the current price. If the price goes up to a specific number of ticks above the entry, we submit a market order to exit as a profit target.
I've also created a simple example of manually coding this so you can use Set methods like SetTrailStop - your code would need to be unlocked to use Set Methods in this way.
Basically you have to call the method to submit the stop again, which will update the original order to the new price.
Please let us know if we may be of further assistance to you.Attached Files
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
58 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
34 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
195 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|
||
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
359 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
281 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|

Comment