Zack_The_Lego

ZTLs Bar_Trend

Here is an adaptation of TTM_Trend I coded. It's all pretty self explanatory. Aqua = buy and red = sell.
There's only one setting to tweak and it's the look-back for highest and lowest.
I have found that this indicator gives signals at almost identical areas to the TTM_Trend but tend to actually be a little more efficient (earlier buy/sell signals), although I haven't thoroughly back-tested it.

Enjoy!
Please comment below if you have any questions.

开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?
study("ZTLs Bar_Trend", overlay=true)
//Adapted from TTM_Trend by Zack_the_Lego
lookback=input(6, defval=6, minval=1, title = "Bar Range")
barhigh= highest(lookback)
barlow = lowest(lookback)

avgprice= sma(close, 5)
half = (barhigh[1]-barlow[1])/2
range = barhigh[1]-half
barcolor = hl2 >= range ? aqua : red
barcolor(barcolor)