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
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. ...
Boris Hi IVMcm, thanks for your amazing work. I have tested all of your indicators and use some of...
IV Mcm With pleasure and thanks!
ashiash how to use this indicator can i use tradingview platform
zilliq Thanks @Nicolas. I tried to use it as Trend in a proorder system, but don't know why, it doe...
Suzu Yuk He is right. MT and mavgMT are not defined and causing errors.....
Maxime Baudin Super travail !
Yanic c'est top j'adore
Maxime Baudin Merci l'ami, passe une bonne semaine
IV Mcm Merci de même ;)
RakeshPoluri I have a question about the bands on the candles. Is it bollinger bands or something else?
Nicolas I think that's 2 Bollinger Bands
Emperor.it "style(line,2)" C'è una guida ai parametri che si possono modificare ? Tipo stile della lin...
IV Mcm https://www.prorealcode.com/programming-with-prorealtime/
Daniele Maddaluno Écrivez-moi où vous préférez you can easily find me on LinkedIn
AK27 C'est payant visiblement sur linkdin je peux pas vous envoyer, discord vous avez ?
Nicolas C'est dans ce sujet: https://www.prorealcode.com/topic/trendline-une-approche-du-trading/ M...
Pensera Bonjour Nicolas, comment est-il possible de backtester cet indicateur? cela fait une erreu...
Nicolas Oui bien sûr, il doit y avoir pas mal de sujets dans le forum à ce propos.
Manu L. Bonjour Nicolas, j'ai créé un screener avec l'aide à la prog en TF weekly mais je voudrai...
wtangsiri C'est exactement le même signal que donne le croisement et le décroisement de deux EMA (7 et...
PHAN100 bonjour, j'ai un bug sur le programme recopié prorealtime me dit qu'il y a un problème à ...
IV Mcm Vous devez faire un clic droit sur le prix > propriété > ajouter indicateur Si vous...
punch1 Fonctionne pas chez moi il s'affiche rien pourtant j'ai bien fait le clic droit sur le prix ...
punch1 Je peux te faire un screen d'ecran si tu as un email :)
ferros bonjour , super votre indicateur!!!! est-il possible de l'avoir en histograme +1 /-1 por en...
IV Mcm V2 is coming
SudhirRN is this code working for on tradingview plartform?
Nicolas No. All our codes are made to be used with ProRealTime trading platform: https://www.proreal...
Nicolas Il doit s'agir d'un mauvais copier/coller. Je suggère de télécharger le fichier itf contenu ...
Bard Hello @Nicolas, I can get this to display in a separate indicator panel but not on Price as ...
Stenozar Hi @Nicolas, how can I put the bands on price? Thanks, Stefano
Fabian Hi IV Mcm, have you drawn the rectangles (Dinamic, Range) by yourself in the chart or are...
IV Mcm Myself to illustrate ;)
oraclus Bonjour indicateur très intéressant existe t il un screener qui détecte les actions qui donn...
IV Mcm Ce n'est pas le but de cet indicateur, mais avec un peu d'entraînement vous pourriez le code...
Yantra Thank you for sharing your good work!

Top