GettingYourDucksLinedUp For ThinkOrSwim


This is a new indicator in my AsGood Indicators: It is called AsGood_GettingYourDucksLineUp. This is the Link
This is the verbiage for it:

#AsGood_GettingYourDucksLinedUp Indicator
#This isdicator looks at five time frames and shows Green/Red arrows when direction is the same in all time frames.
#The time frames will be multiples of then chart time frame being used. Multiples are set to 2-3-4-5 alignments thus a 1 MIN Chart will show direction alignment of the 1-2-3-4-5 minute charts; A 5 min chart would show alignments of the 5-10-15-20-25 min charts, etc.
#The White Label shows the Current Time Frame Trend UP/Down with default set at 6 Bars.
#Once indicator is added go to Added Studies And Strategies Click on the Wheel and change Drawing to Up/DownsideGapThreeMethods Arrows and then Click on_volume "Save As Default"
#AsGood_GettingYourDucksLinedUp by Charles Ricks 3/17/23

This is the code:

declare lower;
declare once_per_bar;

input tf4_mplier = 5;
input tf3_mplier = 4;
input tf2_mplier = 3;
input tf1_mplier = 2;

def htf1c = if barNumber()/tf1_mplier == Ceil(barNumber()/tf1_mplier) then 1 else 0;
def tf1_h = if !htf1c[1] then max(high,tf1_h[1]) else high;
def tf2 = if !htf1c[1] then min(low,tf2[1]) else low;
def tf3 = if htf1c[1] then open else tf3[1];
def tf4 = close;

def haclose1 = (tf1_h+tf2+tf4) / 4;
def haopen1 = if htf1c[1] then (haopen1[1] + haclose1[1]) / 2 else haopen1[1];
def diff1 = haclose1 - haopen1;

def htf2c = if barNumber()/tf2_mplier == Ceil(barNumber()/tf2_mplier) then 1 else 0;
def htf2_h = if !htf2c[1] then max(high,htf2_h[1]) else high;
def htf2_l = if !htf2c[1] then min(low,htf2_l[1]) else low;
def htf2_o = if htf2c[1] then open else htf2_o[1];
def htf2_c = close;

def aclose2 = (htf2_h+htf2_l+htf2_c+htf2_o) / 4;
def aopen2 = if htf2c[1] then (aopen2[1] + aclose2[1]) / 2 else aopen2[1];
def diff2 = aclose2 - aopen2;

def tf3c = if barNumber()/tf3_mplier == Ceil(barNumber()/tf3_mplier) then 1 else 0;
def htf3_h = if !tf3c[1] then max(high,htf3_h[1]) else high;
def htf3_l = if !tf3c[1] then min(low,htf3_l[1]) else low;
def htf3_o = if tf3c[1] then open else htf3_o[1];
def htf3_c = close;

def aclose3 = (htf3_h+htf3_l+htf3_c+htf3_o) / 4;
def aopen3 = if tf3c[1] then (aopen3[1] + aclose3[1]) / 2 else aopen3[1];
def diff3 = aclose3 - aopen3;

def tf4c = if barNumber()/tf4_mplier == Ceil(barNumber()/tf4_mplier) then 1 else 0;
def tf4_h = if !tf4c[1] then max(high,tf4_h[1]) else high;
def tf4_l = if !tf4c[1] then min(low,tf4_l[1]) else low;
def tf4_o = if tf4c[1] then open else tf4_o[1];
def tf4_c = close;

def haclose4 = (tf4_h+tf4_l+tf4_c+tf4_o) / 4;
def haopen4 = if tf4c[1] then (haopen4[1] + haclose4[1]) / 2 else haopen4[1];
def diff4 = haclose4 - haopen4;

def aclose5 = (open + high + low + close) / 4;
def haopen5 = CompoundValue(1, (haopen5[1] + aclose5[1]) / 2, (open[1] + close[1]) / 2);
def diff5 = aclose5 - haopen5;

def Long = if diff1 > 0 and diff2 > 0 and diff3 > 0 and diff4 > 0 and diff5 > 0 then 1 else 0;
def Short = if diff1 <= 0 and diff2 <= 0 and diff3 <= 0 and diff4 <= 0 and diff5 <= 0 then 1 else 0;

plot TrendUp = if diff1 > 0 and diff2 > 0 and diff3 > 0 and diff4 > 0 and diff5 > 0 then 0 else Double.NaN;
TrendUp.SetLineWeight (5);
plot TrendDown =if diff1 <= 0 and diff2 <= 0 and diff3 <= 0 and diff4 <= 0 and diff5 <= 0 then 0 else Double.NaN;

TrendDown.SetLineWeight (5);

alert(TrendUp and !TrendUp[1], "Bullish Alignment",, sound.Chimes);
alert(TrendDown and !TrendDown[1], "Bearish Alignment",, sound.Chimes);

AddLabel(yes, if close > Average(close, 6) then "CurrentTimeFrameTrendUp" else "CurrentTimeFrameTrendDown",color.White);

This should be link for a picture: I am using my AsGood Colored Bars MTF in the charting shown

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
270 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.