Could a custom color code column be made for the TTM Trend?


Category:
0
0

I wanted to know if it is possible to make a custom color coded watchlist for the TTM Trend. It would be similar to the TTM squeeze histogram. For example,  It would have different time frame column some being blue or red depending in the actual chart.

Marked as spam
Posted by (Questions: 1, Answers: 1)
Asked on March 11, 2018 9:29 pm
896 views
0
Private answer

When you learn how to apply thinkscript to various tools on the platform, you realize how easy it is to adjust the code to fit another tool. For instance we have this post in which a viewer wanted to make our TTM Alert code color the price bars: https://www.hahn-tech.com/ans/ttm-trend/

Here is the original code I offered as a solution:

input compBars = 6;
input paintBars = yes;
def upTrend = TTM_Trend(compBars, paintBars).TrendUp;
AssignPriceColor(if upTrend then Color.BLUE else Color.CURRENT);

Keep in mind the person making this request only wanted the blue color and not the red. So we have to adjust two things. First, we replace “AssignPriceColor” with “AssignBackgroundColor”. Then we replace the “Color.CURRENT” with “Color.RED”. Oh, one last thing. We need at least one plot. So we’ll change “def upTrend” to “plot upTrend”.

input compBars = 6;
input paintBars = yes;
plot upTrend = TTM_Trend(compBars, paintBars).TrendUp;
AssignBackgroundColor(if upTrend then Color.BLUE else Color.RED);

That’s it. Nothing to it.

Attachments:
Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on March 12, 2018 9:04 am
0
Private answer

Thank you. I’m curious is there a way to make an indicator that uses 4 different aggregation periods of the TTM trend and if they are all aligned it would paint the bar in the lower time frame for example purple and if they aren’t aligned white. It doesn’t matter if they’re bullish or bearish candlesticks as long they are aligned with the 4 different aggregation periods of TTM trend the candlestick gets painted purple.

Marked as spam
Posted by (Questions: 1, Answers: 1)
Answered on March 20, 2018 10:22 pm
0

Please post to the comment section of the previous answer, unless you are providing a new answer. Use the comment link immediately below the answer, just as I have done here.

No, it is not possible to combine multiple time frames into a single column of a watchlist. It is also not possible to apply multiple time frames using the TTM Trend because the source code is not available.

( at March 21, 2018 7:50 am)