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
Nicolas le code est déjà sur cette page, inutile de fournir un autre format ?! Les fichiers itf sont...
Novice-Surfer Hello IV Mcm, You are my leader ! Your work is incredibly precise, thank you very much f...
Mikolajek Merci pour votre excellent travail !
mickey992 salut merci pour ton partage et ton travaille
patapouf Hi Vivien René I just discovered your “Ordered trend-following stocks Screener”. Great work...
afanitro424 its not plotting on chart but instead as it's own histogram directly below chart? How to fix...
Nicolas by adding the indicator on the chart :)
Nicolas Oui c'est possible. Merci de ne pas poster des demandes qui sont hors sujets. Pour les deman...
Igor Merci pour cet itf. Question : comment faire pour instruire un screener ?
Nicolas tester le croisement du Close avec la première valeur de l'indicateur : "TrailingStop", faci...
Dunstan I would like to get guidance_ How do I access and attach this indicator to my MT5 platform...
Nicolas You can't, use prorealtime, it's way better
jc84 Thank you very much for this indicator , not provided by PRT I was actually working at thi...
Nicolas Oui le code est correct et il fonctionne, j'ai de bons résultats sur la liste NASDAQ par exe...
pincherman Bonjour :-) J'ai coller le script dans prorealtime pour jouer avec le supertrend et j'ai un...
Nicolas Vous l'avez sans doute collé au mauvais endroit, dans l'éditeur de code pour les stratégies,...
IV Mcm Bonjour, Je ne reconnais pas cette ligne dans le code, essayer de télécharger directement le...
Manu L. Bonjour, Possible de créer un screnner multiframe Mois dans Ichimoku semaine dans Ichimok...
Guillaume Mcm I gave the above message fix ;)
Tradingrob Is it possible to put the itf-file in the right way here in Prorealcode? so the right 'trend...
Guillaume Mcm Update link ;) https://www.prorealcode.com/topic/trend-histogramme-cci-mise-a-jour-suite-...
Screw27 Hi man, I installed the indicator and i don't know why but my graph it is so big
HelixKing sounds interesting I'll take a look
Godo Bonjour Souhait Sam, Après de nombreux essais pour le mettre en format afin d'utiliser ce c...
Nicolas Il faut supprimer celles qui existent dans la fenêtre d'optimisation et les créer en dur dan...
crusoe76 hi there, anyone can help making this strategy work, i have a message saying replace variabl...
Screw27 Salut nicolas j'aimerais savoir tes résulats grace a cettte methode
eva.g.forsgren It dose not work, I get a strap instead of candels???????????????????????????????????????????
Nicolas That indicator is the one below the chart. The indicator to put on the price chart is this o...
pyhrus P.S : IG , que j'ai contacté ,m'indique que la version V11 , ne sera pas disponible avant un...
Hasardeur Dear Nicolas, is there someting at the arry to modify in order to run the trend at the actu...
MALIMALO Dear Nicolas, just try touse your indicator with backtest but it's not working. is anybody...
ribes65 Bonjour Nicolas, Merci pour votre travail. Est-il envisageable de créer un screener pour ...
Nicolas Bien sûr, merci de formuler une demande dans le forum des screeners pour prorealtime. En res...
ipbvba Est il possible de le transformer en indicateur (pour ne plus avoir les lignes mais uniqueme...
supertiti Bonjour Nicolas, Je ne comprend pas bien , le trend change de couleur quand les prix sont a...
Nicolas Oui ce serait possible, cependant l'indicateur est bien prévu pour conserver la couleur de l...
supertiti Quand tu pourras si tu peux nous coder la troisième couleur cela améliorerait les trades cou...
Nicolas How to import file page: in the help section of the website explains howto
kenssa import through the indicator page/window in the Proreal time
chicoteca Buenas, no consigo que se me muestre en el chart de DAX. ¿Cómo procedo? Gracias.-
Nicolas remplacer les valeurs de coloured(0,255,0) par coloured(r,g,b) et ajouter ces noms de variab...
mohamed merci Nicolas!
sacram14 Merci Nicolas pour ce set-up que je ne connaissais pas ! J'ai tenté de reprendre le code pou...
frenqle Hi There.. It seems the TSL stop loss is not working.. it does not respond is that correct?
Ciccarelli Franco Per lasciare che la strategia venga eseguita (dopo aver importato il file): Basta eliminare...
JADINVEST Hello Jan, hello everyone, Thanks Jan for this strategy! Since 2020, have any of you found a...

Top