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
Gaspare Ciao Ivan si puo' inserire una strategia su questo indicatore per ottimizzare le variabil...
Iván
2 weeks ago
groelandes Cuando te descargas el fichero itf, en su código no aparece toda la configuración de alertas...
Iván Si lo descargas e importas en tu PRT verás que se han creado las variables para luego config...
P. Marlowe Quite an impressive work, Iván. Extremely useful and accurate. Congratulations. Keep it up¡
lkiklkik i love it !!! thanks.
Stenozar Hi Ivan, can you translate from tradingviwe the EMA TREND METER INDICATOR? It couid be inte...
Iván Hi Yes I can. Please, create a new topic for that I will translate it.
Stenozar Hi Ivan, I've created a new topic about the indicator: https://www.prorealcode.com/topic/ema...
Doddge Hola Iván, ¿sería posible crear un screener que indique cuándo las velas coloreadas del indi...
RTR Ivan thank you for the pro-screener. I a trying to understand how to write the signals from ...
Iván Hi, Lines 62 and 63. These lines define buy and sell conditions.
Iván Hi You should delete from the indicator code all drawing functions and all variables not us...
Iván I've created a screener to show [longcondition or shortcondition]
Chrisinobi Hallo Ivan, Danke das ist Perfekt !! Kannst du bitte in der Screener-Bibliothek die itf. hoc...
MaoRai54 Thanks, now it's OK. in your first code at line 15-16 it's missing.
Madrosat Hello Ivan Did you try a strategy with this indicator
Iván Hi. No I didn't. This is a code translation requested by an user a few days ago.
Iván
2 months ago
cjr30 Simplemente modifica las lineas 19 y 21 por las siguientes: drawtext("▲",barindex,low-0.1*a...
groelandes Gracias!!
WhyAskOZ i copied the code into strategy and it gives error on line 21 and 23. it says " Line 1: ...
Iván
2 months ago
Madrosat Hello Ivan You have interesting topics on indicators , smart supertrend, optimised trend t...
Iván Hi! thanks. All of these codes are translations requested in the forum. I've on mind to back...
Raspete01 Buenos días Iván, estoy intentando llevar el código eliminando los colores y pasando un Back...
Iván
3 months ago
ARLEQUIN49 Hello Ivan, Would it be possible to convert the code of this QQE MOD indicator which accomp...
ARLEQUIN49 here is the code: //@version=4 //By Glaz, Modified // study("QQE MOD") RSI_Period = i...
Iván Hi, Yes I can translate it but please, create a new topic for it.
Fgats quelques explications en Français ici : Some explanations in French here : https://www.p...
Nicolas Merci pour cette contribution, j'apprécie ! :)
Fgats Merci Nicolas pour ces encouragements et merci aussi pour le commentaire en Anglais accompa...
Alai-n I really like it when you develop ideas around price movement! I am much less a fan of all t...
elcortijoverde Muy buen trabajo.Intuitivo y claro.Gracias por tu dedicación y aportación.
Nicolas
9 months ago
B-Xtrender
B-Xtrender
7
Indicators
Fgats I suspected something like this but in the PRT documentation I couldn't find anything to exp...
616248 Bonjour Nicolas, Peux tu nous expliquer le principe de fonctionnement ? Ou nous mettre un...
Nicolas Le lien vers l'article IFTA de l'auteur est dans le post déjà :)
JS
9 months ago
Trendilo
Trendilo
0
Indicators
Nicolas
9 months ago
Anthony2A Bjr, j ai des erreurs sur la ligne 69, 74, 78 et 80. sur drawcandle drawtext et endif. si ...
Lucas0000 Hello, Congratulations on this programming, it seems incredible to me, I am new to this but ...
plbourse Hello, I am trying to use this singal (in fact I have converted it to an indicateur giving B...
BriceE Bonjour Nicolas, Je suis a la recherche d'indicateurs pour me donner la meilleure indicatio...
Nicolas
11 months ago
Maxime Baudin Well done Nicolas, creative!
Stenozar Hi Nicolas, please can you explain how to read/use this indicator? thanks!

Top