Fractal Standard Deviation Bands

v11
Fractal Standard Deviation Bands

This indicator calculates the simple moving average and standard deviation bands (Bollinger Bands) of fractals.

This indicator only works on PRTv11 onwards.

Set ‘p’ to the period you wish to use in the calculations.

Set ‘Deviations’ to the multiple of standard deviations away from the average you want the bands to be.

The type of fractal used in the calculation can be changed by adjusting the ‘BarsBefore’ and ‘Bars After’ settings. For example if BarsBefore = 2 and BarsAfter = 1 then the swing high fractals would have a high with two bars preceding it with lower highs and one bar after it with a lower high and the swing low fractals would have a low with two bars preceding it with higher lows and one bar after it with a higher low.

The ‘HighandLow’ setting allows you to either display one average line that is an average of the last ‘p’ high and low fractals and standard deviation bands calculated from this or to display two average lines – one for the average of only high fractals and the other the average of only low fractals. The upper band is then calculated off the high fractal average and the lower band off the low fractal average. If ‘HighandLow’ is selected you get the latter high and low separate calculations.

As always I advise downloading and importing 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. Vonasi • 04/20/2020 #

    There are actually two ways to calculate standard deviations and I seem to have used the version for calculations on populations rather than on data samples. There is only a tiny difference between them but if you want a modified code then you can find it here; https://www.prorealcode.com/topic/standard-deviation-indicators-minor-fix/

avatar
Register or

Likes

avatar avatar
Related users ' posts
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...
Nicolas change the lastline with: RETURN lastsig and check if lastsig change its value with the a...
nectouxg Hello Nicolas, I will try tonight when I get home, just one last question, I trade the DA...
FXtonio Bonjour, j'ai un problème avec le code, il me dit que ce n'est pas correct ligne 26-27-28: ...
abhay I am getting a shading between the lines, how can I avoid that. I just want to see lines as ...
Vonasi Delete the 'Color Zone' in the indicator settings window.
mscharstrom Hi @robertogozzi, I really love this indicator. However, I'd like to tinker with it to fit ...
Ahimsa Hi Roberto I cannot thank you enough for writing this code. It could help me more than you ...
Nicolas With PRT v11, you have to click on "price" at the upper left side of the price chart.
lokbuscas is it possible to make a screener with this conditions??? thank you
achel I believe so but I leave it to Nicolas to decide if it is possible
Nicolas Please open a new topic in the screeners forum
XXXXVII Excellent indicateur ! Déterminer une tendance est devenu un jeu d'enfants ! Félicitation......
gregoire bonjour nicolas j ai cherché partout sur le net et impossible de trouvé ce que je recherch...
Nicolas Merci de poster une demande dans le forum des indicateurs, ainsi on pourra le coder dans ce ...
Bhanu Pratap Dear Sir, Can I get MQL4 File for this indicator and last man standing . pls looking forward...
ISTJ_T Hi Nicolas Thanks a lot for the indicator. Trading off the TradingView and have issues wit...
Nicolas Just use ProRealTime and its powerful screener for stocks.
Nicolas Definition of CustomClose: https://www.prorealcode.com/documentation/customclose/ [2] means...
Bard Just wondered Nicolas, say you had set DEFPARAM CumulateOrders = True, is there anyway for t...
Bard Sorry pls ignore last image, try this - it actually has the Dev Stop indicator! https://www...
Gianluca Hello Nicolas, my prt become stuck when i load the indicator, is there any problem with it?
m-zeter Has anyone found a solution for Sofitech? Would it be possible to draw two lines? An upper l...
m-zeter Hm, i dont know exactly why, but I think, that the indicator needs lots of power. I need als...
Vonasi Forum discussion on these indicators can be found here: https://www.prorealcode.com/topic/av...
jennr29 Hi. Is it possible to convert this code to an mq4 file?
Nicolas Sorry but our website is dedicated to prorealtime programming. However, you can ask for priv...
Leo Does it opens pending orders?... maybe they were not trigger.
Mattzi Dont know, all i can see is that it opened an order yesterday in backtest but not live. Th...
Jean-Christophe Hello Leo, when running the strategy from 29/12/2015 to 31/08/2018 on ProRealTime Premium, I...
Simba Greetings from germany! :) Can you told me your EXIT-strategy for this, please? :) Would ...
anametsinwha Is it possible to change it to highs and lows rather than open and close?
apachx Hi. Please, describe the algorithm in words. I want to understand how it works, but for now...
Nicolas
6 years ago
Nicolas Merci, faire une demande dans le forum approprié.
Pere Thanks for this good indicator Nicolas. I would like to make the upper and lower limits mor...
Nicolas because fractals are known 2 bars later! that's why I used rectangle to plot them in the past.
juanj This gets me thinking about creating a strategy on the 5min timeframe that only takes trades...
GraHal I noted above does okay on DAX 10 min with even a reduction to 30 of the Stop Loss. I've s...
Kris75 Hi Grahal, What about making the same great work you did with the snipet on google doc but...
LancerX This catch my attention, tried to load in pro order but not coming through. What variables n...
macdopa Hello ALE. Is there any way to help us develop or program an algo-strategy for automatic tr...
Giuseppe68 Ciao, sono nuovo e poco esperto, volevo chiedere perchè il ProBacktest lo esegue correttamen...
Alai-n Merci pour ce travail...
patmaba merci Alai-n. C'est ma première participation sur prorealcode, merci pour à toi pour ton co...
longtrade Can this be converted to a screener?

Top