While analysing a chart, one of the biggest problem is to see if there is trend or not. While thinking about it, I found the idea to analyse moving averages in channel and their momentum according to channel width.
How it Works?
On each bar it creates a channel by highest/lowest point of a MA. highest point is upper line and lowest point is lower line of the MA channel,
It gets highest and lowest point of last 300 bars, (say Price Channel )
If the width of MA channel is greater than certain rate of price channel then it decides there is trend
After it decided there is trend, it calculates the rate between channel and MA. Bigger result means stronger trend.
According to rate of MA channel and the price channel , bar color becomes lighter/darker. so when you look at the bar color you can see the trend strength.
(description from the original author LonesomeTheBlue, all credits go to him). Indicator converted from pinescript with some adaptation to make it works with ProRealTime.
Similar indicator as the other published here: Trend Following Moving Averages(but with heatmap below the chart this time).
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 53 54 55 56 57 58 59 60 61 |
//PRC_Trend Following Bar | indicator //20.04.2020 //Nicolas @ www.prorealcode.com //Sharing ProRealTime knowledge // --- settings rateinp = 1 //Trend Channel Rate % minval = 0.1, step = 0.1 periodTC = 300 //Trend Channel Period matype = 1 //ma type 0=sma, 1-ema, etc. prd = 20 //Period to Check Trend ulinreg = 1 // 1=true, Use Linear Regression linprd = 10 //Linear Regression Period, minval = 2 // --- end of settings rate = rateinp / 100 pricerange = highest[periodTC](close) - lowest[periodTC](close) chan = pricerange * rate p = 5 while p<100 do //trend masrc = average[p,matype](close) if ulinreg then ma = LinearRegression[linprd](masrc) else ma = masrc endif hh = highest[prd](ma) ll = lowest[prd](ma) diff = abs(hh-ll) if diff>chan then if ma>ll+chan then trend=1 elsif ma<hh-chan then trend=-1 else trend=0 endif else trend=0 endif ret = trend*diff/chan alpha = min(255,(0+abs(ret*10))) if ret<0 then r=255 g=0 else r=0 g=255 endif drawtext("■",barindex,p,dialog,bold,20) coloured(r,g,0,alpha) p=p+5 wend return 0 coloured(100,100,100,0), 100 coloured(100,100,100,0) |
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
Thank you very much Nicolas! 🙂
Awesome. Thanks Nicolas.
Salut nicolas j’aimerais savoir tes résulats grace a cettte methode
hello Nicolas, sorry for off-topic question, but can you tell me what kind of indicator you use to get this watermark with the name of the product on your screen? It would help me a lot with my multi-screen and products set up. Thank you.
Not an indicator but an option in PRT v11.
It dose not work, I get a strap instead of candels???????????????????????????????????????????
That indicator is the one below the chart. The indicator to put on the price chart is this one: https://www.prorealcode.com/prorealtime-indicators/trend-following-moving-averages/