Pivot point Supertrend

Pivot point Supertrend

The Pivot point Supertrend uses the high/low pivot points (same as fractals) to calculate the Supertrend levels and therefore create a trend following / trailing stoploss indicator. This code was converted from pinescript version following a request in the indicator forum section (author: Lonesome TheBlue, all credits to him).

There are many types of SuperTrend around. Recently I thought about a Supertrend based on Pivot Points then I wrote “Pivot Point SuperTrend” script. It looks it has better performance on keeping you in the trend more.

The idea is behind this script is finding pivot point , calculating average of them and like in supertrend creating higher/lower bands by ATR. As you can see in the algorithm the script gives weigth to past pivot points , this is done for smoothing it a bit.

As an option the script can show main center line and I realized that when you are in a position, this line can be used as early exit points. (maybe half of the position size).

While using Pivot Points , I added support resistance lines by using Pivot Point , as an option the script can show S/R lines.

And also it can show Pivot Points.

(author description).


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. Vivien René • 06/30/2020 #

    Bonjour nicolas, y a t il un moyen de te contacter pour discuter avec toi ? Je te remercie

    • Nicolas • 06/30/2020 #

      Le forum est fait pour ça, posez y vos questions. Pour l’assistance privé merci d’utiliser le formulaire de cette page: https://www.prorealcode.com/trading-programming-services/

  2. Lednora • 06/30/2020 #

    Bonjour Nicolas,
    y a t’ il une manipulation à faire pour afficher la courbe early exit? J’ai passé toute l’après-midi dessus je n’ai pas trouvé c’est dire mon niveau =). Tout se joue dans la ligne 96 c’est correct?

    • Nicolas • 06/30/2020 #

      Ces courbes sont déjà affichées sur le graphique, voire l’instruction RETURN en fin de code.

  3. Lednora • 06/30/2020 #

    Oui c’est pour cela que je ne comprends pas trop pourquoi elles ne s’affichent pas j’ai bien la courbe supertrend et le support/resistance mais pas le early exit bizarre….merci en tout cas je vais continuer de chercher =). Bonne journée

    • Nicolas • 06/30/2020 #

      Le paramètre showcl doit être en true (égal à 1 )

  4. Lednora • 06/30/2020 #

    Ah oui en effet c’est magique!j’étais resté bloqué sur la ligne 96^^. Merci beaucoup nicolas pour votre aide

  5. samsampop • 06/30/2020 #

    Merci Nicolas, c’est superb!

  6. maxlys • 06/30/2020 #

    Merci Nicolas pur ce travail. Comment écrire un screener qui nous ressortent d’une part les valeurs qui croise à la hausse la ligne du supertrend “principal” de ce code ? et la version à la baisse ? Merci

    • Nicolas • 06/30/2020 #

      Avec l’assistant de création pour les screeners c’est possible, le code est compatible.

  7. maxlys • 06/30/2020 #

    Merci Nicolas, avec l’assistant cela donne le code ci dessous. Est-ce correct ? De plus est-il possible de placer une alerte quand une valeur sort dans le screener pour éviter de passer son temps a attendre devant ? Car lors de mes essais je n’ai rien qui est ressorti.

    Voici le code :
    indicator1, ignored, ignored = CALL “PRC_Pivot Point Supertrend”[2, 3, 10, 0, 1, 0](close)
    c1 = (close CROSSES OVER indicator1)

    SCREENER[c1] ((close/DClose(1)-1)*100 AS “% Veille”)

    Désolé j’ai essayé avec ADD PRT CODE mais cela n’a pas fonctionné.

    • Nicolas • 06/30/2020 #

      Oui le code est correct et il fonctionne, j’ai de bons résultats sur la liste NASDAQ par exemple.

Register or


avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar

+6 more likes

Related users ' posts
JohnScher No, I haven't. You could certainly optimize for SL and TP, operate with trailingsstops an...
Faks T je viens de Backtester cette strategie depuis avril 2021 , celle ci fonctionne très bien à p...
JohnScher Postscript: It's running in the live right now. One position after the other is opened. ...
mikechan883 Thanks so much for your great help! May I ask you for further favor? Can you show me how to...
AndPar Buongiorno Nicolas, vorrei provare questo indicatore, ma quando lo inserisco in PRT mi vengo...
Nicolas Basta aggiungerlo al prezzo https://www.prorealcode.com/blog/video-tutorials/how-to-add-an-i...
adconsulting SCUSA . ECCO IL CODICE defparam cumulateorders = true // false is working well once ord...
wally Hola soy nuevo en el mudo robots. Alguien seria tan amable de poner el archivo itf.file ya q...
Darren Nash I found this works well on the DOW
KAMJKAZE thanks, really interesting!
2c95 thanks, why do U prefer average than lowest ? to close under average does'nt mean another...
Stenozar Hi Sever, how can I visualize the coloured areas?
Sever Hi Stenozar, You need to add the color zones yourself , just go to Add Color Zone To set ...
YvesRobert Hi smp, how should I configure this indicator because everything is at zero -> High, Clos...
smp Hi, this is an end of day pivots indicator, so you need to find the end of day pivot info; t...
YvesRobert Thank you smp.
smp I also have an End Of Day (EOD) cash pivot indicator for use on cash markets; this indicator...
cdc.andersson Hej! Jag försöker lära mig att koda PRT. Jag vill testa en strategi med RSI-värde, ATR-värde...
Swingforfortune Du kan väl jämföra om open > close (röd) eller open < close (grön)
Nicolas change the last line with: return v coloured(r,g,b) style(line,2), v+band coloured(168,168,1...
Paolo.B Thanks ... works as i wanted.
Kanamax Bonjour Nicolas, comme Paolo.B je souhaiterais utiliser cette indicateur au sein d'un code. ...
Boris Hi IVMcm, thanks for your amazing work. I have tested all of your indicators and use some of...
IV Mcm With pleasure and thanks!
ashiash how to use this indicator can i use tradingview platform
zilliq Thanks @Nicolas. I tried to use it as Trend in a proorder system, but don't know why, it doe...
Suzu Yuk He is right. MT and mavgMT are not defined and causing errors.....
Maxime Baudin Super travail !
Yanic c'est top j'adore
Maxime Baudin Merci l'ami, passe une bonne semaine
IV Mcm Merci de même ;)
Guibourse Hi, I'd like to increase the thickness of support and resistance lines. I do not think that ...
JJ Tec Hello. Thanks for the great contribution of the indicator. At the moment, I have modified i...
Khaled Hi Vonasi, I tried to embed your PP Fractals code in a Strategy and it seems to be a good fi...
IV Mcm I don't speak English and the translation is not clear. Do you have a different turn of ...
IV Mcm stonk ?
samsampop Thanks very much for sharing, look forward to testing this idea out.
Nicolas C'est dans ce sujet: https://www.prorealcode.com/topic/trendline-une-approche-du-trading/ M...
Pensera Bonjour Nicolas, comment est-il possible de backtester cet indicateur? cela fait une erreu...
Nicolas Oui bien sûr, il doit y avoir pas mal de sujets dans le forum à ce propos.
Noobywan (My apologies for unformatted code, the formatting only works in forum or library posts not ...
Noobywan Hi FXTT, no problem for requests (as long as no one requests me singing), just usually it’s ...
JC_Bywan Bug fix at line 38, should be: if changebarre or (opentime[1]=start) then (same as in ...