OPEN-SOURCE SCRIPT
Bobs Gold and Red Lines

This indicator plots a normal 9 EMA corresponding to the current time frame, ie Bob's 1 min 9 ema Gold Line.
It also plots a 5 min 21 SMA (Bob's Red Line) on the 1 min chart. It actually plots the 5 min redline on timeframes other than the 1 min chart as well.
In other words, this will plot the actual 5 min 21 SMA whether you are on the 1 min, 5 min, or other time frames. I created this instead of having to use the workaround of a 105 SMA on the 1 min chart or having a separate 5 min chart open when trading Bob's 1 min strategies.
On the 1 min chart you will notice the red line typically makes a stairstep effect, that is because it is a 5 min SMA being plotted on the 1 min chart. The right hand end point should still perfectly match the current 5 min SMA price. I have been testing / using this script for several months.
I have noticed that the ema and sma on my tradovate charts do not perfectly match my tradingview charts, even just using the normal tradingview moving averages, however from what I can see on Bob's charts Tradingview seems to be close to the same as on Bob's Ninja charts. I have not started using Ninja yet, but plan to soon then I can compare apples to apples.
I made a few changes in names, etc before I published this script today, so hopefully I didn't inadvertently break anything. So let me know if you find anything off or not working as expected.
It also plots a 5 min 21 SMA (Bob's Red Line) on the 1 min chart. It actually plots the 5 min redline on timeframes other than the 1 min chart as well.
In other words, this will plot the actual 5 min 21 SMA whether you are on the 1 min, 5 min, or other time frames. I created this instead of having to use the workaround of a 105 SMA on the 1 min chart or having a separate 5 min chart open when trading Bob's 1 min strategies.
On the 1 min chart you will notice the red line typically makes a stairstep effect, that is because it is a 5 min SMA being plotted on the 1 min chart. The right hand end point should still perfectly match the current 5 min SMA price. I have been testing / using this script for several months.
I have noticed that the ema and sma on my tradovate charts do not perfectly match my tradingview charts, even just using the normal tradingview moving averages, however from what I can see on Bob's charts Tradingview seems to be close to the same as on Bob's Ninja charts. I have not started using Ninja yet, but plan to soon then I can compare apples to apples.
I made a few changes in names, etc before I published this script today, so hopefully I didn't inadvertently break anything. So let me know if you find anything off or not working as expected.
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。