Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
SWING as stop loss
Collapse
X
-
Hello ampf27,
Thanks for your post.
You could use Swing(int strength).SwingHigh[int barsAgo] and Swing(int strength).SwingLow[int barsAgo] to get the Swing High and Swing Low values.
Those values could then be offset by a certain number of ticks when used for your stop-loss order price.
For example, the code to use the price of the Swing Low value - 5 Ticks for a stop loss would look something like this.
ExitLongStopMarket(1, Swing(5).SwingLow[0] - 5 * TickSize);
See the help guide documentation below for more information.
Swing: https://ninjatrader.com/support/help.../nt8/swing.htm
TickSize: https://ninjatrader.com/support/help...8/ticksize.htm
Managed Approach Order Methods: https://ninjatrader.com/support/help...d_approach.htm
Let me know if I may assist you further.Last edited by NinjaTrader_BrandonH; 02-05-2023, 05:36 PM.Brandon H.NinjaTrader Customer Service
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by zstheorist, Today, 07:52 PM
|
0 responses
3 views
0 likes
|
Last Post
by zstheorist
Today, 07:52 PM
|
||
Started by pmachiraju, 11-01-2023, 04:46 AM
|
8 responses
149 views
0 likes
|
Last Post
by rehmans
Today, 06:44 PM
|
||
Started by mattbsea, Today, 05:44 PM
|
0 responses
5 views
0 likes
|
Last Post
by mattbsea
Today, 05:44 PM
|
||
Started by RideMe, 04-07-2024, 04:54 PM
|
6 responses
33 views
0 likes
|
Last Post
by RideMe
Today, 05:31 PM
|
||
Started by tkaboris, Today, 05:13 PM
|
0 responses
5 views
0 likes
|
Last Post
by tkaboris
Today, 05:13 PM
|
Comment