Trend Following Bar

2294 lượt xem
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:


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!.

Gỡ bỏ khỏi Script Ưa thích Thêm vào Script Ưa thích
If you find my works useful, please consider a donation
BTC: 19qDW9AShZhBZsGuXcgRzam5Fbpc3EU8EV
ETH: 0x39c8552371b9b7f4e324197af460ba8bc8e18ef9

Bình luận

My dear friend. I just wanted to thank you for such a simple indicator. The beauty of it is the fact that you can make decisions very fast without haven to interpret tons of lines and info. Keep your ideas coming my friend and that abundance continues to come your way. cheers
+2 Phản hồi
@NetoDav, Thank you!
Phản hồi
I like this so much so much, love it
+2 Phản hồi
A wonderful work, thank you as always!
+2 Phản hồi
LonesomeTheBlue peterson4545
@peterson4545, Thank you
Phản hồi
can you explain how to use this indicator a little more
+2 Phản hồi
LonesomeTheBlue ErdincZeytin
@ErdincZeytin, I think you got the idea behind this script. it compares the MA channel with Price channel and if MA channel has more width than it knows there is trend. with this idea, it checks 19 Moving averages (5, 10, 15, 20,..., 100) and for each one it decides it's in the channel or exceeded. if it's in the channel there is no trend. There is generally no definitive transition between trends, but softer transitions usually. Lower part (5, 10, 15, ...50 MAs) of the Bar gives reaction on small moves and we may think that's Correction but color of higher of part the Bar usually changes when there is trend reversal.
when there is uptrend or downtrend we must know the strength of the trend. to see trend strength the script makes the colors lighter or darker. lighter color means strong trend. I hope all clear now :)
Phản hồi
This is really cool.
Thank You!
+1 Phản hồi
I love this so much! I finally can remove the multiple EMA on my main layer
May I ask how to add a alert on this method?
such as the green light/red light is switch on for:
plot(05, color = getcol(gettrend(5)), style = plot.style_columns, histbase = 00)
+1 Phản hồi
@traderaaa, for example for for 5 period MA:
ma5 = gettrend(5)
alertcondition(ma5 > 0, title='MA 5 Up', message='MA 5 up')
alertcondition(ma5 < 0, title='MA 5 down', message='MA 5 down')
alertcondition(ma5 == 0, title='MA 5 no trend', message='MA 5 no trend')
Phản hồi
Trang chủ Bộ lọc cổ phiếu Bộ lọc Forex Bộ lọc Tiền điện tử Lịch kinh tế Cách thức hoạt động Tính năng Biểu đồ Trả phí Giới thiệu bạn Quy tắc Áp dụng Trung tâm Trợ giúp Giải pháp cho Website & Nhà môi giới Widget Giải pháp biểu đồ Thư viện Biểu đồ Lightweight Blog & Tin tức Twitter
Hồ sơ Tùy chỉnh Hồ sơ Tài khoản và Thanh toán Giới thiệu bạn Ticket Hỗ trợ của tôi Trung tâm Trợ giúp Các ý tưởng đã đăng Người theo dõi Đang theo dõi Tin nhắn riêng Trò chuyện Đăng xuất