Bill Williams Green, Squat, Fade, Fake Bars and Zone Bars for ThinkorSwim

You have to set your Time frames correctly for it to plot! What is the time frame that you are viewing?
Start with the time frame for the chart , then add the next higher time frame and so forth
Once I set 5 min chart plot, seems like works great! I had Daily and Weekly charts before that.

So if I want to switch to Daily I just need to adjust these?
input agg1 = AggregationPeriod.FIVE_MIN;
input agg2 = AggregationPeriod.THIRTY_MIN;
input agg3 = AggregationPeriod.HOUR;
 
Last edited by a moderator:
Once I set 5 min chart plot, seems like works great! I had Daily and Weekly charts before that.

So if I want to switch to Daily I just need to adjust these?
input agg1 = AggregationPeriod.FIVE_MIN;
input agg2 = AggregationPeriod.THIRTY_MIN;
input agg3 = AggregationPeriod.HOUR;
That is correct, Just change the Aggregation Periods , they cannot be less than the displayed chart
 
Last edited by a moderator:
Code:
#From the book New Trading Dimensions by Bill Willams, PhD
#Coded by Henry Z Kaczmarczyk 01/2021
#Added Multiple Time Frame
#Added "AssignPriceColor"  apc input "to turn off set number to 0 or 4"
#ZoneBars are lines 1 thru 3 "Points"
#Green , Squat, Fade, Fake bars are lines 5 thru 7 "Squares"
#Lower time frames are on the bottom ,higher time frames are on top
Declare Lower;
DefineGlobalColor("GreenZone",Color.Green);
DefineGlobalColor("RedZone",Color.Red);
DefineGlobalColor("Neutral",Color.Blue);
DefineGlobalColor("Greenbar", Color.Green);
DefineGlobalColor("Squatbar", Color.Blue);
DefineGlobalColor("Fadebar", Color.Red);
DefineGlobalColor("Fakebar", Color.Orange);
DefineGlobalColor("Zero", Color.Gray);
input agg1 = AggregationPeriod.FIVE_MIN;
input agg2 = AggregationPeriod.THIRTY_MIN;
input agg3 = AggregationPeriod.HOUR;
Input apc = 5;
Input DotSize = 3;
Def Price1 = HL2(Period = agg1);
Def Price2 = HL2(Period = agg2);
Def Price3 = HL2(Period = agg3);
Def Vol1 = Volume(Period = agg1);
Def Vol2 = Volume(Period = agg2);
Def Vol3 = Volume(Period = agg3);
Def H1 = High(Period = agg1);
Def H2 = High(Period = agg2);
Def H3 = High(Period = agg3);
Def L1 = Low(Period = agg1);
Def L2 = Low(Period = agg2);
Def L3 = Low(Period = agg3);
def AO1 = Average(Price1,5) - Average(Price1,34);
def AO2 = Average(Price2,5) - Average(Price2,34);
def AO3 = Average(Price3,5) - Average(Price3,34);
def AC1 = AO1 - Average(AO1,5);
def AC2 = AO2 - Average(AO2,5);
def AC3 = AO3 - Average(AO3,5);
def GZone1 = if AO1 > AO1[1] and AC1 > AC1[1] then 1 else 0;
def RZone1 = if AO1 < AO1[1] and AC1 < AC1[1] then 1 else 0;
def GZone2 = if AO2 > AO2[1] and AC2 > AC2[1] then 1 else 0;
def RZone2 = if AO2 < AO2[1] and AC2 < AC2[1] then 1 else 0;
def GZone3 = if AO3 > AO3[1] and AC3 > AC3[1] then 1 else 0;
def RZone3 = if AO3 < AO3[1] and AC3 < AC3[1] then 1 else 0;
def mfiA = if Vol1 > 0 then (H1 – L1) / Vol1 * 100 else 0;
def mfiB = if Vol2 > 0 then (H2 – L2) / Vol2 * 100 else 0;
def mfiC = if Vol3 > 0 then (H3 – L3) / Vol3 * 100 else 0;
def Con1A = if Vol1[1] > Vol1[2] then 1 else 0;
def Con2A = if mfiA[1] > mfiA[2] then 1 else 0;
def Con1B = if Vol2[1] > Vol2[2] then 1 else 0;
def Con2B = if mfiB[1] > mfiB[2] then 1 else 0;
def Con1C = if Vol3[1] > Vol3[2] then 1 else 0;
def Con2C = if mfiC[1] > mfiC[2] then 1 else 0;
def BW1a= if Con1A == 1 and Con2A == 1 then 1 else 0;
def BW2a= if Con1A == 1 and Con2A == 0 then 2 else 0;
def BW3a= if Con1A == 0 and Con2A == 0 then 3 else 0;
def BW4a= if Con1A == 0 and Con2A == 1 then 4 else 0;
def SBa = (BW1a + BW2a + BW3a + BW4a);
def BW1b= if Con1B == 1 and Con2B == 1 then 1 else 0;
def BW2b= if Con1B == 1 and Con2B == 0 then 2 else 0;
def BW3b= if Con1B == 0 and Con2B == 0 then 3 else 0;
def BW4b= if Con1B == 0 and Con2B == 1 then 4 else 0;
def SBb = (BW1b + BW2b + BW3b + BW4b);
def BW1c= if Con1C == 1 and Con2C == 1 then 1 else 0;
def BW2c= if Con1C == 1 and Con2C == 0 then 2 else 0;
def BW3c= if Con1C == 0 and Con2C == 0 then 3 else 0;
def BW4c= if Con1C == 0 and Con2C == 1 then 4 else 0;
def SBc = (BW1c + BW2c + BW3c + BW4c);

Plot Dot1 = 1;
Dot1.SetpaintingStrategy(PaintingStrategy.Points);
Dot1.SetLineWeight(DotSize);
Dot1.AssignValueColor( if GZone1 == 1 then GlobalColor("GreenZone") else if RZone1 == 1 then GlobalColor("RedZone") else GlobalColor("Neutral"));
Plot Dot2 = 2;
Dot2.SetpaintingStrategy(PaintingStrategy.Points);
Dot2.SetLineWeight(DotSize);
Dot2.AssignValueColor( if GZone2 == 1 then GlobalColor("GreenZone") else if RZone2 == 1 then GlobalColor("RedZone") else GlobalColor("Neutral"));
Plot Dot3 = 3;
Dot3.SetpaintingStrategy(PaintingStrategy.Points);
Dot3.SetLineWeight(DotSize);
Dot3.AssignValueColor( if GZone3 == 1 then GlobalColor("GreenZone") else if RZone3 == 1 then GlobalColor("RedZone") else GlobalColor("Neutral"));
Plot Dot5 =5;
Dot5.SetpaintingStrategy(PaintingStrategy.Squares);
Dot5.SetLineWeight(3);
Dot5.assignValueColor(if SBa == 1 then GlobalColor("Greenbar") else if SBa == 2 then GlobalColor("Squatbar") else if SBa == 3 then GlobalColor("Fadebar") else if SBa == 4 then GlobalColor("Fakebar") else GlobalColor("Zero"));
Plot Dot6 =6;
Dot6.SetpaintingStrategy(PaintingStrategy.Squares);
Dot6.SetLineWeight(4);
Dot6.assignValueColor(if SBb == 1 then GlobalColor("Greenbar") else if SBb == 2 then GlobalColor("Squatbar") else if SBb == 3 then GlobalColor("Fadebar") else if SBb == 4 then GlobalColor("Fakebar") else GlobalColor("Zero"));
Plot Dot7 =7;
Dot7.SetpaintingStrategy(PaintingStrategy.Squares);
Dot7.SetLineWeight(5);
Dot7.assignValueColor(if SBc == 1 then GlobalColor("Greenbar") else if SBc == 2 then GlobalColor("Squatbar") else if SBc == 3 then GlobalColor("Fadebar") else if SBc == 4 then GlobalColor("Fakebar") else GlobalColor("Zero"));

