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
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...
Gordon101 Hi when I added your Guppy indicator to my chart it went below the chart beside the oscilla...
Nicolas Add it on the price by using the wrench located on the left upper side of your price chart.
Gordon101 Thanks Nicolas, worked a treat.
Geronima Ortiz I watched the video three times, but I can not put the npips parameter as a variable. I do...
Geronima Ortiz I think the video is for an old version of prorealtime, the images do not correspond at all ...
Nicolas indicator1 = CALL “PRC_StopReversal”[npips, 1] and define npips in the optimization window ...
dertopen HI Wwhy you said avoiding bear market? Don't you think that we can use this code for short...
maurizio dove si trova lo screener?
macdopa Thanks...
Caribeengeek Bonjour j’avais vu que vous proposiez d’écrire des codes pour ceux qui s’y connaisse pas Mai...
Caribeengeek Les devises unité
Nicolas Merci d'utiliser le forum pour les demandes de programmation personnalisée
Actabi Thank you ! Have you realised your "next step" ?
Jessar guten Tag, gibt es bereits die Aktualisierte Datei?
Per Inge Gents - An update - I have been studying various trading approaches, as this one that is bas...
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...
Gianluca thank you very nice screener
styrke Hello Nicolas, Nice screener, I appreciate the way you always try to condense at maximum th...
Nicolas There's no particular reason. RSI is widely use with its default period and results seems re...
Vonasi I noticed a couple of typo errors in the code. The list of variables lines 4 to 11 should be...
Genotik Thank you for your important contribution this week which is much appreciated! Happy New Yea...
Vonasi No problem. I hope they are useful to someone. Happy and hopefully prosperous New Year to y...
DarioMazza Hi Vonasi, i have a question for you, the comand "pricetype" where did you found it in the ...
Vonasi PriceType is just a variable that I use. The value decides what type of price is used in the...
Vonasi I noticed a couple of typo errors in the code. The list of variables lines 4 to 11 should be...
bazilou pouvez expliquer donchian bias merci
WarningTrading Comment peut on la comparer ? comme ceci ? cela ne me donne plus le message d'erreur manque...
sally31120 Bonjour, je n'arrive pas à créer ce screener close > supertrend extended2[1] la réponse...
Nicolas voir ce sujet pour un screener basé sur Supertrend Extended: https://www.prorealcode.com/top...
Nicolas https://www.prorealcode.com/topic/ayuda-screener-indicador-perfect-trend-line/#post-51291
Manu L. Bonjour Nicolas, suite a une de mes precedentes demande dans le forum indicateur, j'ai touv...
AntoGH C'est selon moi le meilleur indicateur, que j'ai vu, si vous trouvez mieux dîtes moi car dif...
rafadonl2 is not taken into account in the procedure. It considers only if it is a doji or when candle...
Guibourse Okay thanks, just a question : how do you plot your two lines in the same window as price ? ...
rafadonl2 sorry, I don't understand your question. Indicator draws Heikin Ashi candle, not price cand...
Nicolas Your PRT version is inferior to 10.3? So the code in its default state is not compatible. A ...
Mbulelo Hi Nicolas Hope all is well your side, do you have a specific strategy for the MFT Swing ...
Nicolas No I don't, try to make it on your own, or ask in forums (follow the posting rules please).
JR1976 Dear Mike , your screener seem interest and simple... Do you try to envelope an automat...
Player Hi Mike, What is the name of the indicator just under the MMA ? Thanks Regards Marc
Igor Hi Mike, What is the name of the indicator just under the MMA ? Thanks Regards
rejo007 hello david, i'll try it could you tell me wich strategy do you use in real? thanks
David Somogyi Hello, I have a couple of DAX strategies of breakout and mean reversion. I'll try to post...
Roberto Blázquez Hi David, I just saw your strategy and it's good!!! I'm going to try it from today in real a...
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.

Top