Reversal signal ThreeLineBreak

v10.3
Reversal signal ThreeLineBreak

This is a modified version of the three line break price representation. It is composed with 2 lines made of Close price values forming a “cloud”.

  • If the trend is bullish and the price breach the lower level of the green cloud, a new bearish trend is taking place.
  • If the current trend is bearish and the price breakout the upper band of the cloud, a new bullish trend is forming.

This is a “price action” indicator, signals may be filtered by long term trend analysis with other indicators such as Supertrend for instance.

This indicator has been converted from Nanotrader coding language by a request in the French forum.

 

 

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. Francesco78 • 06/23/2017 #

    Thank you , have you tried to backtest it with any instrument by any chance?
    Thanks a lot
    Francesco 

    • Nicolas • 06/23/2017 #

      Not myself, but I know user ‘turame’ want to code a straetgy built upon this indicator, the french thread link: https://www.prorealcode.com/topic/creation-indicateur-de-suivi-de-tendance-bandeau/

  2. Francesco78 • 06/23/2017 #

    great, thank you

  3. turame • 06/23/2017 #

    Great work Nicolas ! 
    Effectively I’d like to create a strategy. But first I have to modified the code to create an histogram signal +1 / -1. Not so easy 🙂
    If the results are concluding, I’ll post it !

    • Nicolas • 06/23/2017 #

      Just add “TREND” to the RETURN function and you’ll already get the -1 / 1 signals.

  4. Francesco78 • 06/23/2017 #

    It works as a good indicator (although in a counterintuitive way ) on the daily cac 40. Will post a strategy soon.

  5. manel • 06/23/2017 #

    Thank you Nicolas. Its nice to be able to have the indicator and price on a single chart, previously it was only one or the other. I tried a version of this last year (in fact I think you helped with something similar for me) but it didn’t quite work as I wanted it to and I put it to the side on my todo list :-). The code posted above however looks more promising. I trade the 3 line break manually and can confirm it does have some success (especially on equities) but obviously there is limited testing as currently I could only test forward. Now that we have an automated code for it will be interesting to see if it the indicator works with history once we can incorporate into a strategy. Also, for info, I found that depending on the market and timeframe a 4/5 line break sometimes works better in providing more accurate signals which I presume is fairly easy to amend the above code for this. Will post here if I find some promising results in my testing. Thanks again.

    • Nicolas • 06/23/2017 #

      Great to hear it will help you! Don’t hesitate post your results or ideas from this indicator, I would be more than happy to help you. Have a great weekend. 

    • manel • 06/23/2017 #

      Cheers, will do. Have a great w/e.

  6. manel • 06/23/2017 #

    An update – To start off with, I’ve actually used the indicator created by Francesco here on the Dax 30m – https://www.prorealcode.com/prorealtime-trading-strategies/cac-40-strategy-reversal-signal-threelinebreak-indicator/ (Sorry couldn’t add a link as it jumps me to the bottom of the page every time I click on “insert link” ) – Thank you Francesco ! I added an 25/55 ema filter and then ran a backtest. Results are pretty good with a 79% WFE ratio and 8% draw and profits split equally between long and shorts (which I like). I plan on working on it a bit more to create a higher win rate. Also aim to test out the non-reverse version of the indicator (ie the normal way !). But so far, the work looks promising, I think I’ll need a bit of help in coding the next steps at some point so I’ll reach out to see if anyone can help on here. Thanks again Nicolas for coding this !
    PS – I can’t post a screenshot of the results here as don’t have the permissions but maybe I should open a new thread once I have enough confidence that it can progress past an initial stage of scrutiny.

    • Nicolas • 06/23/2017 #

      Please open a new forum topic if you want to discuss further more of your idea! Thanks for the update, it’s really cool to know this indicator works well for you 🙂

  7. larouedegann • 06/23/2017 #

    Salut Nicolas,
    Petit soucis technique sur cet indicateur…..
    Les chandeliers disparaissent à chaque changement de timeframe. Je suis en 15mn.
    Je suis obligé d’enlever l’indicateur puis de le remettre.
    Merci
     

    • Nicolas • 06/23/2017 #

      Pas de ma faute je le jure ! 🙂 

  8. manel • 06/23/2017 #

    Hi – have come across a difference here in the calculation of the indicator. It’s meant to replicate the 3 Line Break price chart and I would say 90-95% of the time the code achieves that perfectly but there a few instances where it does not match. It’s slightly puzzling as presumably the background code in PRT that calculates and displays the 3 Line Break price chart should be the same as the one coded in this post – so they both should either be accurate 100% or not, not accurate some of the time which is why its strange. It could be of course that there is something slightly incorrect about the PRT chart itself and not the code.
    As an example, if you draw up a PRT 3 Line break chart of the 1H DAX and then compare that with the signal generated by the code above for Mon 29 May :Indicator shows sell signal at 0700 – matches with PRT Indicator shows buy signal at 1000 – none in PRTIndicator shows sell signal at 1300 – none in PRTIndicators shows buy signal at 1500 – none in PRT
    As I say – this only happens occasionally as most of the time the code calculates as it’s supposed to. Any ideas what could be causing the differences ? Thanks
     

    • Nicolas • 06/23/2017 #

      I don’t know, the code of this indicator is one from another platform, not the Three Line Break of prorealtime, that’s why it may have some differences in their calculation.  Since I do not have source code of how PRT calculate its own TLB charts I’m not able to compare sorry ..

    • manel • 06/23/2017 #

      Ok, many thanks. I’ve tried messing around with the code myself but am no closer to solving the issue and I’m not proficient enough with coding yet to try and do something more with it. Maybe someone here can look at it and hopefully solve the problem. It explains why in backtest some of the results are not quite correct but it’s better than we had before so small steps…..:-)

  9. mcha • 06/23/2017 #

    Merci à Nicolas pour cette approche nouvelle et qui prend en compte l’action des prix. Est-il possible de supprimer les lignes verticales grisées indiquant chaque reversal?

    • Nicolas • 06/23/2017 #

      Il faut supprimer les lignes 101 à 103

  10. JohnScher • 06/23/2017 #

    Hello.

    I use your ThreeLiner in manual trading with as an indicator. He works very well. Thank you very much.

    I wanted to use the ThreeLiner as a reversing signal in domestic trade and found that the greater the distance between the upper and lower edge, the better it can be traded as a reversing signal.

    I was wondering if you could tell me how to measure the distance between the top and bottom edge in automated trading?

    The ThreeLiner works quite well as a reverse signal with the divergence indicator of the CCI, RSI and MACD.
    Compare for example today
    Dax 1 min Euro
    TimeFrame 3 min
    16.31 o’ clock
    ThreeLiner, CCI, RSI, MACD with divergences in the same bar and ThreeLiner is at the top of the range.
    Could be a revert signal? Effective reverse signal? This would like to undergo a backtest….

    So let’s ask the question again,
    How do I “measure” the distance? As a code?

    Kind regards
    JohnScher

    • Nicolas • 06/23/2017 #

      You can measure a distance with a simple substraction 🙂

  11. JohnScher • 06/23/2017 #

    Hello, Nicolas. Thank you! But then

    I can’t! I m sorry.

    I have the same problem with simple subtraction in Moving Averages… for example, I would like to calculate the deviation from the average to the price, in points and percentages.
    Can you write me a little code so I can get a lead?

    I think I just have a board in front of my head…

  12. JohnScher • 06/23/2017 #

    ThreeLiner with middleand

  13. JohnScher • 06/23/2017 #

    //PRC_RevertSignal Three Line Break | indicator
    //22.06.2017
    //Nicolas @ http://www.prorealcode.com
    //Sharing ProRealTime knowledge
    //translated from Nanotrader

    if barindex=1 then //barindex
    if (close >= open) then
    xtrend = 1
    trend = xtrend
    xu = close
    xu1 = open
    xu2 = open
    xu3 = open
    CL = xu
    OP = xu1
    LL = OP
    HH = CL
    else
    xtrend = -1
    trend = xtrend
    xu = close
    xu1 = open
    xu2 = open
    xu3 = open
    CL = xu
    OP = xu1
    LL = CL
    HH = OP
    endif
    else //barindex continue
    if (xtrend = 1) then
    if (close > xu) then
    trend = xtrend
    xu3 = xu2
    xu2 = xu1
    xu1 = xu
    xu = close
    CL = xu
    OP = xu1
    LL = OP
    HH = CL
    elsif (close < xu3) then
    xtrend = -1
    trend = xtrend
    xu = close
    xu2 = xu1
    xu3 = xu1
    CL = xu
    OP = xu1
    LL = CL
    HH = OP
    else
    trend = xtrend
    CL = CL[1]
    OP = OP[1]
    LL = LL[1]
    HH = HH[1]
    endif
    else //xtrend 1
    if (close > xu3) then
    xtrend = 1
    trend = xtrend
    xu = close
    xu2 = xu1
    xu3 = xu1
    CL = xu
    OP = xu1
    LL = OP
    HH = CL
    elsif (close 0 then
    r=0
    g=200
    b=0
    else
    r=200
    g=0
    b=0
    endif

    //if trendtrend[1] then
    //BACKGROUNDCOLOR(200,200,200)
    //endif

    middle = (cl+xu3)/2

    RETURN CL coloured (r,g,b), xu3 coloured (r,g,b), middle coloured (0,0,255) style (dottedline,1)

  14. finplus • 06/23/2017 #

    bonjour, il y a un problème à la fin du code avec elsif (close 0 then … ne manque t il pas quelque chose? Merci.

  15. kj1988 • 06/23/2017 #

    Hello Nicolas, thank you for this useful indicator.
    Could you tell me how I can remove the grey “signal lines”? They really fill up the screen…

avatar
Register or

Likes

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

+11 more likes

Related users ' posts
riz001 thnk u
geroniman bonjour Nicolas, j ai un indicateur le Tiger . J aiemrai placer des fleches buy et sell dire...
Nicolas Merci de formuler les demandes sur le forum. ça n'est pas le bon endroit et hors sujet ici ! ;)
avatar
Anonymous Hi robertogozzi - thank you very much for sharing this strategy. I have performed various ...
robertogozzi Thank you samsampop.
Dotan Hello guys I really appreciate this coding effort but can I use this code for Mt5 Forex Trad...
ggolfet Thanks Nicolas, I imported the itf file and solved the problem.
Hasardeur Hallo Nicolas, i tried to code the multi period heat map in combination with the Ehler’s ...
Nicolas Please open a new topic with the code in forum.
redactv7 On my charts, the indicator doesnt go on the upper pannel, on prices, but under like an osci...
Nicolas apply in on the chart, look at this how-to video: https://www.prorealcode.com/blog/video-tut...
jonpt88 interesting code thanks!
LucioleLucide Clean view, thanks for sharing
dertopen hi where i can found the window for candle configuration?
paolosab69 Ciao! . I have seen the pictures that explain this metod but i don't understand when is mome...
winnie37 yes. "No ground breaking math here, but I am finding very useful and some algo based on it i...
Jan Wind Also interesting to know what does not work, which set up you use, saves me investigating ! ...
winnie37 i just set the proorder like this: buy when 50/100/200 phase >0 and sell when under 0, go...
Dari when I put the indicator does not put it on the price, sn in a new box like many indicators....
Nicolas by adding it on price instead. Use the wrench on the left upper side of your price chart.
Nicolas Sorry I do not provide assistance for Tradestation code.
surfeur Bonjour, Je suis pas expert en PRT donc si qq'un peut m'expliquer un peu le code ? Par...
Nicolas src c'est bien le customclose en effet. ATR, si aucune série de données n'est spécifié, il u...
Vinks_o_7
6 years ago
IV Mcm I've always wondered how to make the ADX faster, thank you!
Vinks_o_7 You welcome !
Vinks_o_7 Another variation that may be more accurate : we calculate the average of normalized DI's in...
nfulcher Please could someone explain how the following code is calculated:- iDI = TEMA[3](DI[DI2]...
oakenstream Jan, I find sometimes that the priceexit variable is never set. It seems to happen when the ...
Matt66612 I do not understand the first time I launch the backtest I got the same result as you. but ...
carlvan That's a great indicator and I especially the use of colors, more or less pronounced to indi...
diegofe_2000 CORDIAL SALUDO. CUANDO REALIZO UN PROGRAMA CON ESTE INDICADOR ME SALE EL SIGUIENTE LETRE...
ALE Hello do you want to explain to me in more detail what you have to do? Please replay here:...
coscar Ottimo lavoro. come sempre!
luxrun Nello studio di Sepiashvili viene descritto anche un altro indicatore, il Q-indicator, che è...
Jack86gv Ciao Nicolas, e possibile fare uno screener con questo codice ovvero vorrei sapere quando il...
Nicolas https://www.prorealcode.com/topic/screener-regressione-canale/
wharfdog Hi Nicolas, Fantastic work, I'm really grateful for this. I was wondering if it would be ...
sir_i Bonjour à tous, Je suis nouveau sur le forum et sur la plateforme, pourriez-vous me dire com...
Nicolas Il faut simplement l'appliquer sur le prix.
sir_i Merci pour la réponse, je ne suis pas familier avec l'application de cette procédure simple,...
Nicolas File and code are updated.
Zasinas2000 Hi allo I am not sure I am doing it correctly, but this adds to proreal as an indicator. ...
Trimicha Hi, when I copy the code, i get an error message that LinRegPeriod is not defined. Doe...
Kris75 Hi, This is great !! anyone ever developped a strategy about it ???
swapping hello Kris75, not that I know but it is possible to make a scenario ;)
digitation Hi swapping, Thanks for sharing this useful tool. I was wondering how difficult it would be...
avatar
unkown ;-) sfido chiunque a riuscirci!
avatar
unkown infatti basta leggere i post degli altri....
nicola papangelo ciao Francesco vorrei contattarti su facebook o in privato. Grazie
Janfi Hello, I'm new to ProRealCode and I do not understand the following summation[n](indicator...
Kaci It seems he's just checking that the previous MACD is < 0 for maximum one period ? I'...
Daniel Martin Hi do you know how have and entry after the second cross? There is crosses below 0 and cross...
AlexWoe89 Hi, thanks for the code. Do you have an idea, if you can also draw pre-market data on char...
Thomas Hello swapping. Very good idea. Can I use and modify the code? I would like to add a few mor...
Razz Hello swapping the indicator is very good! Can you tell me how I can add 2 lines in the dist...

Top