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
SetStopLoss()
Collapse
X
-
SetStopLoss()
Hi, I'm writing a strategy that enters a long position at a certain price with an initial stop loss set at 10 ticks (using SetStopLoss() in OnStateChange section). Once I reach an initial profit level, I want to adjust my stop loss upwards. This seems simple to do but I could not find an example where my stop can be adjusted from its initial setting. Any assistance is greatly appreciated! thanksTags: None
-
Hello pman777,
Thank you for your note.
You could see the following two samples.
The following sample will move a stop to breakeven after 5 ticks have been reached,
The last sample at the following link will adjust the stop up as profit grows,
Please let us know if you need further assistance.Alan P.NinjaTrader Customer Service
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by leonardomocci, Today, 08:28 AM
|
0 responses
1 view
0 likes
|
Last Post Today, 08:28 AM | ||
Started by geotrades1, Today, 07:54 AM
|
4 responses
9 views
0 likes
|
Last Post Today, 08:27 AM | ||
Only display optimization results that has number of trades between a range (min max)
by prisonbreaker82
Started by prisonbreaker82, 02-24-2024, 11:16 AM
|
3 responses
36 views
0 likes
|
Last Post Today, 08:22 AM | ||
Started by bill2023, Today, 08:21 AM
|
0 responses
3 views
0 likes
|
Last Post
by bill2023
Today, 08:21 AM
|
||
Started by KonAdams, Yesterday, 10:53 PM
|
1 response
12 views
0 likes
|
Last Post Today, 08:21 AM |
Comment