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 Mindset, 04-21-2026, 06:46 AM
|
0 responses
88 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
134 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
68 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
119 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
67 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|

Comment