AssignPriceColor( if apc == 1 and GZone1 == 1 then GlobalColor("GreenZone") else if apc == 1 and RZone1 == 1 then GlobalColor("RedZone") else if apc ==1 and GZone1 == 0 and RZone1 == 0 then GlobalColor("Neutral") else if apc == 2 and GZone2 == 1 then GlobalColor("GreenZone") else if apc == 2 and RZone2 == 1 then GlobalColor("RedZone") else if apc == 2 and Gzone2 ==0 and RZone2 == 0 then GlobalColor("Neutral") else if apc == 3 and GZone3 == 1 then GlobalColor("GreenZone") else if  apc == 3 and RZone3 == 1 then GlobalColor("RedZone") else if apc == 3 and Gzone3 ==0 and RZone3 ==0 then GlobalColor("Neutral") else if apc == 5 and SBa == 1 then GlobalColor(“Greenbar”) else if APC == 5 and SBa == 2 then GlobalColor(“Squatbar”) else if apc == 5 and SBa == 3 then GlobalColor(“Fadebar”) else if apc == 5 and SBa == 4 then GlobalColor(“Fakebar”) else if apc == 6 and SBb == 1 then GlobalColor(“Greenbar”) else if APC == 6 and SBb == 2 then GlobalColor(“Squatbar”) else if apc == 6 and SBb == 3 then GlobalColor(“Fadebar”) else if apc == 6 and SBb == 4 then GlobalColor(“Fakebar”)else if apc == 7 and SBc == 1 then GlobalColor(“Greenbar”) else if APC == 7 and SBc == 2 then GlobalColor(“Squatbar”) else if apc == 7 and SBc == 3 then GlobalColor(“Fadebar”) else if apc ==7 and SBc == 4 then GlobalColor(“Fakebar”)else Color.current);
nZLn3gH.png

- How to scan when candlestick is greenbar and dot1, 2 and 3 are green?
 
Last edited by a moderator:
@henry1224, I love this indicator, where can I find details on how to practically use live in trading? Also, I could really use a layman's cheat sheet on what the 1-7 lines actually mean. Thanks
 
@henry1224, I love this indicator, where can I find details on how to practically use live in trading? Also, I could really use a layman's cheat sheet on what the 1-7 lines actually mean. Thanks
# In his book "Trading Chaos", Williams identified four types of trading sessions: Fakes, Fades, Squats, and Greens.
# Lowered volume with a rising MFI is known as a "Fake." There is no real foundation for market move so the price eventually reverses itself.
# A "Fade" is lowered volume with a declining MFI. The market participants are losing interest so expect the price to move in the opposite direction.
# When volume is up while the MFI is down, the condition is referred to as a "Squat." Movement after the squat gives a clue to future direction.
# When volume and the MFI are both up, the situation is "Green." This is a strong signal to follow the trend.

Lines 1 thru 3 are zone bars, Line 1 is MTF #1 Line 2 is MTF #2 Line 3 is MTF #3 Lines 5 thru 7 are Squat bars Line 5 is MTF #1 Line 6 is MTF #2 and Line 7 is MTF #3

Lines 1 and 5 will not repaint , Lines 2,3 6,7 Might repaint due to MTF and they need for the MTF to complete it's calculation
 
