I'm using this regular TTM Squeeze code in a watchlist that tell me when the TTM Squeeze has fired, and also what direction it fired in. I want to know if the code can be modified to capture the New Squeeze Pro Indicator which has three different squeezes, a Low Compression Squeeze, Mid Compression Squeeze and a High Compression Squeeze. Any help you can provide woule be greatly appreciated. Thanks
Ruby:
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 “Squeeze:” + 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);
Attachments
Last edited by a moderator: