Need MTF for MACD Bands Squeezes

jasong127

New member
Hello! This is pulled from the B4 indicator where he has a Squeeze dot print on the lower indicator. The coding of this particular style squeeze is new to me and I don't know how to convert this into a MTF. I make my entries on a 1m chart, but right now I have the 3m, 5m, and 10m up and manually looking at each chart just for the squeeze dot.

Thanks in advance!

Any help explaining the use of the "reference" would also be appreciated. Tried reading the TOS documentation and that just confused me more. :)

Code:
declare lower;

input MACDBB_FastLength = 12;
input MACDBB_SlowLength = 26;
input MACDBB_BandLength = 15;
#input MACDBB_NumDev = 1.0;

def MACDBB_Data = MACD(fastLength = MACDBB_FastLength, slowLength = MACDBB_SlowLength, MACDLength = 9);

def MACDBB_Upper = reference BollingerBands(price = MACDBB_Data, length = MACDBB_BandLength,
Num_Dev_Dn = -1, Num_Dev_Up = 1).UpperBand;

def MACDBB_Lower = reference BollingerBands(price = MACDBB_Data, length = MACDBB_BandLength,
Num_Dev_Dn = -1, Num_Dev_Up = 1).Lowerband;

### Squeeze

input SQZ_SqueezeLength = 30;

def SQZ_Bandwidth = MACDBB_Upper - MACDBB_Lower;
def SQZ_Squeeze_Low = Lowest(SQZ_Bandwidth, SQZ_SqueezeLength);
def SQZ_Squeeze = SQZ_Bandwidth == SQZ_Squeeze_Low;

plot SQZ_Dot = if SQZ_Squeeze then 0 else Double.NaN;
SQZ_Dot.SetPaintingStrategy(PaintingStrategy.POINTS);
SQZ_Dot.SetLineWeight(4);
SQZ_Dot.SetDefaultColor(Color.WHITE);
SQZ_Dot.HideTitle();
SQZ_Dot.HideBubble();
 
Last edited by a moderator:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
315 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top