This is a new indicator in my AsGood Indicators: It is called AsGood_GettingYourDucksLineUp. This is the Link http://tos.mx/yrslE7K
This is the verbiage for it:
This is the verbiage for it:
Code:
#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.SetDefaultColor(Color.GREEN);
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.SetDefaultColor(Color.RED);
TrendDown.SetLineWeight (5);
alert(TrendUp and !TrendUp[1], "Bullish Alignment", alert.bar, sound.Chimes);
alert(TrendDown and !TrendDown[1], "Bearish Alignment", alert.bar, sound.Chimes);
AddLabel(yes, if close > Average(close, 6) then "CurrentTimeFrameTrendUp" else "CurrentTimeFrameTrendDown",color.White);
Last edited by a moderator: