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?

PRC is also 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 avatar avatar
Related users ' posts
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 ...
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 ...
NoName Thank you very much for this fascinating trading system. It is still proving to be extremely...
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 ...
eisi If i switch between different Markets, the Backgroundcolour will appear where it should not...
datageek How can I get alerts on colour change?
NAMBO40 Hello, I would like to add a 25 period SMA moving average. It's possible?
avatar
Anonymous 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...
avatar
Anonymous no, not in teh code... only in the backtest. The entry is only between 8/22 so the spread fo...
Doctrading
8 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