SuperTrend

SuperTrend

This indicator is the ProBuilder version of the SuperTrend Indicator. SuperTrend is available by default in the ProRealTime workstation but this ProBuilder version can be useful to create custom versions of the indicator.

If you want to use the standard SuperTrend indicator in Market Scan (ProScreener) or a Trading system, it’s easier to just use the ProBuilder function.

You can download the code directly at the bottom of the page.

If you prefer to add it manually to your workstation, here is the code.

For v10.3 and above:

For v10.2 and below:

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. verdi55 • 05/13/2016 #

    This indicator is exteremly slow. In a full DAX 1 min chart (~ 8 months), calculation takes more than 10 minutes, whereas the normal built-in supertrend is immediately there. What is the reason ? Too many if-then-else loops ? In a trading strategy, it would be almost impossible to use. 

    • Nicolas • 05/13/2016 #

      Exit and relaunch PRT should fix this behavior.

  2. verdi55 • 05/13/2016 #

    Thank you. After a restart, it is somewhat faster; however, it still takes about 3 minutes to load for the full DAX 1 min chart. Here is my own version of the supertrend that loads about 6-7 faster. Still, in a backtest, using this manual code for supertrend instead of the built-in version increases calculation time of the backtest by a factor of 20. So, this is not very advisable and suitable only for testing custom supertrends, not so much for parameter optimization. 
    ONCE Richtung = 1
    ONCE STlongalt = 0
    ONCE STshortalt = 1000000000000

    per = 10
    Faktor = 3

    indicator1 = medianprice

    indicator2 = averagetruerange[per] * Faktor

    STlong = indicator1 - indicator2

    STshort = indicator1 + indicator2

    If Richtung = 1 and STlong < STlongalt then
    STlong = STlongalt
    endif

    If Richtung = -1 and STshort > STshortalt then
    STshort = STshortalt
    endif

    If barindex > 2 and Richtung = 1 and close crosses under STlong then
    Richtung = -1
    endif

    If barindex > 2 and Richtung = -1 and close crosses over STshort then
    Richtung = 1
    endif

    STlongalt = STlong

    STshortalt = STshort

    If Richtung = 1 then
    ST = STlong
    endif

    If Richtung = -1 then
    ST = STshort
    endif

    Return ST coloured by (Richtung) as \"Supertrend\"
     

    • Nicolas • 05/13/2016 #

      Good! thanks for sharing your own code! Please do so with other ones if you think you can improve them 😉

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
mickey992 salut merci pour ton partage et ton travaille
patapouf Hi Vivien RenĂ© I just discovered your “Ordered trend-following stocks Screener”. Great work...
Nicolas Le paramĂštre showcl doit ĂȘtre en true (Ă©gal Ă  1 )
Lednora Ah oui en effet c’est magique!j’étais restĂ© bloquĂ© sur la ligne 96^^. Merci beaucoup nicolas...
samsampop Merci Nicolas, c'est superb!
Nicolas You should open a new topic to discuss about the strategy and its coding.
dvlukic Hello Nicolas, How could plot this indicator over the price series? Thanks Dave
Nicolas Just add it on the price series.
AlexF
1 year ago
Marcot18 Alex ti sei superato
AlexF Esagerato!
SL Hi, Fer666 Thank you for sharing. If I want to show daily ST on a 10_min intraday chart...
SL correction above... system had remove"not equal" signs Line 19 : change to if WeekNo "Not...
SL OK... I had figured out... need more than that. Thank you anyway.
kuroobi Parfait , merci beaucoup .
Juan Salas Hi FULVIO09, Nice piece of work. It seems to work very well. Does only work for INDEXES??...
Johann Hi @FULVI09, I understand the instructions however I'm not too sure how to determine the "p...
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 ...
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
verdi55 You can find me at www.FXautomate.com Ahh. So i got it ? 4 different supertrends without th...
juanj What? This has nothing to do with the website. The site is simply a service to help people ...
Nicolas Advertising is allowed,as long as people are helping others and if provided services are abo...
jebus89 Big thanks for sharing this :) Seems to work as expected, good stuff.
Nicolas Des nouvelles ?
Whisper74 Hi Nicolas, I have build supertrend in excel for research and database purposes, but I actua...
Nicolas Sorry, I can afford to make custom programming for everyone. If you want to have codes trans...
Nicolas Indeed, if you are not willing to loose, you will always win. Averaging down losers can carr...
David You're always safer going Long especially with averaging down on an index as the probability...
Oskar Bergvall  I noted Davids and Nicolas remarks. Could it be possible to make an indicator for contraria...
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.
Nicolas You need to have enough bars loaded on your chart for the indicator to compute completely th...
verdi55 Working with separately calculated supertrend indicators in backtests is usually somewhat pr...
Nicolas Very interesting Verdi. Would be a great addition to the library, your own modified version ...
Elsborgtrading Hi Triss. the File is in the post for download. There is nothing wrong with the code. Your e...
danhei Hi I am tryong to figure out how trist strategy works. I am new to pro real time. Can some...
Plop61 Hello,Thank you for sharing this beautiful strategy.Is it possible to indicate the code for ...
DANY I did it on demo account; it's too dangerous for mea and I can not resist psychologically  ....
demoz How can a demo account be dangerous? Did you have it run live (on a demo account for exampl...
DANY Yes, I mean that I tried on a demo account for 2 months and it had work fine, like the BackT...
MikeGC I don't know if you have used the variables a and b to optimise the parameters for the Super...
gianpiero75 I have not optimized, I multiplied the parameters for 6 (5,8), to use them on the 4  hoursTF...
bertrandpinoy bonjour Mike j utilise TrendChaser V2.0 et quand il prend position cela ne programme pas le ...
Nicolas Yes, colouring background by code is only available in the version 10.3. with the instructio...
ludo7769 Hello , J'ai la version 10.2 et ca ne marche pas, qu'est ce qui coince ?  Merci a vous 
eisi If i switch between different Markets, the Backgroundcolour will appear where it should not...
david-1984 We try to enter before that the market actually turn. We try to anticipate it. In which way ...
dwgfx David-1984 are you saying that you've already factored in the spread within the code?  If y...
david-1984 no, not in teh code... only in the backtest. The entry is only between 8/22 so the spread fo...
Doctrading
4 years ago
gianlox What markets did you feel ? Thanks..
wanjpt Doctrading, could you code an alert when the supertrend touches price for various timeframes...
JSTAR PRODUCTIONS Hi there DocTrading, I have run this Screener and it only seems to screem When trend line to...

Top