Multiple time frame TTM_Squeeze histogram


Category:
0
0

Hi Pete – I’m trying to develop code that will display a label on my TOS chart showing the color of the Squeeze Histogram for a timeframe I specify. The code is attempting to show the current Squeeze histogram color for the 60-min timeframe as a label on a lowertime chart such a 1-min chart. When I test the label it doesn’t work and I can’t see yet why not. Would you please take a look and help me figure out what’s missing?

 

input price = fundamentaltype.CLOSE;
input length = 20;
input nK = 1.5;
input nBB = 2.0;
input alertLine = 1.0;
input aggregationPeriod = aggregationPeriod.HOUR;
def sqzHist = (TTM_Squeeze(Fundamental(price, period = aggregationperiod), length, nK, nBB, alertLine).Histogram);
def BC = sqzHist > 0 and sqzHist > sqzHist[1];
def BB = sqzHist > 0 and sqzHist < sqzHist[1];
def BRR = sqzHist < 0 and sqzHist < sqzHist[1];
def BRY = sqzHist < 0 and sqzHist > sqzHist[1];
DefineGlobalColor (“BC”, Color.CYAN);
DefineGlobalColor (“BB”, Color.BLUE);
DefineGlobalColor (“BRR”, Color.RED);
DefineGlobalColor (“BRY”, Color.YELLOW);
DefineGlobalColor (“neutral”, Color.GRAY);

AddLabel(yes, “60”, if BC then GlobalColor(“BC”) else if BB then GlobalColor (“BB”) else if BRR then GlobalColor (“BRR”) else if BRY then GlobalColor (“BRY”) else GlobalColor (“neutral”)); 
 
 
Thank you,
Paul

Marked as spam
Posted by (Questions: 1, Answers: 0)
Asked on May 17, 2020 3:35 pm
428 views
0
Private answer

As you have discovered, it is not possible to create any version of the TTM_Squeeze histogram that references higher time frames. Not possible, as in we can't get there from here. The source code would be required in order to make this work. But this is a licensed study and the source code is not available.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on May 17, 2020 4:50 pm