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
Strategy with trailing stop based on high/low of previous bar +- some input value
Collapse
X
-
Strategy with trailing stop based on high/low of previous bar +- some input value
I am attempting to build a strategy with a trailing stop that is based on the High/Low (short position/long position) of the previous bar +- some input value. I can't see any coding method for that within the strategy builder stop and target section. Is this possible and can you provide me some examples of how it would be codedTags: None
-
Hello gjbeaudin,
Thank you for your inqiry.
The Set methods in the Stops and Targets section of the Strategy Builder only allow for simple stops and targets that cannot be changed dynamically. Programming by hand will offer more flexibility, but you can also create your own logic in Conditions and Actions that controls how you would like to exit.
We can not offer services to design strategy logic in the support department, but you may conceptualize the following as an example of using Exit orders to mimic Trail stop functionality:- If the strategy is flat, set a bool to controlling your auto trail behaviors to false. Then Enter.
- If the strategy is not flat and some condition happens that you would like to trigger your auto trail, set the bool to true.
- If the strategy is not flat and the bool is false, place your initial stop loss as an Exit Order.
- If the strategy is not flat and the bool is true, modify the Exit Order in association to the current market price.
Strategy Builder 301 - https://www.youtube.com/watch?v=HCyt90GAs9k
I'm also attaching a basic example of setting this functionality up in the Strategy Builder.
Please let us know if we may be of further assistance to you.Attached FilesKate W.NinjaTrader Customer Service
-
Originally posted by gjbeaudin View PostI am attempting to build a strategy with a trailing stop that is based on the High/Low (short position/long position) of the previous bar +- some input value. I can't see any coding method for that within the strategy builder stop and target section. Is this possible and can you provide me some examples of how it would be coded
1) https://ninjatraderecosystem.com/use...bot-indicator/
2) https://ninjatraderecosystem.com/use...er-entry-v4-2/
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by pibrew, Today, 06:37 AM
|
0 responses
0 views
0 likes
|
Last Post
by pibrew
Today, 06:37 AM
|
||
Started by rbeckmann05, Yesterday, 06:48 PM
|
1 response
12 views
0 likes
|
Last Post
by bltdavid
Today, 05:43 AM
|
||
Started by llanqui, Today, 03:53 AM
|
0 responses
6 views
0 likes
|
Last Post
by llanqui
Today, 03:53 AM
|
||
Started by burtoninlondon, Today, 12:38 AM
|
0 responses
10 views
0 likes
|
Last Post Today, 12:38 AM | ||
Started by AaronKoRn, Yesterday, 09:49 PM
|
0 responses
15 views
0 likes
|
Last Post
by AaronKoRn
Yesterday, 09:49 PM
|
Comment