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, 03-31-2026, 09:41 PM
|
1 response
45 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
21 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
31 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
50 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
42 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment