This supertrend does not use a multiple of current average true range (ATR) as the distance to median prices. Instead, the distance of the supertrend line to median prices is only a fraction of the current price (close * factor).
In sideward phases, when average prices do not change, this supertrend will stay constant. The “normal” supertrend (using ATR) will reduce its distance to the median price in sideward phases, when volatility and ATR decrease.
This simplified supertrend can give better results in certain cases, for example in long-term charts, when prices show highly different values falling in a very broad range (e.g. DAX prices between 4000 and 13500).
The indicator behaves more like a traditional trailing stop, because volatility is not considered. The risk of curve-fitting and over-optimization is reduced, because only one adaptable parameter (“factor”) is used.
As always, it should be tried out in every single instance by optimizing a simple trading system whether this indicator or the “normal” supertrend work better.
The indicator should be added to the price window by selecting “settings price – add indicator”. You can colour the indicator or change line thickness yourself using the box “settings simplified supertrend”.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
ONCE direction = 1 ONCE STlongold = 0 ONCE STshortold = 1000000000000 factor = 0.005 indicator1 = medianprice indicator3 = close indicator2 = indicator3 * factor STlong = indicator1 - indicator2 STshort = indicator1 + indicator2 If direction = 1 and STlong < STlongold then STlong = STlongold endif If direction = -1 and STshort > STshortold then STshort = STshortold endif If direction = 1 and indicator3 < STlong then direction = -1 endif If direction = -1 and indicator3 > STshort then direction = 1 endif STlongold = STlong STshortold = STshort If direction = 1 then ST = STlong else ST = STshort endif Return ST as "simplified Supertrend" |
Share this
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 :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Big thanks for sharing this 🙂 Seems to work as expected, good stuff.
Top visually, and very efficient. I would like to integrate it as a value in a small algo in addition to the visual side of the code , Is there any indication helping to do so ? best regards