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 NullPointStrategies, Yesterday, 05:17 AM
|
0 responses
59 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
134 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
75 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
45 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
50 views
0 likes
|
Last Post
|

Comment