Stop Reversal indicator

Stop Reversal indicator

The indicator is pretty similar to a Supertrend but based on fixed steps with pips/points instead of multiple of ATR. The arrows plotted on the price chart are the reversal of this “supertrend”.
I added an option to display or not the line that show the trend and when the price is crossing it (showLine).
The “nPips” setting is the size in points/pips between the current close and the “stop and reverse” trend line. You should adapt it for the instrument and timeframe displayed on your chart.


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?

New! PRC is also now on YouTube, subscribe to our channel for exclusive content and tutorials

  1. Geronima Ortiz • 212 days ago #

    Grazie Nicolas,
    è possibile creare un sistema di trading con questo indicatore?
    Ho provato ma non ci sono riuscita

  2. Geronima Ortiz • 212 days ago #

    Thanks, Nicolas
    is it possible to create a trading system with this indicator?
    I tried but I could not do it

    • Nicolas • 212 days ago #

      Yes of course, be sure to set ‘showline=1’.
      In your trading system, just test if the Close is crossing over or under the black line (variable name = myline). Just like what we do with a usual Supertrend for instance.

  3. Geronima Ortiz • 212 days ago #

    // Definizione dei parametri del codice
    DEFPARAM CumulateOrders = False // Posizioni cumulate disattivate

    // Condizioni per entrare su posizioni long
    indicator1 = CALL “PRC_StopReversal”[0.004, 1]
    c1 = (close >= indicator1)

    IF c1 THEN

    // Condizioni per uscire da posizioni long
    indicator2 = CALL “PRC_StopReversal”[0.004, 1]
    c2 = (close <= indicator2)

    IF c2 THEN

    I was helped by the simplified creation
    I get this result, but it only works long.
    I would like to get the system to look for the best NPIPS.
    Can you help me? thank you

    • Nicolas • 212 days ago #

      You can try to optimize values for instruments/timeframes, like it is explained in this video:

  4. Geronima Ortiz • 211 days ago #

    I’m sorry to come back here,
    I can not transform your indicator into a trading system.
    can you help me?
    I believed that the simplified creation was useful for those like me who do not know anything about language, but no!

    • Nicolas • 211 days ago #

      You should test crossing of close with the indicators line and not if it’s above or below

  5. Geronima Ortiz • 211 days ago #

    // Definizione dei parametri del codice
    DEFPARAM CumulateOrders = False // Posizioni cumulate disattivate

    // Condizioni per entrare su posizioni long
    indicator1 = CALL “PRC_StopReversal”[0.004, 1]
    c1 = (close CROSSES OVER indicator1)

    IF c1 THEN

    // Condizioni per uscire da posizioni long
    indicator2 = CALL “PRC_StopReversal”[0.004, 1]
    c2 = (close CROSSES UNDER indicator2)

    IF c2 THEN

    // Condizioni per entrare su posizioni short
    indicator3 = CALL “PRC_StopReversal”[0.004, 1]
    c3 = (close CROSSES UNDER indicator3)

    IF c3 THEN

    // Condizioni per uscire da posizioni short
    indicator4 = CALL “PRC_StopReversal”[0.004, 1]
    c4 = (close CROSSES OVER indicator4)

    IF c4 THEN

  6. Geronima Ortiz • 211 days ago #

    okay it seems to me that it works.
    I saw the video you reported to me, but I was not able to put NPIPS as a variable in order to optimize it.
    Can you help me please?

    • Nicolas • 211 days ago #

      If you follow the video, it’s easy as 1.2.3 🙂

  7. Geronima Ortiz • 211 days ago #

    I watched the video three times,
    but I can not put the npips parameter as a variable.
    I do not understand how to change the code to do it.
    If you can help me I would be happy, otherwise it does not matter.
    Thank you

    • Geronima Ortiz • 210 days ago #

      I think the video is for an old version of prorealtime, the images do not correspond at all to the current version.
      I abandoned the idea. Do not worry. That’s okay.
      Thank for all

  8. Nicolas • 210 days ago #

    indicator1 = CALL “PRC_StopReversal”[npips, 1]
    and define npips in the optimization window with its start, end and step of variable increment, that’s all 🙂

Register or


avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
osupero Buenisimo Sr Nicolas, seria posible que sólo marcara por encima o por debajo de una media mo...
1 month ago
JvdG Hi Nicolas, ld48 = 0.66 * ((ld16 - ld96) / (ld104 - ld96) - 0.5) + 0.67 * ld56 ld48 = Mi...
JvdG I meant of course: since ld56 is one of the constituents of ld48;
Nicolas You are right about ld56. Since this is a translation from another programming language, I d...
FULVIO09 Avec le file notrendstrategy.itf, vous pouvez exécuter un probacktest sur l'instrument fina...
kuroobi Parfait , merci beaucoup .
Juan Salas Hi FULVIO09, Nice piece of work. It seems to work very well. Does only work for INDEXES??...
FULVIO09 I try to answer even if, not being a statistic, it is not easy for me to do it, and even mor...
cfta Hi Fulvio, many thanks for sharing this clever indicator, much appreciated. As Pepsmile ment...
cfta Sorry adding the PRT to code didn't work in the above comment so I guess we will have to set...
4 months ago
Maxime Baudin Interesting, Thank you! :)
franck-david Bonjour Nicolas , actuellement je me forme grace a vos videos tres tres bien expliques mer...
Nicolas Merci. ça n'est pas le lieu pour poser ce genre de question :) Merci d'utiliser le forum Pro...
ottimo Dear Nicolas, could you recommend some of your indicators that I can use on the Daily time-f...
verygrubby Thanks for this Nicolas... so, can this indicator be used in a strategy? eg using the dots a...
Nicolas You can use it as signals or trend filters. Change the Last line with: Return pivots,pivot...
Vonasi Discussion on this indicator/filter can be found here:
Vonasi Forum discussion on these indicators can be found here:
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...
pableitor Hola Domenec, un indicador muy original y util que ciertamente añade mucha informacion a la ...
Domenec Hola Pableitor porque aqui lo que pretendo es programar un nuevo codigao mas ajustado para q...
Juanjo Hola Domenec. He visto en los videos que hablas continuamente de mercado de futuros con grá...
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...
odin here is my code c1 = ExponentialAverage[3](close) c2 = ExponentialAverage[5](close) c3 ...
juanj HI Odin Can you also kindly provide the code for the 'Short Term Trader Squezze' indicato...
odin this is the short term Trader squezze indicator. short term Trader in Trouble and squezze is...
Mary Hi Odin, thank you very much for the strategy. You said there is a screener you posted for t...
Tradingrob Is it possible to make this indicator also suitable for dax30, s&p500, mdax50, and even...
Pablo Jimenez Hello, Odin , thanks for this amazing strategy. One question , would it work for indexes cfd...
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
winnie37 Merci Nicolas. J'ai un bug d'affichage quand j'utilise ton indicateur. La bougie en cours ...
ullle73 nicolas, can you somehome make this to be in the background of the price chart?
Toto le Heros Thanks Nicolas. I read somewhere that in the calculation, we should round the value of the A...
Nicolas aADX = round(adx[10])