Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Automatically Place SL at High or Low of Previous Candle
Collapse
X
-
Automatically Place SL at High or Low of Previous Candle
Hello! I need some help creating a strategy that allows me to manually place market orders with the chart trader and it automatically places a stop loss at the high or low of the previous candle depending on if its a long or short position. I also want it to place a TP at a 1:1 from that. Can someone help me with this? Thanks!Tags: None
-
Hello BrennenHunter,
You could use the addon approach in an indicator to detect order submissions and automate sending exit orders.
In the indicator you would need to add an event handler method to the Account.OrderUpdate or Account.ExecutionUpdate event.
Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.
Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.
Then send order using Account.CreateOrder() and Account.Submit().
Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.
Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.
Below is a link to an example, ProfitCaseStopTrailIndicatorExample, that has sample code of using these events and methods.
Chelsea B.NinjaTrader Customer Service
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
85 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
124 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
64 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
115 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