Olivier Sedan’ Supertrend modification where the price is replaced by the average of last 52 weeks high/low.
(code from the Kevin Britains archive).
Interesting curve to find start of new trend.
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 44 45 46 47 48 49 50 51 52 |
rem ****** from Kevin archive ***** rem 2 variables rem aa=5 rem p=260 H1 = highest[p](high) L1 = lowest[p](low) Mid1 = ((H1 - L1)/2) + L1 atr=AverageTrueRange[p](close) ///////////////////////////////////////////// up=Mid1+aa*atr dn=Mid1-aa*atr once trend=1 if high > up[1] then trend=1 elsif low < dn[1] then trend=-1 endif if trend<0 and trend[1]>0 then flag=1 else flag=0 endif if trend>0 and trend[1]<0 then flagh=1 else flagh=0 endif if trend>0 and dn<dn[1] then dn=dn[1] endif if trend<0 and up>up[1] then up=up[1] endif if flag=1 then up=Mid1+aa*atr endif if flagh=1 then dn=Mid1-aa*atr endif if trend=1 then super=dn else super=up endif return super as "Daily-260-Average 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 :
Filename : download the ITF files
How to import ITF files into ProRealTime platform?
PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Thank you so much for your work here! It works fantastically!