I've used the TTM Squeeze for quite some time. On intraday squeezes, Eric Purdy's code seems hit or miss. Anyone else have this issue? Include Extended Hours is unchecked. Not sure what the problem is. Code:
# Simpler Trading Squeeze watchlist column - Eric Purdy 2017
# Shared Link - http://tos.mx/5cpgKa
def sqz = !TTM_Squeeze().SqueezeAlert;
def direction = TTM_Squeeze()>TTM_Squeeze()[1];
def count = if sqz and !sqz[1] then 1 else count[1]+1;
def fired = if !sqz and sqz[1] then 1 else 0;
def firedCount = if fired then 1 else firedCount[1]+1;
def firedDirection = if fired then direction else firedDirection[1];
addLabel(yes, if sqz then “4HR:” + count else if sum(fired,5) then “Fired:” + firedCOunt + if firedDirection then ” Long” else ” Short” else “-”, if sqz then color.red else if sum(fired,5) and firedDirection then color.green else color.orange);
I left off the label portion of the code:
AddLabel(yes, if sqz then “1H Sqz:” + count else if Sum(fired, 5) then “Fired:” + firedCount + if firedDirection then ” Long” else ” Short” else “-”, if sqz then Color.RED else if Sum(fired, 5) and firedDirection then Color.GREEN else Color.ORANGE);
"Hit or miss" means it's about 80% at identifying Squeezes and Squeeze fires correctly on an Intraday timeframe (Hourly or 4 Hour). Daily, Weekly, Monthly work perfectly. I have been studying the issue for a while now and thought someone in the community might know why. The code from Purdy (Simpler Trading) has been floating around since 2017 so I think it is simply the intraday timeframe columns don't work well with it. Not sure.
# Simpler Trading Squeeze watchlist column - Eric Purdy 2017
# Shared Link - http://tos.mx/5cpgKa
def sqz = !TTM_Squeeze().SqueezeAlert;
def direction = TTM_Squeeze()>TTM_Squeeze()[1];
def count = if sqz and !sqz[1] then 1 else count[1]+1;
def fired = if !sqz and sqz[1] then 1 else 0;
def firedCount = if fired then 1 else firedCount[1]+1;
def firedDirection = if fired then direction else firedDirection[1];
addLabel(yes, if sqz then “4HR:” + count else if sum(fired,5) then “Fired:” + firedCOunt + if firedDirection then ” Long” else ” Short” else “-”, if sqz then color.red else if sum(fired,5) and firedDirection then color.green else color.orange);
I left off the label portion of the code:
AddLabel(yes, if sqz then “1H Sqz:” + count else if Sum(fired, 5) then “Fired:” + firedCount + if firedDirection then ” Long” else ” Short” else “-”, if sqz then Color.RED else if Sum(fired, 5) and firedDirection then Color.GREEN else Color.ORANGE);
"Hit or miss" means it's about 80% at identifying Squeezes and Squeeze fires correctly on an Intraday timeframe (Hourly or 4 Hour). Daily, Weekly, Monthly work perfectly. I have been studying the issue for a while now and thought someone in the community might know why. The code from Purdy (Simpler Trading) has been floating around since 2017 so I think it is simply the intraday timeframe columns don't work well with it. Not sure.