Red Green Breakout Probability

v10.3
Red Green Breakout Probability

This indicator sets levels above and below the last closed candle and then calculates how many candles in the history managed to reach those levels. This is then displayed on the latest still forming candle as five lines below the previous low and five lines above the previous high with the percentage of candles that have reached this level in the past.

The results are calculated separately depending upon whether the previous candle was a red candle or a green candle.

The spacing of the lines can be altered using the step variable. So you might want to see how many red candles reached 5 pips, 10 pips etc above and below the previous high and low. Alternatively the spacing (and historical calculations) can be based on a percentage of the closing price. If ‘Percentage’ is set to anything other than zero then percentage spaced lines are used otherwise if it is set to zero the spacing is based on the ‘Step’ value.

It is also possible to set the start date for calculating the history. If the date is set to zero then it analyses all of the candles on the chart.

So for example if yesterday was a green candle we might see that history tells us that the high has been hit or passed 75% of the time after a green candle but the low only 33% of the time. We can then also see that the high plus 0.5% has been hit 50% of the time and the low minus 0.5% only 21% of the time and so on.

Hopefully this indicator can help with understanding the probability of a breakout or assist in setting stop loss levels based on where a price is most likely or least likely to go.

I advise downloading the ITF file and importing it to get full functionality.

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. juanj • 08/12/2019 #

    A nice enhancement for this would be if you could calculate the probability of the monthly close graphed on a weekly TF (or Weekly close graphed on a Daily TF) but update the probability after each bar close based on the level of the close respective to the previous Months close (Weekly TF) or Weeks Close (Daily TF). This means that statistically speaking the accuracy of the probability should increase as the Week (Daily TF) or Month (Weekly TF) progresses.

  2. Maxime Baudin • 08/12/2019 #

    Good job! 🙂

  3. Vonasi • 08/12/2019 #

    juanj – yes there are plenty of possibilities and if I can find some time then I will work on them but I’m very busy with other stuff right now!

  4. Vonasi • 08/12/2019 #

    Thanks for the compliments Maxime Baudin.

    • JJ Tec • 08/12/2019 #

      Muy interesante ¡¡¡… gracias X el aporte.

  5. HStrader • 08/12/2019 #

    Thank you for your nice indicator

  6. Bard • 08/12/2019 #

    Hi Vonasi, thanks for this great idea. Obviously the indicator works for everyone commenting here but when I added it to my library and added it to a €/$ chart it just leaves a blank space? Have PRT changed the import? Normally it searches my Downloads folder but this time I had to drag and drop the itf file? Tried different perameters and left the start date as 0. Also tried 20200101 as well. I have 1000 units on the chart.
    Any ideas? Cheers!

  7. Vonasi • 08/12/2019 #

    You are applying it to the price chart? As far as I am aware nothing has changed with the import procedure. Dragging and dropping does not sound right to me. I will test.

  8. Vonasi • 08/12/2019 #

    I just imported and applied the indicator with no issues at all. Must be operator error at your end or something to do with that weird computer you use! 🙂

  9. Bard • 08/12/2019 #

    Yeah it’s weird, never seen the drag and drop before? https://www.dropbox.com/s/y1n9hlhsfyn7gk0/PRTdraganddrop.png?dl=0

    Applied it to the Price chart and all good now thanks.

    God damn Macbooks! Already, after only two years, had to replace all the USB-C sockets this week…

  10. Vonasi • 08/12/2019 #

    I can see it on the chart in your image! Zoom in on the last candle.

  11. Bard • 08/12/2019 #

    This is really a fascinating indicator Vonasi! Particularly when it gives probabilities that are sometimes contrary to how the previous history of candles appears. I was wondering is there an easy way of adding a formula to the code that would show standard deviations as well as steps (ticks, pips) and percentages? Great work.

    How would you automate it with the simplified creation tool if you wanted to go long only if the Red/Green Prob is over 80% and ditto for shorts?

  12. Lotech123 • 08/12/2019 #

    I am a bit late finding this interesting tool, but have found it useful already.
    Please can anyone tell me how to increase the font size for the displayed data, probably to at least twice its present size as it is quite small on my screens. Thank you

  13. Vonasi • 08/12/2019 #

    In the all the DRAWTEXT lines of code change the 10 to a larger number.

  14. Lotech123 • 08/12/2019 #

    Vonasi. Thank you for a very prompt response.

  15. Lotech123 • 08/12/2019 #

    Following on from your earlier advice, I changed the ‘drawtext’ command to various sizes before settling with 20, instead of 10 (default) and it it now easily read.
    I am running the utility on 3 FTSE charts: Volume (1000), 2H and Daily, so next week should be very interesting after the turmoil of the coronavirus panic.

  16. Maxime Csls • 08/12/2019 #

    Hello Vonasi, thank you for your work. Is it possible to draw this lines on past candles other than the [1] ? I would like to analyse each time this appears :
    c1 = open > high[1] and close[1] > open [1]
    Thank you for your help
    Cheers

    • Vonasi • 08/12/2019 #

      If you are on v11 then you can change the DRAWSEGMENT instructions to DRAWRAY. You will need to modify the second BARINDEX value to BARINDEX+n where n is how far into the future you want to draw the lines.

  17. sycomore • 08/12/2019 #

    Ça ne fonctionne sur aucune valeur, je dois être trop con…

    • Nicolas • 08/12/2019 #

      il faut appliquer l’indicateur sur le prix.

  18. AntoGH • 08/12/2019 #

    Je crains de ne pas comprendre… Cela indique la probabilité de la prochaine bougie ou donne la probabilité de la bougie actuelle ? (je n’ai pas les cours en direct sur prorealtime est ce que cela marche différemment ?)
    Did it show the probability of the next candle or the probability of the current (last fully formed)candle ?

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
Adolfo Onrubia Ups! Sorry. Variable "S" is to set an specific Spread if needed. Could be "0", or the distan...
GraHal Hi Adolfo, big thank you for your code, but I am a bit confused. Spread is the difference b...
Meta Signals Pro Hi, For me there is a mistake here L32 maxriesgo = round(equity*riesgo) => round(equ...
Dave Hi, I'm new to coding and have been trying to modify the code a little to backtest an idea I...
Nicolas Better use the forums for coding assistance please. You'll get more results there for sure.
Dave Apologies - only just learning the site layout. Maybe you could delete the post?
Nicolas You can try this code for buy and hold curve line: capital = 10000 mylot = 2 i1 = capi...
soukenson Bonjour Nicolas, Je ne comprends pas où ajouter le code que tu as a donné dans le code initi...
Nicolas Tu veux parler du code pour comparer avec le "buy and hold" ? Si oui, tu as tout ce qu'il fa...
Nicolas FR/Bonjour Steftonio, non pas de frais overnight calculé sur la durée du backtest, c'est une...
avatar
Anonymous Any reason why in 2016 this system is doing very bad respect the previous years?
Nicolas "very bad" is relative to the account equity. I do not forward test this strategy since I po...
EAxelsson Hi, shouldn´t it be or instead of and? if FiftyTwoWeekHigh = FiftyTwoWeekHigh[1] OR FiftyTwo...
qigley Line 4 has a redundant term "Close>EMA2." is not necessary as EMA2 will always be less t...
Mike.44 Thanks It a good job !
Wisko But the BUY-trigger is below the High of the first two 15min-candels?
Nicolas That's right, because what we want is to enter the market quickly and not wait for the next ...
Wisko Then I don't understand the backtest data. Yesterday (28.9.) range was from ~ 4410,5 - 4450,...

Top