Code:
#From the book New Trading Dimensions by Bill Willams, PhD
#Coded by Henry Z Kaczmarczyk 01/2021
#Added Multiple Time Frame
#Added "AssignPriceColor"  apc input "to turn off set number to 0 or 4"
#ZoneBars are lines 1 thru 3 "Points"
#Green , Squat, Fade, Fake bars are lines 5 thru 7 "Squares"
#Lower time frames are on the bottom ,higher time frames are on top
Declare Lower;
DefineGlobalColor("GreenZone",Color.Green);
DefineGlobalColor("RedZone",Color.Red);
DefineGlobalColor("Neutral",Color.Blue);
DefineGlobalColor("Greenbar", Color.Green);
DefineGlobalColor("Squatbar", Color.Blue);
DefineGlobalColor("Fadebar", Color.Red);
DefineGlobalColor("Fakebar", Color.Orange);
DefineGlobalColor("Zero", Color.Gray);
input agg1 = AggregationPeriod.FIVE_MIN;
input agg2 = AggregationPeriod.THIRTY_MIN;
input agg3 = AggregationPeriod.HOUR;
Input apc = 5;
Input DotSize = 3;
Def Price1 = HL2(Period = agg1);
Def Price2 = HL2(Period = agg2);
Def Price3 = HL2(Period = agg3);
Def Vol1 = Volume(Period = agg1);
Def Vol2 = Volume(Period = agg2);
Def Vol3 = Volume(Period = agg3);
Def H1 = High(Period = agg1);
Def H2 = High(Period = agg2);
Def H3 = High(Period = agg3);
Def L1 = Low(Period = agg1);
Def L2 = Low(Period = agg2);
Def L3 = Low(Period = agg3);
def AO1 = Average(Price1,5) - Average(Price1,34);
def AO2 = Average(Price2,5) - Average(Price2,34);
def AO3 = Average(Price3,5) - Average(Price3,34);
def AC1 = AO1 - Average(AO1,5);
def AC2 = AO2 - Average(AO2,5);
def AC3 = AO3 - Average(AO3,5);
def GZone1 = if AO1 > AO1[1] and AC1 > AC1[1] then 1 else 0;
def RZone1 = if AO1 < AO1[1] and AC1 < AC1[1] then 1 else 0;
def GZone2 = if AO2 > AO2[1] and AC2 > AC2[1] then 1 else 0;
def RZone2 = if AO2 < AO2[1] and AC2 < AC2[1] then 1 else 0;
def GZone3 = if AO3 > AO3[1] and AC3 > AC3[1] then 1 else 0;
def RZone3 = if AO3 < AO3[1] and AC3 < AC3[1] then 1 else 0;
def mfiA = if Vol1 > 0 then (H1 – L1) / Vol1 * 100 else 0;
def mfiB = if Vol2 > 0 then (H2 – L2) / Vol2 * 100 else 0;
def mfiC = if Vol3 > 0 then (H3 – L3) / Vol3 * 100 else 0;
def Con1A = if Vol1[1] > Vol1[2] then 1 else 0;
def Con2A = if mfiA[1] > mfiA[2] then 1 else 0;
def Con1B = if Vol2[1] > Vol2[2] then 1 else 0;
def Con2B = if mfiB[1] > mfiB[2] then 1 else 0;
def Con1C = if Vol3[1] > Vol3[2] then 1 else 0;
def Con2C = if mfiC[1] > mfiC[2] then 1 else 0;
def BW1a= if Con1A == 1 and Con2A == 1 then 1 else 0;
def BW2a= if Con1A == 1 and Con2A == 0 then 2 else 0;
def BW3a= if Con1A == 0 and Con2A == 0 then 3 else 0;
def BW4a= if Con1A == 0 and Con2A == 1 then 4 else 0;
def SBa = (BW1a + BW2a + BW3a + BW4a);
def BW1b= if Con1B == 1 and Con2B == 1 then 1 else 0;
def BW2b= if Con1B == 1 and Con2B == 0 then 2 else 0;
def BW3b= if Con1B == 0 and Con2B == 0 then 3 else 0;
def BW4b= if Con1B == 0 and Con2B == 1 then 4 else 0;
def SBb = (BW1b + BW2b + BW3b + BW4b);
def BW1c= if Con1C == 1 and Con2C == 1 then 1 else 0;
def BW2c= if Con1C == 1 and Con2C == 0 then 2 else 0;
def BW3c= if Con1C == 0 and Con2C == 0 then 3 else 0;
def BW4c= if Con1C == 0 and Con2C == 1 then 4 else 0;
def SBc = (BW1c + BW2c + BW3c + BW4c);

