Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Coding for a "no loss" Reversal Strategy
Collapse
X
-
Coding for a "no loss" Reversal Strategy
Need help coding a "no loss" reversal strategy (not a coder). Would like to set a bracket order after entry with a profit target (input; ticks) and a stop loss (input; ticks) initially. If stop hit enter a new trade (different # shares; input) in the other direction with a profit target/stop loss (same ticks for all trades). Again, if stop loss hit take trade in other direction and do this procedure until profit target reached or max hit (max of 7 reversal trades) or 5pm EST. Hope this makes sense. Thank you in advance for your help.Tags: None
-
Hello carolle0953,
Below is a link to a forum post with helpful resources on getting started with C# and NinjaScript. I encourage you to watch the 'Automate Your Trading with NinjaTrader's Strategy Builder' and 'NinjaScript Editor 401' training videos and then begin by using the Strategy Builder to make simple scripts.
If you are wanting to reverse the position, the easist way is to use the managed approach and call an entry order in the opposite direction of the position.
NinjaTrader will manage the position and automatically submit a 'Close position' order and then your new entry to reverse the position.
Hello. Why does my strategy not reverse positions as soon as I put in StopLoss or TrailStop methods? The active position has to be closed by either two
Alternatively, you can detect the 'Stop loss' or 'Profit target' order has filled in OnOrderUpdate(), and send the entry in the new direction after the exit order has filled.
You can increment an integer variable as a counter to count how many times an event has occurred, such as a reversal.
Chelsea B.NinjaTrader Customer Service
-
Hello Riza,
Welcome to the NinjaTrader forums!
If the order.OrderAction is OrderAction.Sell and exiting a long position, then submit an EnterShort() to enter a short position.
If the order.OrderAction is OrderAction.BuyToCover and exiting a short position, then submit an EnterLong() to enter a long position.
Below is a link to the help guide on Order.
Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Yesterday, 05:17 AM
|
0 responses
54 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
131 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
73 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
44 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
49 views
0 likes
|
Last Post
|
Comment