Williams’ 3 bar trailing stop

Williams’ 3 bar trailing stop

This is one of the very best trading techniques I have ever developed. The reason why is that it often rides mega trend markets for a long , long time, yet does not give back much profit when the correction begins as conventional moving average and channel. 

This technique can be used not only as an exit techniques, but as an entry technique as well. It is really quite simple. Once the market is in a run away move, as I call it a “rock and roll” market – then and only then – do we use this exit. Price must be out of a trading range. 

As a trailing stop: Make certain prices are out of congestion, they have begun to run, then, and only then, implement this as your trailing stop (i.e. exit).

For entry: Make certain the market is really set up. Sometimes the first entry will be false as a straight up or down market usually “bases” before the next trend move begins.

(excerpt from the author’s description of this trend following indicator)

This indicator has been requested by Maximus 78 here (https://www.prorealcode.com/topic/3-bar-trailing-stop-di-larry-williams/).

Blue skies!!!

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

  1. Franz1234 • 07/13/2017 #

    Hi gabri,
     
    great work! I am currently working on this 3 bar trailing stop for trading view and I have coded pretty much the same indicator as you. 
    But, the original requirement is to start counting at the highest close in an up move (and lowest close in a down move). So in particular once this highest/lowest close is found then apply then find the lowest/highest low of the last three bars which are not an inside bar.
    The result would be an indicator the keep a bigger distance from the price action when the price moves sideways and does not make new highst/lowest closes.
    So far my thoughts are that it is crucial to define first: “When did the up/down move begin!” This could be done by the indicator which you have already programmed. And then take this as a starting point to find the highst/lowest closes to calculate the further progression of the stop.
    I haven’t found a way to do so. Would be great I you could think about this an share your ideas!
    Thank you in advance!

  2. gabri • 07/13/2017 #

    Franz,
    I see what you mean. I will try to work some code for that but I cannot make any promise.
    G

  3. gabri • 07/13/2017 #

    Franz,
    can this code work for you?
    count=1
    i=0
    j=i+1
    tot=0
    //calcolo 3 barre
    while count<4 do
    tot=tot+1
    if (low[j]<low[i]) and (high[j]>high[i]) then
    //inside bar
    i=i+1
    j=j+1
    else
    count=count+1
    i=i+1
    J=i+1
    endif
    wend
    if close>close[1] then
    basso=lowest[tot](close)
    endif
    if close<close[1] then
    alto=highest[tot](close)
    endif

    if barindex>1 then
    if close > ref[1] then
    ref=basso
    endif
    if close < ref[1] then
    ref=alto
    endif
    endif
    return ref
    I also changed something between lines 5 and 14 to calculate the inside bars. I considered up trend any close above “ref” and downtrend any close below “ref”. Let me know if it works better.
    G

  4. Francesco78 • 07/13/2017 #

    Hi, can you show at least one strategy that works well with this indicator?
    The idea is nice.
    Thank you 

  5. gabri • 07/13/2017 #

    Francesco,
    I just tried to code an idea from Maximus 78 (https://www.prorealcode.com/topic/3-bar-trailing-stop-di-larry-williams/). I am sure he has all the info about strategies connected with this indicator. If I had to guess though I’d say that, being this a trailing stop indicator, it has to be used in conjunction with some other sort of trend indicator.
    G
     

  6. Paul • 07/13/2017 #

    Good work ! I was looking for way to maximise profits and this serves it’s purpose well !

  7. gabri • 07/13/2017 #

    Thanks!!

    • Kris75 • 07/13/2017 #

      Hi Gabri

      I launched a very simple strategy based on the 3 bars trailing stop that you created and plugged it with a dynamic trailing stop from Nicolas;
      it kikcked me out immediately but I don’t understand why;

      Can you see the reason?
      What should have been the code?

      Very best,

      Chris

      PS : the insert code is not working here;

      //————————————————————————-
      // Code principal : STOP LOSS MM
      //————————————————————————-
      defparam preloadbars = 150
      defparam cumulateorders = false

      entry = 32.30

      // trailing stop
      count=1
      i=0
      j=i+1
      tot=0
      while count=low[i]) and (high[j]alto[1] then
      TrailATR=basso
      endif
      if close entry

      if condition then
      buy n shares at market
      //first stoploss:
      SL = TrailATR
      set stop ploss SL
      dynamicSL = SL
      endif

      //dynamicSL
      if longonmarket then
      if(TrailATR>dynamicSL) then
      dynamicSL=TrailATR
      endif
      sell at dynamicSL stop
      endif

  8. TimDeCat • 07/13/2017 #

    Hi. Has anyone coded a version that you could alter it to say 5 bar trailing stop? ie make the number of trailing bars a variable?

    • Nicolas • 07/13/2017 #

      Please open a new topic in forums so we can code it there, thanks.

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar

+13 more likes

Related users ' posts
FXtonio @RICOU en 1 minutes avec un filtre de tendance ZLSMA 200 et eventuellement un rsi 7 , 69% de...
JC_Bywan For people interested in the screener: https://www.prorealcode.com/topic/screener-buy-sell-m...
octum Gracias NJicolas. Las lineas 35 y 36 dan fallo. (¿Es adrede para iniciados?) Puedes co...
Nicolas Yes, Magic if the variable that contains the value of the line, you can test if it goes up o...
dadah1987 Bonjour Nicolas, merci pour cet indicateur. Utilisant pour l'instant la création simplifié p...
Nicolas Merci d'ouvrir un sujet sur le forum avec une description complète du système.
GustavoLoboOrenstein Is it possible to add histogram with only increasing bars?
Nicolas Je ne rencontre pas ce problème avec le NASDAQ par exemple, ce serait plus simple d'ouvrir u...
YvesRobert Bonjour Nicolas, en effet ca marche, je me suis trompé, j'ai bien tout le tracé. C'est parce...
oliTR Bonjour, les conditions longCond et shortCond ne contiennent-elles pas une condition qui s'a...
mfejza also, for long trailing stop d2=low d1=lowest[3](d2)+1/3*AverageTrueRange[20](close) d3...
Jiacky
2 years ago
Kalman Filter
Kalman Filter
0
Indicators
JohnScher Postscript: It's running in the live right now. One position after the other is opened. ...
ullle73 nice!! how's it been since your last post on going live? :)
thomas2004ch Hi, Is this strategy suitable for daily SPY? Regards
AndPar Buongiorno Nicolas, vorrei provare questo indicatore, ma quando lo inserisco in PRT mi vengo...
Nicolas Basta aggiungerlo al prezzo https://www.prorealcode.com/blog/video-tutorials/how-to-add-an-i...
Aragorna hello Nicolas, this indicator works with the last Beta version of PRT? Ive seen tha many in...
wally Hola soy nuevo en el mudo robots. Alguien seria tan amable de poner el archivo itf.file ya q...
Darren Nash I found this works well on the DOW
thomas2004ch Hi John, Is your strategy suitable for daily SPY? Regards
KAMJKAZE thanks, really interesting!
2c95 thanks, why do U prefer average than lowest ? to close under average does'nt mean another...
Stenozar Hi Sever, how can I visualize the coloured areas?
Sever Hi Stenozar, You need to add the color zones yourself , just go to Add Color Zone To set ...
CederTrader Hi Denis, does this indicator add to the chart as panel, or on the candles. Thanks
Nicolas Add it on the price chart as described in this video: https://www.prorealcode.com/blog/video...
Denis Hello Nicolas and Ceder Trader, Sorry, I only just saw your replies. The indicator is alre...
atlante hi nicolas this indicator have 2 wrong borderline and islalastbarupdate. thank you can you h...
Nicolas That'"s because you are not using PRT v11? Just remove lines 59 to 62
Kanamax Hi Roberto, sorry for my confusing previous posts (forget them). My request is very simple,...
robertogozzi Please start a new topic in ProOrder support.
robertogozzi There you go: myMagicTrend = CALL “Magic Trend custom”[20, 14, 1, 5] alpha = 105 b = 0...
johann8 exactly :) Thank you all for the help!
max_92 Ciao Roberto, ho scaricato l'indicatore e come ti avevano già scritto sopra anch'io vedo la ...
Xenotrax A première vue, sa à l'air d'être un indicateur très puissant sur de petites temporalités, j...
merri Bonjour Nicolas, Comment transformer cet indicateur en bot sur PRT ?
Nicolas Cela a déjà été fait, voir ce sujet: https://www.prorealcode.com/topic/strategia-con-lindica...
Nicolas change the last line with: return v coloured(r,g,b) style(line,2), v+band coloured(168,168,1...
Paolo.B Thanks ... works as i wanted.
Kanamax Bonjour Nicolas, comme Paolo.B je souhaiterais utiliser cette indicateur au sein d'un code. ...

Top