LonesomeTheBlue

Trend Following Bar

LonesomeTheBlue Wizard 已更新   
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.

Some details about my idea:


Options:

You can choose following MA types as source: EMA, SMA, RMA, WMA, VWMA
"Period to Check Trend" is the period to create MA channel. Bigger period cause more sensitivity.
"Trend Channel Rate %" is rate of price channel. Price channel created by using highest/lowest of last 300 bars. I did this to make the script works on all time frames correctly.
"Use Linear Regression" is used to get rid of noise. it may cause 1-2 bars latency.


All comments are welcome!.


Enjoy!
發布通知:
@midtownsk8rguy, one of the great pine programmers who made some improvements in the script was kind enough to share it with me. I re-publish the script with his modifications and improvements. Many thanks to @midtownsk8rguy
發布通知:
updated.

開源腳本

本著真正的TradingView精神,該腳本的作者將其開源發布,以便交易者可以理解和驗證它。為作者喝彩吧!您可以免費使用它,但在出版物中重複使用此代碼受網站規則的約束。 您可以收藏它以在圖表上使用。

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。

想在圖表上使用此腳本?