Average Penetration Indicator

v10.3
Average Penetration Indicator

Thank you to Markos Katsanos and his article in the June 2018 edition of Technical Analysis of Stocks and Commodities magazine for this idea.

This indicator counts the number of times that a candles high or low penetrates a simple moving average line. The period of average and look back period can be adjusted to suit the market being traded.

The author was using an average of 100 and a look back period of 3 months. He was also only counting the number of times that the close penetrates the average line but I decided that high and low penetration gave more interesting results. On the line chart the red line is number of times the low is below the average line during the look back period and the green line is the number of times the high is above the average line. So green above red = bullish market and red above green = bearish market.

It can also be seen that when the red and green are converging that a bull run or bear run may be coming to an end. I converted the indicator into a histogram to more easily show this. The histogram switches to bullish or bearish if the lines start converging but otherwise is bullish if green is above red and bearish if the opposite.

The author calls his version his ‘Stiffness’ filter. I will let your own imagination work out why!

Both codes are included here along with ITF files to import. I recommend importing over cut and paste 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 • 06/21/2018 #

    Forum discussion on these indicators can be found here: https://www.prorealcode.com/topic/average-penetration-filter/

  2. jennr29 • 06/21/2018 #

    Hi. Is it possible to convert this code to an mq4 file?

    • Nicolas • 06/21/2018 #

      Sorry but our website is dedicated to prorealtime programming. However, you can ask for private coding job here: https://www.prorealcode.com/trading-programming-services/

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar
Related users ' posts
Bougnat bonjour, ton screener semble intéressant .... merci pour le partage
guytrc Hi Nicolas - many thanks for your screener. One question if I may - how does condition 5 wor...
Nicolas In the last 20 periods, the SMA 10 periods was above the SMA 20 periods.
stratobast Good afternoon everyone. Thanks Doctrading for your work. I have an issue while using this ...
stratobast My bad guys. I understood what was the problem. The indicator uses highs and lows for the Re...
samwarduk Has anyone tried this on Bitcoin GBP1? The results look amazing but every time mine trie...
Kris75 Hi Gabri I launched a very simple strategy based on the 3 bars trailing stop that you cre...
TimDeCat Hi. Has anyone coded a version that you could alter it to say 5 bar trailing stop? ie make ...
Nicolas Please open a new topic in forums so we can code it there, thanks.
finplus bonjour, il y a un problème à la fin du code avec elsif (close 0 then ... ne manque t il pas...
kj1988 Hello Nicolas, thank you for this useful indicator. Could you tell me how I can remove the...
Nicolas remove lines 101 to 103
GraHal Yes sorry, I set up a link to a screen shot on my google drive and then I got locked into th...
gabri Here's the thread https://www.prorealcode.com/topic/multiframe-rsi-of-rsi/
Bernard13 Bonjour Nicolas, Pourriez-vous m'indiquer si cet indicateur fonctionne avec la V11 ? Le di...
jens_kittner This strategy was posted 2 years ago. I tested it today and it works perfect with the new da...
giustim Hallo I am not able to use it on daily TF What have I to change? Thanks a lot
pac.ros Ciao Francesco, ti scrivo per un aiuto a proposito della strategia di Hofmann che anch'io ho...
David Balance thanks for sharing this excellent indicator.  Here are some thoughts.  please ad...
imokdesign Hi Everybody, when I look at the strategy I felt the need to implement a Moneymanagement-Sy...
Inertia newlevel then multiplier=multiplier+1 oldlevel=newlevel newlevel=strategyprofit+startequi...
Inertia Hi Bjoern, I was playing around with your code this morning (EUR/USD 5'). Thank you to the...
supertiti Thanks you so much Lucassen
dreif123 hi, copied the above code, not working on 10.3 the system says "return can only be used at ...
LUCASSEN Hallo , i have no problem , and i have the same versie 10.3, maybe you can ask Nicolas, tha...
verdi55 Is there such a thing as a free lunch ?
maceng Thanks Nicolas for this great work! I would like to understand the math behind it in order t...
Nicolas Sorry I have no time to provide assistance for python programmers. Have a good day.
Maz Hi all, firstly happy to know that this is helping you. I look into updating it for PRT11 wh...
Nicolas just use 3 times a linear regression channel code you will find in the library.
leederbyshire Here's the link to alternative linear regression channel indicator Nicolas is referring to t...
Nicolas Thanks for contributing to the "ichimoku section" of the prorealtime code library Don't he...
sourberry Thank you , this is a great indicator works beautifully. Could you kindly modify to scr...
pp_playaflamenca Excuse me,... reading your code about spanB: [ SenkouSpanBFutureW = (Highest[SenkouSpanPerio...
Mansoor What does COI stand for?
MikeGC Hi Mansoor, COI is the abbreviation for the Coppock indicator.
nonetheless Anyone interested in this strategy please see forum topic: https://www.prorealcode.com/topic...
zilliq The reasons why I think it's time consuming and we loose time to try to do backests and Auto...
filiprb Hello Zilliq, You don't need a system to produce a walk forward test. You can easily create...
Philip Raphael It is incredible! Thanks for sharing, Doctrading!
Yannick Thanks for sharing. This strategy is flat for 11 years and winning afterwards. Don't you thi...
Doctrading Hello, As I usually say, strategies are exposed to be improved :) So yes, I think there mu...
Lior Green Doesn't work for me. Set values “compra” and “venta” to be shown as HISTOGRAM
Doctrading Hello, Someone asked me something (his results seemed to be different) on my email, but it ...
Glen Marquis Not your best..So what is your best strategy? :)
zilliq I think the "best"  method to backtest is  to do a simplier Walk forward backtest (and we ho...
volpiemanuele Hi, I have modified and optimized the strategy on FTSE 100 CASH Eur 1 on IG demo account. B...
TradSuz C'est étrange, je note donc à nouveau les deux horaires achat et vente =9H/17H, le iRSI de l...
TradSuz Merci à Doctrading pour cette trame de code super et qui marche sur d'autres supports aussi....
Bibi83 Bonsoir à tous Juste pour vous informer que j'ai enlever les conditions short et que cela ...

Top