Plot Dot1 = 1;
Dot1.SetpaintingStrategy(PaintingStrategy.Points);
Dot1.SetLineWeight(DotSize);
Dot1.AssignValueColor( if GZone1 == 1 then GlobalColor("GreenZone") else if RZone1 == 1 then GlobalColor("RedZone") else GlobalColor("Neutral"));
Plot Dot2 = 2;
Dot2.SetpaintingStrategy(PaintingStrategy.Points);
Dot2.SetLineWeight(DotSize);
Dot2.AssignValueColor( if GZone2 == 1 then GlobalColor("GreenZone") else if RZone2 == 1 then GlobalColor("RedZone") else GlobalColor("Neutral"));
Plot Dot3 = 3;
Dot3.SetpaintingStrategy(PaintingStrategy.Points);
Dot3.SetLineWeight(DotSize);
Dot3.AssignValueColor( if GZone3 == 1 then GlobalColor("GreenZone") else if RZone3 == 1 then GlobalColor("RedZone") else GlobalColor("Neutral"));
Plot Dot5 =5;
Dot5.SetpaintingStrategy(PaintingStrategy.Squares);
Dot5.SetLineWeight(3);
Dot5.assignValueColor(if SBa == 1 then GlobalColor("Greenbar") else if SBa == 2 then GlobalColor("Squatbar") else if SBa == 3 then GlobalColor("Fadebar") else if SBa == 4 then GlobalColor("Fakebar") else GlobalColor("Zero"));
Plot Dot6 =6;
Dot6.SetpaintingStrategy(PaintingStrategy.Squares);
Dot6.SetLineWeight(4);
Dot6.assignValueColor(if SBb == 1 then GlobalColor("Greenbar") else if SBb == 2 then GlobalColor("Squatbar") else if SBb == 3 then GlobalColor("Fadebar") else if SBb == 4 then GlobalColor("Fakebar") else GlobalColor("Zero"));
Plot Dot7 =7;
Dot7.SetpaintingStrategy(PaintingStrategy.Squares);
Dot7.SetLineWeight(5);
Dot7.assignValueColor(if SBc == 1 then GlobalColor("Greenbar") else if SBc == 2 then GlobalColor("Squatbar") else if SBc == 3 then GlobalColor("Fadebar") else if SBc == 4 then GlobalColor("Fakebar") else GlobalColor("Zero"));

AssignPriceColor( if apc == 1 and GZone1 == 1 then GlobalColor("GreenZone") else if apc == 1 and RZone1 == 1 then GlobalColor("RedZone") else if apc ==1 and GZone1 == 0 and RZone1 == 0 then GlobalColor("Neutral") else if apc == 2 and GZone2 == 1 then GlobalColor("GreenZone") else if apc == 2 and RZone2 == 1 then GlobalColor("RedZone") else if apc == 2 and Gzone2 ==0 and RZone2 == 0 then GlobalColor("Neutral") else if apc == 3 and GZone3 == 1 then GlobalColor("GreenZone") else if  apc == 3 and RZone3 == 1 then GlobalColor("RedZone") else if apc == 3 and Gzone3 ==0 and RZone3 ==0 then GlobalColor("Neutral") else if apc == 5 and SBa == 1 then GlobalColor(“Greenbar”) else if APC == 5 and SBa == 2 then GlobalColor(“Squatbar”) else if apc == 5 and SBa == 3 then GlobalColor(“Fadebar”) else if apc == 5 and SBa == 4 then GlobalColor(“Fakebar”) else if apc == 6 and SBb == 1 then GlobalColor(“Greenbar”) else if APC == 6 and SBb == 2 then GlobalColor(“Squatbar”) else if apc == 6 and SBb == 3 then GlobalColor(“Fadebar”) else if apc == 6 and SBb == 4 then GlobalColor(“Fakebar”)else if apc == 7 and SBc == 1 then GlobalColor(“Greenbar”) else if APC == 7 and SBc == 2 then GlobalColor(“Squatbar”) else if apc == 7 and SBc == 3 then GlobalColor(“Fadebar”) else if apc ==7 and SBc == 4 then GlobalColor(“Fakebar”)else Color.current);
I've been trying to find the script that has just a single row of vertical different collared bars. Layed out more like a histogram. There no pics in this dissussion so I can't figure out which is which. Please help me locate it. Thanks all!
 
I've been trying to find the script that has just a single row of vertical different collared bars. Layed out more like a histogram. There no pics in this dissussion so I can't figure out which is which. Please help me locate it. Thanks all!
Lines 5,6 & 7 are for the squat bars
Line 5 is the lowest time frame
Line 6 is the next higher time frame
Line 7 is the highest Time Frame

Code:
def BW1a= if Con1A == 1 and Con2A == 1 then 1 else 0;
def BW2a= if Con1A == 1 and Con2A == 0 then 2 else 0;
def BW3a= if Con1A == 0 and Con2A == 0 then 3 else 0;
def BW4a= if Con1A == 0 and Con2A == 1 then 4 else 0;
def SBa = (BW1a + BW2a + BW3a + BW4a);

Depending on the value of SBa will define the squat bar on the lowest time frame

Followed by SBb and then SBc

These are binary signals, histogram really doesn't do much other than if plotted on Volume

I plotted these to show what different time frames are doing
 

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
335 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