Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Hi everybody,
I m just trying to code Larry Williams 3bar trailing stop in NinjaTrader. I m not experienced in programming, so would need help. I believe that this indicator will help many people to stay in position and let the profit runs.
Here is what I need to code:
If long, determine the highest close (inside daysdont count) in the up move so far. Count that day as day one and go back to get two more days. Once all three days have been noted, then determine the lowest true low of those three days.
For short everything vice versa.
Thank you for help.
Can you help answer these questions from other members on NexusFi?
I just corrected the wording. I made a mistake. Hope it will be clear now.
here it is again
---------------------
If long, determine the highest close (inside daysdont count) in the up move so far. Count that day as day one and go back to get two more days. Once all three days have been noted, then determine the lowest true low of those three days.
----------------------
----------------------
what I mean is that if I m long I should find the highest close(inside day dont count) in the up move. this will be the day 1, and now I should get two more days (none of them inside day) and from this three days find the lowest true low which is the stop/loss
So the stop/loss will stay the same in small corrections.
I have tried to search for the exact formula, but could not find it. It seems that Larry Williams has used several approaches to define trailing stops.
-> one is based on a high average and a low average (three bar high/low system)
-> one is called Williams Volatility Stop and looks like a SuperTrend indicator
-> one is called WillStop
Stop when Short: When the previous days high is greater than (half of 90% of the True Range
added lo half of the previous Close plus the current close) then use the previous days High plus a tick as your stop. Otherwise when the previous days High is …
to code a 3 bar trailing stop. This indicator seems to be one of the indicators developed by Larry Williams.
and a trailing stop formula, which I will try to put in words:
-> when short, use the larger of (High[1] + 1 tick) and (SMA(2)[2] + 0.9 * TR[2])
-> when long, use the smaller of (Low[1] - 1 tick) and (SMA(2)[2] - 0.9 * TR[2])
where High[1] is the high of the prior bar, Low[1] the low of the prior bar, SMA(2)[2] the 2-period SMA 2 bars ago and TR[2] the true range 2 bars ago.
I have tested this approach and did not like the bands the way they were plotted, therefore I have modified the formula
-> replaced the true range two bars ago TR[2] with the 2-period average true range two bars ago ATR(2)[2]
-> allowed different parameters than 0.9 for the multiplier
-> introduced an option to calculate the SMA(2)[2] from the typical price or the midpoint instead of the bar close
-> exposed the current trend based on the rules via plot colors and paint bars
I think that the modifications improve the indicator. Any comments would be welcome.