Indicator for Think or Swim based on Rob Smith's The STRAT

The Strat in binary form over 6 Time frames w multi signals over 6 time frames
Code:
Declare Lower;
# GLOBAL DEFINITIONS
DefineGlobalColor("InsideBarUp", Color.GRAY);
DefineGlobalColor("InsideBarFLAT", Color.Light_GRAY);
DefineGlobalColor("InsideBarDown", Color.DARK_GRAY);
DefineGlobalColor("twoUpClUp", Color.Green);
DefineGlobalColor("twoUpFLAT", Color.Light_Green);
DefineGlobalColor("twoUpClDn", Color.DarK_Green);
DefineGlobalColor("twoDnClUp", Color.Red);
DefineGlobalColor("twoDnFLAT", Color.Light_RED);
DefineGlobalColor("twoDnClDn", Color.Dark_Red);
DefineGlobalColor("OutsideBarUp", Color.Yellow);
DefineGlobalColor("OUTSIDEBARFLAT", Color.ORANGE);
DefineGlobalColor("OutsideBarDown", Color.Dark_Orange);

#Inputs
input agg = AggregationPeriod.FIVE_MIN;
input agg2 = AggregationPeriod.THIRTY_MIN;
input agg3 = AggregationPeriod.HOUR;
input agg4 = AggregationPeriod.TWO_Hours;
input agg5 = AggregationPeriod.FOUR_HOURs;
input agg6 = AggregationPeriod.Day;
Input Dotsize = 3;
Input APC = 1;
input Show_Legend = yes;

AddLabel(if Show_Legend then yes else no, "Color Coding: ", Color.LIGHT_GRAY);
AddLabel(if Show_Legend then yes else no, “Inside Bar Up”, GlobalColor("InsideBarUp”));
AddLabel(if Show_Legend then yes else no, “Inside Bar Flat”, GlobalColor("InsideBarFlat”));
AddLabel(if Show_Legend then yes else no, “Inside Bar Dn”, GlobalColor("InsideBarDown”));
AddLabel(if Show_Legend then yes else no, “Outside Bar Up”, GlobalColor("OutsideBarUp”));
AddLabel(if Show_Legend then yes else no, “Outside Bar Flat”, GlobalColor("OutsideBarFlat”));
AddLabel(if Show_Legend then yes else no, “OutSide Bar Dn”, GlobalColor("OutSideBarDown”));
AddLabel(if Show_Legend then yes else no, “twoUpClUp”, GlobalColor("twoUpClUp”));
AddLabel(if Show_Legend then yes else no, “twoUpFlat”, GlobalColor("twoUpFlat”));
AddLabel(if Show_Legend then yes else no, “twoUpClDn”, GlobalColor("twoUpClDn”));
AddLabel(if Show_Legend then yes else no, “twoDnClUp”, GlobalColor("twoDnClUp”));
AddLabel(if Show_Legend then yes else no, “twoDnFlat”, GlobalColor("twoDnFlat”));
AddLabel(if Show_Legend then yes else no, “twoDnClDn”, GlobalColor("twoDnClDn”));
AddLabel(if Show_Legend then yes else no, “Reversal Up”, Color.CYAN);
AddLabel(if Show_Legend then yes else no, “Reversal Down”, Color.MAGENTA);

def o = Open(Period = AGG);
def C = Close(Period =AGG);
def H = High(Period = AGG);
def L = Low(Period =AGG);
def o2 = Open(Period = AGG2);
def C2 = Close(Period =AGG2);
def H2 = High(Period = AGG2);
def L2 = Low(Period =AGG2);
def o3 = Open(Period = AGG3);
def C3 = Close(Period =AGG3);
def H3 = High(Period = AGG3);
def L3 = Low(Period =AGG3);
def o4 = Open(Period = AGG4);
def C4 = Close(Period =AGG4);
def H4 = Open(Period = AGG4);
def L4 = Close(Period =AGG4);
def O5 = Open(Period = AGG5);
def C5 = Close(Period =AGG5);
def H5 = High(Period = AGG5);
def L5 = Low(Period =AGG5);
def O6 = Open(Period = AGG6);
def C6 = Close(Period =AGG6);
def H6 = Open(Period = AGG6);
def L6 = Close(Period =AGG6);

#Aggregation1
def insidebar =  (H < H[1] and L > L[1]) or (H == H[1] and L > L[1]) or (H < H[1] and L == L[1]) or (H == H[1] and L == L[1]);
def outsidebar =  H  > H[1] and L <  L[1];
def InsidebarFlat = insidebar and O == C;
def OutsidebarFlat = Outsidebar and O == C;
def insidebarup  = insidebar and O < C;
def twoup  = H > H[1] and L >= L[1];
def twoupFlat = twoup and O == C;
def twoupClUp  = H > H[1] and L >= L[1] and O < C;
def twoupClDn  = H > H[1] and L >= L[1] and O > C;
def outsidebarup  = outsidebar and O < C;
def insidebardown  = insidebar and O > C;
def twodown  = H <= H[1] and L < L[1];
def twodownFlat = twodown and O == C;
def twodownCLDn  = H <= H[1] and L < L[1] and O > C;
def twodownCLUp  = H <= H[1] and L < L[1] and O <C;
def outsidebardown  = outsidebar and O > C;
def pivot_high = H >= Highest(H[1], 6) and H > Highest(H[-2], 2);
def pivot_low = L <= Lowest(L[1], 6) and L < Lowest(L[-2], 2);
def Double_ones = InsideBar[1] and Insidebar;
def Double_TwoUp = twoUp[1] and twoup;
def Double_TwoDn = twoDown[1] and twoDown;
#------------------------------------
# DEFINE REVERSALS (Basic four plus RevStrat)
#------------------------------------
# Bullish
def TwoOneTwoBull = twoup and insidebar[1] and twodown[2];
def TwoTwoBull = twoup and twodown[1];
def ThreeBull = outsidebarup and (twodown[1] or insidebar[1] or outsidebardown[1]);
def ThreeOneTwoBull = twoup and insidebar[1] and outsidebardown[2] and pivot_low[2];
def RevStratBull = (twoup and twodown[1] and insidebar[2]) or (outsidebarup and insidebar[1]);
def BullRev = TwoOneTwoBull or TwoTwoBull or ThreeBull or ThreeOneTwoBull or RevStratBull;

# Bearish
def TwoOneTwoBear = twodown and insidebar[1] and twoup[2];
def TwoTwoBear = twodown and twoup[1];
def ThreeBear = outsidebardown and (twoup[1] or insidebar[1] or outsidebarup[1]);
def ThreeOneTwoBear = twodown and insidebar[1] and outsidebarup[2] and pivot_high[2];
def RevStratBear = (twodown and twoup[1] and insidebar[2]) or (outsidebardown and insidebar[1]);
def BearRev = TwoOneTwoBear or TwoTwoBear or ThreeBear or ThreeOneTwoBear or RevStratBear;

#Aggregation 2
def Binsidebar =  (H2 < H2[1] and L2 > L2[1]) or (H2 == H2[1] and L2 > L2[1]) or (H2 < H2[1] and L2 == L2[1]) or (H2 == H2[1] and L2 == L2[1]);
def Boutsidebar =  H2  > H2[1] and L2 <  L2[1];
def Binsidebarup  = Binsidebar and O2 < C2;
def Btwoup  = H2 > H2[1] and L2 >= L2[1];
def BtwoupClUp  = H2 > H2[1] and L2 >= L2[1] and O2 < C2;
def BtwoupClDn  = H2 > H2[1] and L2 >= L2[1] and O2 > C2;
def Boutsidebarup  = Boutsidebar and O2 < C2;
def Binsidebardown  = Binsidebar and O2 > C2;
def Btwodown  = H2 <= H2[1] and L2 < L2[1];
def BtwodownCLDn  = H2 <= H2[1] and L2 < L2[1] and O2 > C2;
def BtwodownCLUp  = H2 <= H2[1] and L2 < L2[1] and O2 <C2;
def Boutsidebardown  = Boutsidebar and O2 > C2;
def BInsidebarFlat = Binsidebar and O2 == C2;
def BOutsidebarFlat = BOutsidebar and O2 == C2;
def BtwoupFlat = Btwoup and O2 == C2;
def BtwodownFlat = Btwodown and O2 == C2;
def Bpivot_high = H2 >= Highest(H2[1], 6) and H2 > Highest(H2[-2], 2);
def Bpivot_low = L2 <= Lowest(L2[1], 6) and L2 < Lowest(L2[-2], 2);
Def BDouble_ones = BInsideBar[1] and BInsidebar;
def BDouble_TwoUp = BtwoUp[1] and Btwoup;
def BDouble_TwoDn = BtwoDown[1] and BtwoDown;
# Bullish
def BTwoOneTwoBull = Btwoup and Binsidebar[1] and Btwodown[2];
def BTwoTwoBull = Btwoup and Btwodown[1];
def BThreeBull = Boutsidebarup and (Btwodown[1] or Binsidebar[1] or Boutsidebardown[1]);
def BThreeOneTwoBull = Btwoup and Binsidebar[1] and Boutsidebardown[2] and Bpivot_low[2];
def BRevStratBull = (Btwoup and Btwodown[1] and Binsidebar[2]) or (Boutsidebarup and Binsidebar[1]);
def BBullRev = BTwoOneTwoBull or BTwoTwoBull or BThreeBull or BThreeOneTwoBull or BRevStratBull;
# Bearish
def BTwoOneTwoBear = Btwodown and Binsidebar[1] and Btwoup[2];
def BTwoTwoBear = Btwodown and Btwoup[1];
def BThreeBear = Boutsidebardown and (Btwoup[1] or Binsidebar[1] or Boutsidebarup[1]);
def BThreeOneTwoBear = Btwodown and Binsidebar[1] and Boutsidebarup[2] and Bpivot_high[2];
def BRevStratBear = (Btwodown and Btwoup[1] and Binsidebar[2]) or (Boutsidebardown and Binsidebar[1]);
def BBearRev = BTwoOneTwoBear or BTwoTwoBear or BThreeBear or BThreeOneTwoBear or BRevStratBear;

#Aggregation 3
def Cinsidebar =  (H3 < H3[1] and L3 > L3[1]) or (H3 == H3[1] and L3 > L3[1]) or (H3 < H3[1] and L3 == L3[1]) or (H3 == H3[1] and L3 == L3[1]);
def Coutsidebar =  H3  > H3[1] and L3 <  L3[1];
def Cinsidebarup  = Cinsidebar and O3 < C3;
def Ctwoup  = H3 > H3[1] and L3 >= L3[1];
def CtwoupClUp  = H3 > H3[1] and L3 >= L3[1] and O3 < C3;
def CtwoupClDn  = H3 > H3[1] and L3 >= L3[1] and O3 > C3;
def Coutsidebarup  = Coutsidebar and O3 < C3;
def Cinsidebardown  = Cinsidebar and O3 > C3;
def Ctwodown  = H3 <= H3[1] and L3 < L3[1];
def CtwodownCLDn  = H3 <= H3[1] and L3 < L3[1] and O3 > C3;
def CtwodownCLUp  = H3 <= H3[1] and L3 < L3[1] and O3 <C3;
def Coutsidebardown  = Coutsidebar and O3 > C3;
def CInsidebarFlat = Cinsidebar and O3 == C3;
def COutsidebarFlat = COutsidebar and O3 == C3;
def CtwoupFlat = Ctwoup and O3 == C3;
def CtwodownFlat = Ctwodown and O3 == C3;
def Cpivot_high = H3 >= Highest(H3[1], 6) and H3 > Highest(H3[-2], 2);
def Cpivot_low = L3 <= Lowest(L3[1], 6) and L3 < Lowest(L3[-2], 2);
def CDouble_ones = CInsideBar[1] and CInsidebar;
def CDouble_TwoUp = CtwoUp[1] and Ctwoup;
def CDouble_TwoDn = CtwoDown[1] and CtwoDown;
# Bullish
def CTwoOneTwoBull = Ctwoup and Cinsidebar[1] and Ctwodown[2];
def CTwoTwoBull = Ctwoup and Ctwodown[1];
def CThreeBull = Coutsidebarup and (Ctwodown[1] or Cinsidebar[1] or Coutsidebardown[1]);
def CThreeOneTwoBull = Ctwoup and Cinsidebar[1] and Coutsidebardown[2] and Cpivot_low[2];
def CRevStratBull = (Ctwoup and Ctwodown[1] and Cinsidebar[2]) or (Coutsidebarup and Cinsidebar[1]);
def CBullRev = CTwoOneTwoBull or CTwoTwoBull or CThreeBull or CThreeOneTwoBull or CRevStratBull;
# Bearish
def CTwoOneTwoBear = Ctwodown and Cinsidebar[1] and Ctwoup[2];
def CTwoTwoBear = Ctwodown and Ctwoup[1];
def CThreeBear = Coutsidebardown and (Ctwoup[1] or Cinsidebar[1] or Coutsidebarup[1]);
def CThreeOneTwoBear = Ctwodown and Cinsidebar[1] and Coutsidebarup[2] and Cpivot_high[2];
def CRevStratBear = (Ctwodown and Ctwoup[1] and Cinsidebar[2]) or (Coutsidebardown and Cinsidebar[1]);
def CBearRev = CTwoOneTwoBear or CTwoTwoBear or CThreeBear or CThreeOneTwoBear or CRevStratBear;

#Aggregation 4
def Dinsidebar =  (H4 < H4[1] and L4 > L4[1]) or (H4 == H4[1] and L4 > L4[1]) or (H4 < H4[1] and L4 == L4[1]) or (H4 == H4[1] and L4 == L4[1]);
def Doutsidebar =  H4 > H4[1] and L4 <  L4[1];
def Dinsidebarup  = Dinsidebar and O4 < C4;
def Dtwoup  = H4 > H4[1] and L4 >= L4[1];
def DtwoupClUp  = H4 > H4[1] and L4 >= L4[1] and O4 < C4;
def DtwoupClDn  = H4 > H4[1] and L4 >= L4[1] and O4 > C4;
def Doutsidebarup  = Doutsidebar and O4 < C4;
def Dinsidebardown  = Dinsidebar and O4 > C4;
def Dtwodown  = H4 <= H4[1] and L4 < L4[1];
def DtwodownCLDn  = H4  <= H4[1] and L4 < L4[1] and O4 > C4;
def DtwodownCLUp  = H4 <= H4[1] and L4 < L4[1] and O4 < C4;
def Doutsidebardown  = Doutsidebar and O4 > C4;
def DInsidebarFlat = Dinsidebar and O4 == C4;
def DOutsidebarFlat = DOutsidebar and O4 == C4;
def DtwoupFlat = Dtwoup and O4 == C4;
def DtwodownFlat = Dtwodown and O4 == C4;

def Dpivot_high = H4 >= Highest(H4[1], 6) and H4 > Highest(H4[-2], 2);
def Dpivot_low = L4 <= Lowest(L4[1], 6) and L4 < Lowest(L4[-2], 2);
def DDouble_ones = DInsideBar[1] and DInsidebar;
def DDouble_TwoUp = DtwoUp[1] and Dtwoup;
def DDouble_TwoDn = DtwoDown[1] and DtwoDown;
# Bullish
def DTwoOneTwoBull = Dtwoup and Dinsidebar[1] and Dtwodown[2];
def DTwoTwoBull = Dtwoup and Dtwodown[1];
def DThreeBull = Doutsidebarup and (Dtwodown[1] or Dinsidebar[1] or Doutsidebardown[1]);
def DThreeOneTwoBull = Dtwoup and Dinsidebar[1] and Doutsidebardown[2] and Dpivot_low[2];
def DRevStratBull = (Dtwoup and Dtwodown[1] and Dinsidebar[2]) or (Doutsidebarup and Dinsidebar[1]);
def DBullRev = DTwoOneTwoBull or DTwoTwoBull or DThreeBull or DThreeOneTwoBull or DRevStratBull;
# Bearish
def DTwoOneTwoBear = Dtwodown and Dinsidebar[1] and Dtwoup[2];
def DTwoTwoBear = Dtwodown and Dtwoup[1];
def DThreeBear = Doutsidebardown and (Dtwoup[1] or Dinsidebar[1] or Doutsidebarup[1]);
def DThreeOneTwoBear = Dtwodown and Dinsidebar[1] and Doutsidebarup[2] and Dpivot_high[2];
def DRevStratBear = (Dtwodown and Dtwoup[1] and Dinsidebar[2]) or (Doutsidebardown and Dinsidebar[1]);
def DBearRev = DTwoOneTwoBear or DTwoTwoBear or DThreeBear or DThreeOneTwoBear or DRevStratBear;

#Aggregation 5
def Einsidebar =  (H5 < H5[1] and L5 > L5[1]) or (H5 == H5[1] and L5 > L5[1]) or (H5 < H5[1] and L5 == L5[1]) or (H5 == H5[1] and L5 == L5[1]);
def Eoutsidebar =  H5  > H5[1] and L5 <  L5[1];
def Einsidebarup  = Einsidebar and O5 < C5;
def Etwoup  = H5 > H5[1] and L5 >= L5[1];
def EtwoupClUp  = H5 > H5[1] and L5 >= L5[1] and O5 < C5;
def EtwoupClDn  = H5 > H5[1] and L5 >= L5[1] and O5 > C5;
def Eoutsidebarup  = Eoutsidebar and O5 < C5;
def Einsidebardown  = Einsidebar and O5 > C5;
def Etwodown  = H5 <= H5[1] and L5 < L5[1];
def EtwodownCLDn  = H5 <= H5[1] and L5 < L5[1] and O5 > C5;
def EtwodownCLUp  = H5 <= H5[1] and L5 < L5[1] and O5 <C5;
def Eoutsidebardown  = Eoutsidebar and O5 > C5;
def EInsidebarFlat = Einsidebar and O5 == C5;
def EOutsidebarFlat = EOutsidebar and O5 == C5;
def EtwoupFlat = Etwoup and O5 == C5;
def EtwodownFlat = Etwodown and O5 == C5;

def Epivot_high = H5 >= Highest(H5[1], 6) and H5 > Highest(H5[-2], 2);
def Epivot_low = L5 <= Lowest(L5[1], 6) and L5 < Lowest(L5[-2], 2);
def EDouble_ones = EInsideBar[1] and EInsidebar;
def EDouble_TwoUp = EtwoUp[1] and Etwoup;
def EDouble_TwoDn = EtwoDown[1] and EtwoDown;
# Bullish
def ETwoOneTwoBull = Etwoup and Einsidebar[1] and Etwodown[2];
def ETwoTwoBull = Etwoup and Etwodown[1];
def EThreeBull = Eoutsidebarup and (Etwodown[1] or Einsidebar[1] or Eoutsidebardown[1]);
def EThreeOneTwoBull = Etwoup and Einsidebar[1] and Eoutsidebardown[2] and Epivot_low[2];
def ERevStratBull = (Etwoup and Etwodown[1] and Einsidebar[2]) or (Eoutsidebarup and Einsidebar[1]);
def EBullRev = ETwoOneTwoBull or ETwoTwoBull or EThreeBull or EThreeOneTwoBull or ERevStratBull;
# Bearish
def ETwoOneTwoBear = Etwodown and Einsidebar[1] and Etwoup[2];
def ETwoTwoBear = Etwodown and Etwoup[1];
def EThreeBear = Eoutsidebardown and (Etwoup[1] or Einsidebar[1] or Eoutsidebarup[1]);
def EThreeOneTwoBear = Etwodown and Einsidebar[1] and Eoutsidebarup[2] and Epivot_high[2];
def ERevStratBear = (Etwodown and Etwoup[1] and Einsidebar[2]) or (Eoutsidebardown and Einsidebar[1]);
def EBearRev = ETwoOneTwoBear or ETwoTwoBear or EThreeBear or EThreeOneTwoBear or ERevStratBear;

#Aggregation 6
def finsidebar =  (H6 < H6[1] and L6 > L6[1]) or (H6 == H6[1] and L6 > L6[1]) or (H6 < H6[1] and L6 == L6[1]) or (H6 == H6[1] and L6 == L6[1]);
def foutsidebar =  H6  > H6[1] and L6 <  L6[1];
def finsidebarup  = finsidebar and O6 < C6;
def ftwoup  = H6 > H6[1] and L6 >= L6[1];
def ftwoupClUp  = H6 > H6[1] and L6 >= L6[1] and O6 < C6;
def ftwoupClDn  = H6 > H6[1] and L6 >= L6[1] and O6 > C6;
def foutsidebarup  = foutsidebar and O6 < C6;
def finsidebardown  = finsidebar and O6 > C6;
def ftwodown  = H6 <= H6[1] and L6 < L6[1];
def ftwodownCLDn  = H6 <= H6[1] and L6 < L6[1] and O6 > C6;
def ftwodownCLUp  = H6 <= H6[1] and L6 < L6[1] and O6 <C6;
def foutsidebardown  = foutsidebar and O6 > C6;
def FInsidebarFlat = Finsidebar and O6 == C6;
def FOutsidebarFlat = FOutsidebar and O6 == C6;
def FtwoupFlat = Ftwoup and O6 == C6;
def FtwodownFlat = Ftwodown and O6 == C6;

def fpivot_high = H6 >= Highest(H6[1], 6) and H6 > Highest(H6[-2], 2);
def fpivot_low = L6 <= Lowest(L6[1], 6) and L6 < Lowest(L6[-2], 2);
def FDouble_ones = FInsideBar[1] and FInsidebar;
def FDouble_TwoUp = FtwoUp[1] and Ftwoup;
def FDouble_TwoDn = FtwoDown[1] and FtwoDown;
# Bullish
def FTwoOneTwoBull = Ftwoup and Finsidebar[1] and Ftwodown[2];
def FTwoTwoBull = Ftwoup and Ftwodown[1];
def FThreeBull = Foutsidebarup and (Ftwodown[1] or Finsidebar[1] or Foutsidebardown[1]);
def FThreeOneTwoBull = Ftwoup and Finsidebar[1] and Foutsidebardown[2] and Fpivot_low[2];
def FRevStratBull = (Ftwoup and Ftwodown[1] and Finsidebar[2]) or (Foutsidebarup and Finsidebar[1]);
def FBullRev = FTwoOneTwoBull or FTwoTwoBull or FThreeBull or FThreeOneTwoBull or FRevStratBull;
# Bearish
def FTwoOneTwoBear = Ftwodown and Finsidebar[1] and Ftwoup[2];
def FTwoTwoBear = Ftwodown and Ftwoup[1];
def FThreeBear = Foutsidebardown and (Ftwoup[1] or Finsidebar[1] or Foutsidebarup[1]);
def FThreeOneTwoBear = Ftwodown and Finsidebar[1] and Foutsidebarup[2] and Fpivot_high[2];
def FRevStratBear = (Ftwodown and Ftwoup[1] and Finsidebar[2]) or (Foutsidebardown and Finsidebar[1]);
def FBearRev = FTwoOneTwoBear or FTwoTwoBear or FThreeBear or FThreeOneTwoBear or FRevStratBear;
#BarTypes
Def BarType = If InsideBarUp then 1.1 else If InsideBarFlat then 1 else If InsideBarDown then -1 else If OutsideBarUp then 3.1 else If OutsideBarFlat then 3 else If OutsideBarDown then -3 else If twoUpClDn then 2 else If twoUpFlat then 2.1 else If twoUpClUp then 2.2 else If twoDownCLUp then -2 else If  twoDownFlat then -2.1 else if twoDownCLDn then -2.2 else Double.NaN;

Def BBarType = If BInsideBarUp then 1.1 else If BInsideBarFlat then 1 else If BInsideBarDown then -1 else If BOutsideBarUp then 3.1 else If BOutsideBarFlat then 3 else If BOutsideBarDown then -3 else If BtwoUpClDn then 2 else If BtwoUpFlat then 2.1 else If BtwoUpClUp then 2.2 else If BtwoDownCLUp then -2 else If BtwoDownFlat then -2.1 else if BtwoDownCLDn then -2.2 else Double.NaN;

Def CBarType = If CInsideBarUp then 1.1 else If CInsideBarFlat then 1 else If CInsideBarDown then -1 else If COutsideBarUp then 3.1 else If COutsideBarFlat then 3 else If COutsideBarDown then -3 else If CtwoUpClDn then 2 else If CtwoUpFlat then 2.1 else If CtwoUpClUp then 2.2 else If CtwoDownCLUp then -2 else If CtwoDownFlat then -2.1 else if CtwoDownCLDn then -2.2 else Double.NaN;

Def DBarType = If DInsideBarUp then 1.1 else If DInsideBarFlat then 1 else If DInsideBarDown then -1 else If DOutsideBarUp then 3.1 else If DOutsideBarFlat then 3 else If DOutsideBarDown then -3 else If DtwoUpClDn then 2 else If DtwoUpFlat then 2.1 else If DtwoUpClUp then 2.2 else If DtwoDownCLUp then -2 else If DtwoDownFlat then -2.1 else if DtwoDownCLDn then -2.2 else Double.NaN;

Def EBarType = If EInsideBarUp then 1.1 else If EInsideBarFlat then 1 else If EInsideBarDown then -1 else If EOutsideBarUp then 3.1 else If EOutsideBarFlat then 3 else If EOutsideBarDown then -3 else If EtwoUpClDn then 2 else If EtwoUpFlat then 2.1 else If EtwoUpClUp then 2.2 else If EtwoDownCLUp then -2 else If EtwoDownFlat then -2.1 else if EtwoDownCLDn then -2.2 else Double.NaN;

Def FBarType = If FInsideBarUp then 1.1 else If FInsideBarFlat then 1 else If FInsideBarDown then -1 else If FOutsideBarUp then 3.1 else If FOutsideBarFlat then 3 else If FOutsideBarDown then -3 else If FtwoUpClDn then 2 else If FtwoUpFlat then 2.1 else If FtwoUpClUp then 2.2 else If FtwoDownCLUp then -2 else If FtwoDownFlat then -2.1 else if FtwoDownCLDn then -2.2 else Double.NaN;

#Plots
plot Strat1_Dot = if IsNaN(C) then Double.NaN else 1;
Strat1_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
Strat1_Dot.SetLineWeight(DotSize);
Strat1_Dot.AssignValueColor(if BarType == 1.1 then Color.Gray else if BarType == 1 then Color.Light_Gray else if BarType == -1 then Color.Dark_Gray else if BarType == 2.2 then Color.Green else if BarType == 2.1 then Color.Light_Green else if BarType == 2 then Color.Dark_Green else if BarType == -2 then Color.Red else if BarType == -2.1 then Color.Light_Red else if BarType == -2.2 then Color.Dark_Red else if BarType == 3.1 then Color.Yellow else if BarType == -3 then Color.Dark_Orange else if BarType == 3 then Color.Orange else Color.Black);

plot Strat2_Dot = if IsNaN(C) then Double.NaN else 2;
Strat2_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
Strat2_Dot.SetLineWeight(DotSize);
Strat2_Dot.AssignValueColor(if BBarType == 1.1 then Color.Gray else if BBarType == 1 then Color.Light_Gray else if BBarType == -1 then Color.Dark_Gray else if BBarType == 2.2 then Color.Green else if BBarType == 2.1 then Color.Light_Green else if BBarType == 2 then Color.Dark_Green else if BBarType == -2 then Color.Red else if BBarType == -2.1 then Color.Light_Red else if BBarType == -2.2 then Color.Dark_Red else if BBarType == 3.1 then Color.Yellow else if BBarType == -3 then Color.Dark_Orange else if BBarType == 3 then Color.Orange else Color.Black);

plot Strat3_Dot = if IsNaN(C) then Double.NaN else 3;
Strat3_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
Strat3_Dot.SetLineWeight(DotSize);
Strat3_Dot.AssignValueColor(if CBarType == 1.1 then Color.Gray else if CBarType == 1 then Color.Light_Gray else if CBarType == -1 then Color.Dark_Gray else if CBarType == 2.2 then Color.Green else if CBarType == 2.1 then Color.Light_Green else if CBarType == 2 then Color.Dark_Green else if CBarType == -2 then Color.Red else if CBarType == -2.1 then Color.Light_Red else if CBarType == -2.2 then Color.Dark_Red else if CBarType == 3.1 then Color.Yellow else if CBarType == -3 then Color.Dark_Orange else if CBarType == 3 then Color.Orange else Color.Black);

plot Strat4_Dot = if IsNaN(C) then Double.NaN else 4;
Strat4_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
Strat4_Dot.SetLineWeight(DotSize);
Strat4_Dot.AssignValueColor(if DBarType == 1.1 then Color.Gray else if DBarType == 1 then Color.Light_Gray else if DBarType == -1 then Color.Dark_Gray else if DBarType == 2.2 then Color.Green else if DBarType == 2.1 then Color.Light_Green else if DBarType == 2 then Color.Dark_Green else if DBarType == -2 then Color.Red else if DBarType == -2.1 then Color.Light_Red else if DBarType == -2.2 then Color.Dark_Red else if DBarType == 3.1 then Color.Yellow else if DBarType == -3 then Color.Dark_Orange else if DBarType == 3 then Color.Orange else Color.Black);

plot Strat5_Dot = if IsNaN(C) then Double.NaN else 5;
Strat5_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
Strat5_Dot.SetLineWeight(DotSize);
Strat5_Dot.AssignValueColor(if EBarType == 1.1 then Color.Gray else if EBarType == 1 then Color.Light_Gray else if EBarType == -1 then Color.Dark_Gray else if EBarType == 2.2 then Color.Green else if EBarType == 2.1 then Color.Light_Green else if EBarType == 2 then Color.Dark_Green else if EBarType == -2 then Color.Red else if EBarType == -2.1 then Color.Light_Red else if EBarType == -2.2 then Color.Dark_Red else if EBarType == 3.1 then Color.Yellow else if EBarType == -3 then Color.Dark_Orange else if EBarType == 3 then Color.Orange else Color.Black);

plot Strat6_Dot = if IsNaN(C) then Double.NaN else 6;
Strat6_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
Strat6_Dot.SetLineWeight(DotSize);
Strat6_Dot.AssignValueColor(if FBarType == 1.1 then Color.Gray else if FBarType == 1 then Color.Light_Gray else if FBarType == -1 then Color.Dark_Gray else if FBarType == 2.2 then Color.Green else if FBarType == 2.1 then Color.Light_Green else if FBarType == 2 then Color.Dark_Green else if FBarType == -2 then Color.Red else if FBarType == -2.1 then Color.Light_Red else if FBarType == -2.2 then Color.Dark_Red else if FBarType == 3.1 then Color.Yellow else if FBarType == -3 then Color.Dark_Orange else if FBarType == 3 then Color.Orange else Color.Black);

plot ASignal_Dot = if IsNaN(C) then Double.NaN else 8;
ASignal_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
ASignal_Dot.SetLineWeight(DotSize);
ASignal_Dot.AssignValueColor(if BullRev then Color.CYAN else if BearRev then Color.MAGENTA else if Double_Ones then Color.Light_Green else if Double_twoup then Color.green else if Double_twoDn then Color.Dark_Red else Color.Black);

plot BSignal_Dot = if IsNaN(C) then Double.NaN else 9;
BSignal_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
BSignal_Dot.SetLineWeight(DotSize);
BSignal_Dot.AssignValueColor(if BBullRev then Color.CYAN else if BBearRev then Color.MAGENTA else if BDouble_Ones then Color.Light_Green else if BDouble_twoup then Color.green else if BDouble_twoDn then Color.Dark_Red else Color.Black);

plot CSignal_Dot = if IsNaN(C) then Double.NaN else 10;
CSignal_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
CSignal_Dot.SetLineWeight(DotSize);
CSignal_Dot.AssignValueColor(if CBullRev then Color.CYAN else if CBearRev then Color.MAGENTA else if CDouble_Ones then Color.Light_Green else if CDouble_twoup then Color.green else if CDouble_twoDn then Color.Dark_Red else Color.Black);
plot DSignal_Dot = if IsNaN(C) then Double.NaN else 11;

DSignal_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
DSignal_Dot.SetLineWeight(DotSize);
DSignal_Dot.AssignValueColor(if DBullRev then Color.CYAN else if DBearRev then Color.MAGENTA else if DDouble_Ones then Color.Light_Green else if DDouble_twoup then Color.green else if DDouble_twoDn then Color.Dark_Red else Color.Black);

plot ESignal_Dot = if IsNaN(C) then Double.NaN else 12;
ESignal_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
ESignal_Dot.SetLineWeight(DotSize);
ESignal_Dot.AssignValueColor(if EBullRev then Color.CYAN else if EBearRev then Color.MAGENTA else if EDouble_Ones then Color.Light_Green else if EDouble_twoup then Color.green else if EDouble_twoDn then Color.Dark_Red else Color.Black);

plot FSignal_Dot = if IsNaN(C) then Double.NaN else 13;
FSignal_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
FSignal_Dot.SetLineWeight(DotSize);
FSignal_Dot.AssignValueColor(if FBullRev then Color.CYAN else if FBearRev then Color.MAGENTA else if FDouble_Ones then Color.Light_Green else if FDouble_twoup then Color.green else if FDouble_twoDn then Color.Dark_Red else Color.Black);

AssignPriceColor(if APC == 1 and BarType == 1.1 then Color.Gray else if APC == 1 and BarType == 1 then Color.Light_Gray else if APC == 1 and BarType == -1 then Color.Dark_Gray else if APC == 1 and BarType == 2.2 then Color.Green else if APC == 1 and BarType == 2.1 then Color.Light_Green else if APC == 1 and BarType == 2 then Color.Dark_Green else if APC == 1 and BarType == -2 then Color.Red else if  APC == 1 and BarType == -2.1 then Color.Light_Red else if APC == 1 and BarType == -2.2 then Color.Dark_Red else if APC == 1 and BarType == 3.1 then Color.Yellow else if APC == 1 and BarType == -3 then Color.Orange else if APC == 1 and BarType == 3 then Color.Dark_Orange else
if APC == 2 and BBarType == 1.1 then Color.Gray else if APC == 2 and BBarType == 1 then Color.Light_Gray else if APC == 2 and BBarType == -1 then Color.Dark_Gray else if APC == 2 and BBarType == 2.2 then Color.Green else if APC == 2 and BBarType == 2.1 then Color.Light_Green else if APC == 2 and BBarType == 2 then Color.Dark_Green else if APC == 2 and BBarType == -2 then Color.Red else if  APC == 2 and BBarType == -2.1  then Color.Light_Red else if APC == 2 and BBarType == -2.2 then Color.Dark_Red else if APC == 2 and BBarType == 3.1 then Color.Yellow else if APC == 2 and BBarType == -3 then Color.Dark_Orange else if APC == 2 and BBarType == 3 then Color.Orange else
if APC == 3 and CBarType == 1.1 then Color.Gray else if APC == 3 and CBarType == 1 then Color.Light_Gray else if APC == 3 and CBarType == -1 then Color.dark_Gray else if APC == 3 and CBarType == 2.2 then Color.Green else if APC == 3 and CBarType == 2.1 then Color.Light_Green else if APC == 3 and CBarType == 2 then Color.Dark_Green else if APC == 3 and CBarType == -2 then Color.Red else if  APC == 3 and CBarType == -2.1  then Color.Light_Red else if APC == 3 and  CBarType == -2.2 then Color.Dark_Red else if APC == 3 and CBarType == 3.1 then Color.Yellow else if APC == 3 and CBarType == -3 then Color.Dark_Orange else if APC == 3 and CBarType == 3 then Color.Orange else
if APC == 4 and DBarType == 1.1 then Color.Gray else if APC == 4 and DBarType == 1 then Color.Light_Gray else if APC == 4 and DBarType == -1 then Color.Dark_Gray else if APC == 4 and DBarType == 2.2 then Color.Green else if APC == 4 and DBarType == 2.1 then Color.Light_Green else if APC == 4 and DBarType == 2 then Color.Dark_Green else if APC == 4 and DBarType == -2 then Color.Red else if  APC == 4 and DBarType == -2.1  then Color.Light_Red else if APC == 4 and DBarType == -2.2 then Color.Dark_Red else if APC == 4 and DBarType == 3.1 then Color.Yellow else if APC == 4 and DBarType == -3 then Color.Dark_Orange else if APC == 4 and DBarType == 3 then Color.Orange else
if APC == 5 and EBarType == 1.1 then Color.Gray else if APC == 5 and EBarType == 1 then Color.Light_Gray else if APC == 5 and EBarType == -1 then Color.Dark_Gray else if APC == 5 and EBarType == 2.2 then Color.Green else if APC == 5 and EBarType == 2.1 then Color.Light_Green else if APC == 5 and EBarType == 2 then Color.Dark_Green else if APC == 5 and EBarType == -2 then Color.Red else if  APC == 5 and EBarType == -2.1  then Color.Light_Red else if APC == 5 and EBarType == -2.2 then Color.Dark_Red else if APC == 5 and EBarType == 3.1 then Color.Yellow else if APC == 5 and EBarType == -3 then Color.Dark_Orange else if APC == 5 and EBarType == 3 then Color.Orange else
if APC == 6 and FBarType == 1.1 then Color.Gray else if APC == 6 and FBarType == 1 then Color.Light_Gray else if APC == 6 and FBarType == -1 then Color.Dark_Gray else if APC == 6 and FBarType == 2.2 then Color.Green else if APC == 6 and FBarType == 2.1 then Color.Light_Green else if APC == 6 and FBarType == 2 then Color.Dark_Green else if APC == 6 and FBarType == -2 then Color.Red else if  APC == 6 and FBarType == -2.1 then Color.Light_Red else if APC == 6 and FBarType == -2.2 then Color.Dark_Red else if APC == 6 and FBarType == 3.1 then Color.Yellow else if APC == 6 and FBarType == -3 then Color.Dark_Orange else if APC == 6 and FBarType == 3 then Color.Orange else Color.current);

# HAMMER

input Hammer_length = 30;
input Hammer_trendSetup = 3;
input Hammer_bodyFactor = 0.3;
input Hammer_shadowFactor = 2.0;

Assert(Hammer_bodyFactor >= 0, "'body factor' must not be negative: " + Hammer_bodyFactor);
Assert(Hammer_shadowFactor >= 0, "'shadow factor' must not be negative: " + Hammer_shadowFactor);

def Hammer_BodyHeight = BodyHeight();
def Hammer_AverageBodyHeight = Average(Hammer_BodyHeight, Hammer_length);
def Hammer_ErrMargin = 0.25 * Hammer_AverageBodyHeight;
def Hammer_IsShort = Hammer_BodyHeight <= Hammer_bodyFactor * Hammer_AverageBodyHeight;
def Hammer = IsDescending(C, Hammer_trendSetup)[1] and

    Hammer_IsShort and
    H - Max(O, C) <= Hammer_ErrMargin and
    Min(O, C) - L > Hammer_shadowFactor * Hammer_BodyHeight;

# SHOOTER

input Star_length = 30;
input Star_trendSetup = 3;
input Star_bodyFactor = 0.3;
input Star_shadowFactor = 2.0;

Assert(Star_bodyFactor >= 0, "'body factor' must not be negative: " + Star_bodyFactor);
Assert(Star_shadowFactor >= 0, "'shadow factor' must not be negative: " + Star_shadowFactor);
def Star_BodyHeight = BodyHeight();
def Star_AverageBodyHeight = Average(Star_BodyHeight, Star_length);
def Star_ErrMargin = 0.25 * Star_AverageBodyHeight;
def Star_IsShort = Star_BodyHeight <= Star_bodyFactor * Star_AverageBodyHeight;
def ShootingStar = IsAscending(C, Star_trendSetup)[1] and
 
    Star_IsShort and
    Min(O, C) - L <= Star_ErrMargin and
    H - Max(O, C) > Star_shadowFactor * Star_BodyHeight;

# -------------------------
# ACTIONABLE SIGNALS
# -------------------------

def InsideUp = insidebar[1] and C crosses above H[1] and C > H[1];
def InsideDown = insidebar[1] and C crosses below L[1] and C < L[1];
def KickingBull = O >= H[1] and C > O;
def KickingBear = O <= L[1] and C < O;
def HammerRev = Hammer[1] and C crosses above H[1] and C > H[1];
def ShooterRev = ShootingStar[1] and C crosses below L[1] and C < L[1];
def MomoStar = IsDescending(C, Star_trendSetup)[2] and 
    Star_IsShort[1] and
    Min(O[1], C[1]) - L[1] <= Star_ErrMargin and
    H[1] - Max(O[1], C[1]) > Star_shadowFactor * Star_BodyHeight and
C crosses below L[1] and C < L[1];
def MomoHammer = IsAscending(C, Hammer_trendSetup)[2] and
    Hammer_IsShort[1] and
    H[1] - Max(O[1], C[1]) <= Hammer_ErrMargin and
    Min(O[1], C[1]) - L[1] > Hammer_shadowFactor * Hammer_BodyHeight and
C crosses above H[1] and C > H[1];

input RangeAVG = AverageType.SIMPLE;
input RangeLength = 13;
input MeasuredMove_Sensitivity = 50;
def MMS = MeasuredMove_Sensitivity / 100;
def ATR = MovingAverage(RangeAVG, TrueRange(H, C, L), RangeLength);
def MeasuredUp = (TrueRange(H[2], C[2], L[2]) > MMS * ATR) and IsAscending(C, 2) and insidebar[1] and C crosses above H[1];
def MeasuredDown = (TrueRange(H[2], C[2], L[2]) > MMS * ATR) and IsDescending(C, 2) and insidebar[1] and C crosses below L[1];
def ActionableUp = InsideUp or KickingBull or RevStratBull or HammerRev or MomoHammer or MeasuredUp;
def ActionableDown = InsideDown or KickingBear or RevStratBear or ShooterRev or MomoStar or MeasuredDown;

# -------------------------
# SIGNAL ALERTS
# -------------------------

AddLabel(ActionableUp or ActionableDown, ("ACTIONABLE: " + if InsideUp then ”Inside Up” else if KickingBull then ”Kicking Bull” else if RevStratBull then “Rev Strat Bull” else if HammerRev then ”Hammer Rev” else if MomoHammer then ”Momentum Hammer” else if MeasuredUp then “Measured Move Up” else if InsideDown then “Inside Down” else if KickingBear then “Kicking Bear” else if RevStratBear then “Rev Strat Bear” else if ShooterRev then "Shooter Rev" else if MomoStar then "Momentum Star" else if MeasuredDown then " Measured Move Down" else ""), if ActionableUp then Color.CYAN else if ActionableDown then Color.MAGENTA else Color.BLACK);

Lines 1 thru 6 are the STRAT over 6 time frames with line 1 being the smallest time frame, Lines 8 thru 13 are the Multi bar setups with line 8 being the smallest time frame
 
The Strat in binary form over 6 Time frames w multi signals over 6 time frames
Code:
Declare Lower;
# GLOBAL DEFINITIONS
DefineGlobalColor("InsideBarUp", Color.GRAY);
DefineGlobalColor("InsideBarFLAT", Color.Light_GRAY);
DefineGlobalColor("InsideBarDown", Color.DARK_GRAY);
DefineGlobalColor("twoUpClUp", Color.Green);
DefineGlobalColor("twoUpFLAT", Color.Light_Green);
DefineGlobalColor("twoUpClDn", Color.DarK_Green);
DefineGlobalColor("twoDnClUp", Color.Red);
DefineGlobalColor("twoDnFLAT", Color.Light_RED);
DefineGlobalColor("twoDnClDn", Color.Dark_Red);
DefineGlobalColor("OutsideBarUp", Color.Yellow);
DefineGlobalColor("OUTSIDEBARFLAT", Color.ORANGE);
DefineGlobalColor("OutsideBarDown", Color.Dark_Orange);

#Inputs
input agg = AggregationPeriod.FIVE_MIN;
input agg2 = AggregationPeriod.THIRTY_MIN;
input agg3 = AggregationPeriod.HOUR;
input agg4 = AggregationPeriod.TWO_Hours;
input agg5 = AggregationPeriod.FOUR_HOURs;
input agg6 = AggregationPeriod.Day;
Input Dotsize = 3;
Input APC = 1;
input Show_Legend = yes;

AddLabel(if Show_Legend then yes else no, "Color Coding: ", Color.LIGHT_GRAY);
AddLabel(if Show_Legend then yes else no, “Inside Bar Up”, GlobalColor("InsideBarUp”));
AddLabel(if Show_Legend then yes else no, “Inside Bar Flat”, GlobalColor("InsideBarFlat”));
AddLabel(if Show_Legend then yes else no, “Inside Bar Dn”, GlobalColor("InsideBarDown”));
AddLabel(if Show_Legend then yes else no, “Outside Bar Up”, GlobalColor("OutsideBarUp”));
AddLabel(if Show_Legend then yes else no, “Outside Bar Flat”, GlobalColor("OutsideBarFlat”));
AddLabel(if Show_Legend then yes else no, “OutSide Bar Dn”, GlobalColor("OutSideBarDown”));
AddLabel(if Show_Legend then yes else no, “twoUpClUp”, GlobalColor("twoUpClUp”));
AddLabel(if Show_Legend then yes else no, “twoUpFlat”, GlobalColor("twoUpFlat”));
AddLabel(if Show_Legend then yes else no, “twoUpClDn”, GlobalColor("twoUpClDn”));
AddLabel(if Show_Legend then yes else no, “twoDnClUp”, GlobalColor("twoDnClUp”));
AddLabel(if Show_Legend then yes else no, “twoDnFlat”, GlobalColor("twoDnFlat”));
AddLabel(if Show_Legend then yes else no, “twoDnClDn”, GlobalColor("twoDnClDn”));
AddLabel(if Show_Legend then yes else no, “Reversal Up”, Color.CYAN);
AddLabel(if Show_Legend then yes else no, “Reversal Down”, Color.MAGENTA);

def o = Open(Period = AGG);
def C = Close(Period =AGG);
def H = High(Period = AGG);
def L = Low(Period =AGG);
def o2 = Open(Period = AGG2);
def C2 = Close(Period =AGG2);
def H2 = High(Period = AGG2);
def L2 = Low(Period =AGG2);
def o3 = Open(Period = AGG3);
def C3 = Close(Period =AGG3);
def H3 = High(Period = AGG3);
def L3 = Low(Period =AGG3);
def o4 = Open(Period = AGG4);
def C4 = Close(Period =AGG4);
def H4 = Open(Period = AGG4);
def L4 = Close(Period =AGG4);
def O5 = Open(Period = AGG5);
def C5 = Close(Period =AGG5);
def H5 = High(Period = AGG5);
def L5 = Low(Period =AGG5);
def O6 = Open(Period = AGG6);
def C6 = Close(Period =AGG6);
def H6 = Open(Period = AGG6);
def L6 = Close(Period =AGG6);

#Aggregation1
def insidebar =  (H < H[1] and L > L[1]) or (H == H[1] and L > L[1]) or (H < H[1] and L == L[1]) or (H == H[1] and L == L[1]);
def outsidebar =  H  > H[1] and L <  L[1];
def InsidebarFlat = insidebar and O == C;
def OutsidebarFlat = Outsidebar and O == C;
def insidebarup  = insidebar and O < C;
def twoup  = H > H[1] and L >= L[1];
def twoupFlat = twoup and O == C;
def twoupClUp  = H > H[1] and L >= L[1] and O < C;
def twoupClDn  = H > H[1] and L >= L[1] and O > C;
def outsidebarup  = outsidebar and O < C;
def insidebardown  = insidebar and O > C;
def twodown  = H <= H[1] and L < L[1];
def twodownFlat = twodown and O == C;
def twodownCLDn  = H <= H[1] and L < L[1] and O > C;
def twodownCLUp  = H <= H[1] and L < L[1] and O <C;
def outsidebardown  = outsidebar and O > C;
def pivot_high = H >= Highest(H[1], 6) and H > Highest(H[-2], 2);
def pivot_low = L <= Lowest(L[1], 6) and L < Lowest(L[-2], 2);
def Double_ones = InsideBar[1] and Insidebar;
def Double_TwoUp = twoUp[1] and twoup;
def Double_TwoDn = twoDown[1] and twoDown;
#------------------------------------
# DEFINE REVERSALS (Basic four plus RevStrat)
#------------------------------------
# Bullish
def TwoOneTwoBull = twoup and insidebar[1] and twodown[2];
def TwoTwoBull = twoup and twodown[1];
def ThreeBull = outsidebarup and (twodown[1] or insidebar[1] or outsidebardown[1]);
def ThreeOneTwoBull = twoup and insidebar[1] and outsidebardown[2] and pivot_low[2];
def RevStratBull = (twoup and twodown[1] and insidebar[2]) or (outsidebarup and insidebar[1]);
def BullRev = TwoOneTwoBull or TwoTwoBull or ThreeBull or ThreeOneTwoBull or RevStratBull;

# Bearish
def TwoOneTwoBear = twodown and insidebar[1] and twoup[2];
def TwoTwoBear = twodown and twoup[1];
def ThreeBear = outsidebardown and (twoup[1] or insidebar[1] or outsidebarup[1]);
def ThreeOneTwoBear = twodown and insidebar[1] and outsidebarup[2] and pivot_high[2];
def RevStratBear = (twodown and twoup[1] and insidebar[2]) or (outsidebardown and insidebar[1]);
def BearRev = TwoOneTwoBear or TwoTwoBear or ThreeBear or ThreeOneTwoBear or RevStratBear;

#Aggregation 2
def Binsidebar =  (H2 < H2[1] and L2 > L2[1]) or (H2 == H2[1] and L2 > L2[1]) or (H2 < H2[1] and L2 == L2[1]) or (H2 == H2[1] and L2 == L2[1]);
def Boutsidebar =  H2  > H2[1] and L2 <  L2[1];
def Binsidebarup  = Binsidebar and O2 < C2;
def Btwoup  = H2 > H2[1] and L2 >= L2[1];
def BtwoupClUp  = H2 > H2[1] and L2 >= L2[1] and O2 < C2;
def BtwoupClDn  = H2 > H2[1] and L2 >= L2[1] and O2 > C2;
def Boutsidebarup  = Boutsidebar and O2 < C2;
def Binsidebardown  = Binsidebar and O2 > C2;
def Btwodown  = H2 <= H2[1] and L2 < L2[1];
def BtwodownCLDn  = H2 <= H2[1] and L2 < L2[1] and O2 > C2;
def BtwodownCLUp  = H2 <= H2[1] and L2 < L2[1] and O2 <C2;
def Boutsidebardown  = Boutsidebar and O2 > C2;
def BInsidebarFlat = Binsidebar and O2 == C2;
def BOutsidebarFlat = BOutsidebar and O2 == C2;
def BtwoupFlat = Btwoup and O2 == C2;
def BtwodownFlat = Btwodown and O2 == C2;
def Bpivot_high = H2 >= Highest(H2[1], 6) and H2 > Highest(H2[-2], 2);
def Bpivot_low = L2 <= Lowest(L2[1], 6) and L2 < Lowest(L2[-2], 2);
Def BDouble_ones = BInsideBar[1] and BInsidebar;
def BDouble_TwoUp = BtwoUp[1] and Btwoup;
def BDouble_TwoDn = BtwoDown[1] and BtwoDown;
# Bullish
def BTwoOneTwoBull = Btwoup and Binsidebar[1] and Btwodown[2];
def BTwoTwoBull = Btwoup and Btwodown[1];
def BThreeBull = Boutsidebarup and (Btwodown[1] or Binsidebar[1] or Boutsidebardown[1]);
def BThreeOneTwoBull = Btwoup and Binsidebar[1] and Boutsidebardown[2] and Bpivot_low[2];
def BRevStratBull = (Btwoup and Btwodown[1] and Binsidebar[2]) or (Boutsidebarup and Binsidebar[1]);
def BBullRev = BTwoOneTwoBull or BTwoTwoBull or BThreeBull or BThreeOneTwoBull or BRevStratBull;
# Bearish
def BTwoOneTwoBear = Btwodown and Binsidebar[1] and Btwoup[2];
def BTwoTwoBear = Btwodown and Btwoup[1];
def BThreeBear = Boutsidebardown and (Btwoup[1] or Binsidebar[1] or Boutsidebarup[1]);
def BThreeOneTwoBear = Btwodown and Binsidebar[1] and Boutsidebarup[2] and Bpivot_high[2];
def BRevStratBear = (Btwodown and Btwoup[1] and Binsidebar[2]) or (Boutsidebardown and Binsidebar[1]);
def BBearRev = BTwoOneTwoBear or BTwoTwoBear or BThreeBear or BThreeOneTwoBear or BRevStratBear;

#Aggregation 3
def Cinsidebar =  (H3 < H3[1] and L3 > L3[1]) or (H3 == H3[1] and L3 > L3[1]) or (H3 < H3[1] and L3 == L3[1]) or (H3 == H3[1] and L3 == L3[1]);
def Coutsidebar =  H3  > H3[1] and L3 <  L3[1];
def Cinsidebarup  = Cinsidebar and O3 < C3;
def Ctwoup  = H3 > H3[1] and L3 >= L3[1];
def CtwoupClUp  = H3 > H3[1] and L3 >= L3[1] and O3 < C3;
def CtwoupClDn  = H3 > H3[1] and L3 >= L3[1] and O3 > C3;
def Coutsidebarup  = Coutsidebar and O3 < C3;
def Cinsidebardown  = Cinsidebar and O3 > C3;
def Ctwodown  = H3 <= H3[1] and L3 < L3[1];
def CtwodownCLDn  = H3 <= H3[1] and L3 < L3[1] and O3 > C3;
def CtwodownCLUp  = H3 <= H3[1] and L3 < L3[1] and O3 <C3;
def Coutsidebardown  = Coutsidebar and O3 > C3;
def CInsidebarFlat = Cinsidebar and O3 == C3;
def COutsidebarFlat = COutsidebar and O3 == C3;
def CtwoupFlat = Ctwoup and O3 == C3;
def CtwodownFlat = Ctwodown and O3 == C3;
def Cpivot_high = H3 >= Highest(H3[1], 6) and H3 > Highest(H3[-2], 2);
def Cpivot_low = L3 <= Lowest(L3[1], 6) and L3 < Lowest(L3[-2], 2);
def CDouble_ones = CInsideBar[1] and CInsidebar;
def CDouble_TwoUp = CtwoUp[1] and Ctwoup;
def CDouble_TwoDn = CtwoDown[1] and CtwoDown;
# Bullish
def CTwoOneTwoBull = Ctwoup and Cinsidebar[1] and Ctwodown[2];
def CTwoTwoBull = Ctwoup and Ctwodown[1];
def CThreeBull = Coutsidebarup and (Ctwodown[1] or Cinsidebar[1] or Coutsidebardown[1]);
def CThreeOneTwoBull = Ctwoup and Cinsidebar[1] and Coutsidebardown[2] and Cpivot_low[2];
def CRevStratBull = (Ctwoup and Ctwodown[1] and Cinsidebar[2]) or (Coutsidebarup and Cinsidebar[1]);
def CBullRev = CTwoOneTwoBull or CTwoTwoBull or CThreeBull or CThreeOneTwoBull or CRevStratBull;
# Bearish
def CTwoOneTwoBear = Ctwodown and Cinsidebar[1] and Ctwoup[2];
def CTwoTwoBear = Ctwodown and Ctwoup[1];
def CThreeBear = Coutsidebardown and (Ctwoup[1] or Cinsidebar[1] or Coutsidebarup[1]);
def CThreeOneTwoBear = Ctwodown and Cinsidebar[1] and Coutsidebarup[2] and Cpivot_high[2];
def CRevStratBear = (Ctwodown and Ctwoup[1] and Cinsidebar[2]) or (Coutsidebardown and Cinsidebar[1]);
def CBearRev = CTwoOneTwoBear or CTwoTwoBear or CThreeBear or CThreeOneTwoBear or CRevStratBear;

#Aggregation 4
def Dinsidebar =  (H4 < H4[1] and L4 > L4[1]) or (H4 == H4[1] and L4 > L4[1]) or (H4 < H4[1] and L4 == L4[1]) or (H4 == H4[1] and L4 == L4[1]);
def Doutsidebar =  H4 > H4[1] and L4 <  L4[1];
def Dinsidebarup  = Dinsidebar and O4 < C4;
def Dtwoup  = H4 > H4[1] and L4 >= L4[1];
def DtwoupClUp  = H4 > H4[1] and L4 >= L4[1] and O4 < C4;
def DtwoupClDn  = H4 > H4[1] and L4 >= L4[1] and O4 > C4;
def Doutsidebarup  = Doutsidebar and O4 < C4;
def Dinsidebardown  = Dinsidebar and O4 > C4;
def Dtwodown  = H4 <= H4[1] and L4 < L4[1];
def DtwodownCLDn  = H4  <= H4[1] and L4 < L4[1] and O4 > C4;
def DtwodownCLUp  = H4 <= H4[1] and L4 < L4[1] and O4 < C4;
def Doutsidebardown  = Doutsidebar and O4 > C4;
def DInsidebarFlat = Dinsidebar and O4 == C4;
def DOutsidebarFlat = DOutsidebar and O4 == C4;
def DtwoupFlat = Dtwoup and O4 == C4;
def DtwodownFlat = Dtwodown and O4 == C4;

def Dpivot_high = H4 >= Highest(H4[1], 6) and H4 > Highest(H4[-2], 2);
def Dpivot_low = L4 <= Lowest(L4[1], 6) and L4 < Lowest(L4[-2], 2);
def DDouble_ones = DInsideBar[1] and DInsidebar;
def DDouble_TwoUp = DtwoUp[1] and Dtwoup;
def DDouble_TwoDn = DtwoDown[1] and DtwoDown;
# Bullish
def DTwoOneTwoBull = Dtwoup and Dinsidebar[1] and Dtwodown[2];
def DTwoTwoBull = Dtwoup and Dtwodown[1];
def DThreeBull = Doutsidebarup and (Dtwodown[1] or Dinsidebar[1] or Doutsidebardown[1]);
def DThreeOneTwoBull = Dtwoup and Dinsidebar[1] and Doutsidebardown[2] and Dpivot_low[2];
def DRevStratBull = (Dtwoup and Dtwodown[1] and Dinsidebar[2]) or (Doutsidebarup and Dinsidebar[1]);
def DBullRev = DTwoOneTwoBull or DTwoTwoBull or DThreeBull or DThreeOneTwoBull or DRevStratBull;
# Bearish
def DTwoOneTwoBear = Dtwodown and Dinsidebar[1] and Dtwoup[2];
def DTwoTwoBear = Dtwodown and Dtwoup[1];
def DThreeBear = Doutsidebardown and (Dtwoup[1] or Dinsidebar[1] or Doutsidebarup[1]);
def DThreeOneTwoBear = Dtwodown and Dinsidebar[1] and Doutsidebarup[2] and Dpivot_high[2];
def DRevStratBear = (Dtwodown and Dtwoup[1] and Dinsidebar[2]) or (Doutsidebardown and Dinsidebar[1]);
def DBearRev = DTwoOneTwoBear or DTwoTwoBear or DThreeBear or DThreeOneTwoBear or DRevStratBear;

#Aggregation 5
def Einsidebar =  (H5 < H5[1] and L5 > L5[1]) or (H5 == H5[1] and L5 > L5[1]) or (H5 < H5[1] and L5 == L5[1]) or (H5 == H5[1] and L5 == L5[1]);
def Eoutsidebar =  H5  > H5[1] and L5 <  L5[1];
def Einsidebarup  = Einsidebar and O5 < C5;
def Etwoup  = H5 > H5[1] and L5 >= L5[1];
def EtwoupClUp  = H5 > H5[1] and L5 >= L5[1] and O5 < C5;
def EtwoupClDn  = H5 > H5[1] and L5 >= L5[1] and O5 > C5;
def Eoutsidebarup  = Eoutsidebar and O5 < C5;
def Einsidebardown  = Einsidebar and O5 > C5;
def Etwodown  = H5 <= H5[1] and L5 < L5[1];
def EtwodownCLDn  = H5 <= H5[1] and L5 < L5[1] and O5 > C5;
def EtwodownCLUp  = H5 <= H5[1] and L5 < L5[1] and O5 <C5;
def Eoutsidebardown  = Eoutsidebar and O5 > C5;
def EInsidebarFlat = Einsidebar and O5 == C5;
def EOutsidebarFlat = EOutsidebar and O5 == C5;
def EtwoupFlat = Etwoup and O5 == C5;
def EtwodownFlat = Etwodown and O5 == C5;

def Epivot_high = H5 >= Highest(H5[1], 6) and H5 > Highest(H5[-2], 2);
def Epivot_low = L5 <= Lowest(L5[1], 6) and L5 < Lowest(L5[-2], 2);
def EDouble_ones = EInsideBar[1] and EInsidebar;
def EDouble_TwoUp = EtwoUp[1] and Etwoup;
def EDouble_TwoDn = EtwoDown[1] and EtwoDown;
# Bullish
def ETwoOneTwoBull = Etwoup and Einsidebar[1] and Etwodown[2];
def ETwoTwoBull = Etwoup and Etwodown[1];
def EThreeBull = Eoutsidebarup and (Etwodown[1] or Einsidebar[1] or Eoutsidebardown[1]);
def EThreeOneTwoBull = Etwoup and Einsidebar[1] and Eoutsidebardown[2] and Epivot_low[2];
def ERevStratBull = (Etwoup and Etwodown[1] and Einsidebar[2]) or (Eoutsidebarup and Einsidebar[1]);
def EBullRev = ETwoOneTwoBull or ETwoTwoBull or EThreeBull or EThreeOneTwoBull or ERevStratBull;
# Bearish
def ETwoOneTwoBear = Etwodown and Einsidebar[1] and Etwoup[2];
def ETwoTwoBear = Etwodown and Etwoup[1];
def EThreeBear = Eoutsidebardown and (Etwoup[1] or Einsidebar[1] or Eoutsidebarup[1]);
def EThreeOneTwoBear = Etwodown and Einsidebar[1] and Eoutsidebarup[2] and Epivot_high[2];
def ERevStratBear = (Etwodown and Etwoup[1] and Einsidebar[2]) or (Eoutsidebardown and Einsidebar[1]);
def EBearRev = ETwoOneTwoBear or ETwoTwoBear or EThreeBear or EThreeOneTwoBear or ERevStratBear;

#Aggregation 6
def finsidebar =  (H6 < H6[1] and L6 > L6[1]) or (H6 == H6[1] and L6 > L6[1]) or (H6 < H6[1] and L6 == L6[1]) or (H6 == H6[1] and L6 == L6[1]);
def foutsidebar =  H6  > H6[1] and L6 <  L6[1];
def finsidebarup  = finsidebar and O6 < C6;
def ftwoup  = H6 > H6[1] and L6 >= L6[1];
def ftwoupClUp  = H6 > H6[1] and L6 >= L6[1] and O6 < C6;
def ftwoupClDn  = H6 > H6[1] and L6 >= L6[1] and O6 > C6;
def foutsidebarup  = foutsidebar and O6 < C6;
def finsidebardown  = finsidebar and O6 > C6;
def ftwodown  = H6 <= H6[1] and L6 < L6[1];
def ftwodownCLDn  = H6 <= H6[1] and L6 < L6[1] and O6 > C6;
def ftwodownCLUp  = H6 <= H6[1] and L6 < L6[1] and O6 <C6;
def foutsidebardown  = foutsidebar and O6 > C6;
def FInsidebarFlat = Finsidebar and O6 == C6;
def FOutsidebarFlat = FOutsidebar and O6 == C6;
def FtwoupFlat = Ftwoup and O6 == C6;
def FtwodownFlat = Ftwodown and O6 == C6;

def fpivot_high = H6 >= Highest(H6[1], 6) and H6 > Highest(H6[-2], 2);
def fpivot_low = L6 <= Lowest(L6[1], 6) and L6 < Lowest(L6[-2], 2);
def FDouble_ones = FInsideBar[1] and FInsidebar;
def FDouble_TwoUp = FtwoUp[1] and Ftwoup;
def FDouble_TwoDn = FtwoDown[1] and FtwoDown;
# Bullish
def FTwoOneTwoBull = Ftwoup and Finsidebar[1] and Ftwodown[2];
def FTwoTwoBull = Ftwoup and Ftwodown[1];
def FThreeBull = Foutsidebarup and (Ftwodown[1] or Finsidebar[1] or Foutsidebardown[1]);
def FThreeOneTwoBull = Ftwoup and Finsidebar[1] and Foutsidebardown[2] and Fpivot_low[2];
def FRevStratBull = (Ftwoup and Ftwodown[1] and Finsidebar[2]) or (Foutsidebarup and Finsidebar[1]);
def FBullRev = FTwoOneTwoBull or FTwoTwoBull or FThreeBull or FThreeOneTwoBull or FRevStratBull;
# Bearish
def FTwoOneTwoBear = Ftwodown and Finsidebar[1] and Ftwoup[2];
def FTwoTwoBear = Ftwodown and Ftwoup[1];
def FThreeBear = Foutsidebardown and (Ftwoup[1] or Finsidebar[1] or Foutsidebarup[1]);
def FThreeOneTwoBear = Ftwodown and Finsidebar[1] and Foutsidebarup[2] and Fpivot_high[2];
def FRevStratBear = (Ftwodown and Ftwoup[1] and Finsidebar[2]) or (Foutsidebardown and Finsidebar[1]);
def FBearRev = FTwoOneTwoBear or FTwoTwoBear or FThreeBear or FThreeOneTwoBear or FRevStratBear;
#BarTypes
Def BarType = If InsideBarUp then 1.1 else If InsideBarFlat then 1 else If InsideBarDown then -1 else If OutsideBarUp then 3.1 else If OutsideBarFlat then 3 else If OutsideBarDown then -3 else If twoUpClDn then 2 else If twoUpFlat then 2.1 else If twoUpClUp then 2.2 else If twoDownCLUp then -2 else If  twoDownFlat then -2.1 else if twoDownCLDn then -2.2 else Double.NaN;

Def BBarType = If BInsideBarUp then 1.1 else If BInsideBarFlat then 1 else If BInsideBarDown then -1 else If BOutsideBarUp then 3.1 else If BOutsideBarFlat then 3 else If BOutsideBarDown then -3 else If BtwoUpClDn then 2 else If BtwoUpFlat then 2.1 else If BtwoUpClUp then 2.2 else If BtwoDownCLUp then -2 else If BtwoDownFlat then -2.1 else if BtwoDownCLDn then -2.2 else Double.NaN;

Def CBarType = If CInsideBarUp then 1.1 else If CInsideBarFlat then 1 else If CInsideBarDown then -1 else If COutsideBarUp then 3.1 else If COutsideBarFlat then 3 else If COutsideBarDown then -3 else If CtwoUpClDn then 2 else If CtwoUpFlat then 2.1 else If CtwoUpClUp then 2.2 else If CtwoDownCLUp then -2 else If CtwoDownFlat then -2.1 else if CtwoDownCLDn then -2.2 else Double.NaN;

Def DBarType = If DInsideBarUp then 1.1 else If DInsideBarFlat then 1 else If DInsideBarDown then -1 else If DOutsideBarUp then 3.1 else If DOutsideBarFlat then 3 else If DOutsideBarDown then -3 else If DtwoUpClDn then 2 else If DtwoUpFlat then 2.1 else If DtwoUpClUp then 2.2 else If DtwoDownCLUp then -2 else If DtwoDownFlat then -2.1 else if DtwoDownCLDn then -2.2 else Double.NaN;

Def EBarType = If EInsideBarUp then 1.1 else If EInsideBarFlat then 1 else If EInsideBarDown then -1 else If EOutsideBarUp then 3.1 else If EOutsideBarFlat then 3 else If EOutsideBarDown then -3 else If EtwoUpClDn then 2 else If EtwoUpFlat then 2.1 else If EtwoUpClUp then 2.2 else If EtwoDownCLUp then -2 else If EtwoDownFlat then -2.1 else if EtwoDownCLDn then -2.2 else Double.NaN;

Def FBarType = If FInsideBarUp then 1.1 else If FInsideBarFlat then 1 else If FInsideBarDown then -1 else If FOutsideBarUp then 3.1 else If FOutsideBarFlat then 3 else If FOutsideBarDown then -3 else If FtwoUpClDn then 2 else If FtwoUpFlat then 2.1 else If FtwoUpClUp then 2.2 else If FtwoDownCLUp then -2 else If FtwoDownFlat then -2.1 else if FtwoDownCLDn then -2.2 else Double.NaN;

#Plots
plot Strat1_Dot = if IsNaN(C) then Double.NaN else 1;
Strat1_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
Strat1_Dot.SetLineWeight(DotSize);
Strat1_Dot.AssignValueColor(if BarType == 1.1 then Color.Gray else if BarType == 1 then Color.Light_Gray else if BarType == -1 then Color.Dark_Gray else if BarType == 2.2 then Color.Green else if BarType == 2.1 then Color.Light_Green else if BarType == 2 then Color.Dark_Green else if BarType == -2 then Color.Red else if BarType == -2.1 then Color.Light_Red else if BarType == -2.2 then Color.Dark_Red else if BarType == 3.1 then Color.Yellow else if BarType == -3 then Color.Dark_Orange else if BarType == 3 then Color.Orange else Color.Black);

plot Strat2_Dot = if IsNaN(C) then Double.NaN else 2;
Strat2_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
Strat2_Dot.SetLineWeight(DotSize);
Strat2_Dot.AssignValueColor(if BBarType == 1.1 then Color.Gray else if BBarType == 1 then Color.Light_Gray else if BBarType == -1 then Color.Dark_Gray else if BBarType == 2.2 then Color.Green else if BBarType == 2.1 then Color.Light_Green else if BBarType == 2 then Color.Dark_Green else if BBarType == -2 then Color.Red else if BBarType == -2.1 then Color.Light_Red else if BBarType == -2.2 then Color.Dark_Red else if BBarType == 3.1 then Color.Yellow else if BBarType == -3 then Color.Dark_Orange else if BBarType == 3 then Color.Orange else Color.Black);

plot Strat3_Dot = if IsNaN(C) then Double.NaN else 3;
Strat3_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
Strat3_Dot.SetLineWeight(DotSize);
Strat3_Dot.AssignValueColor(if CBarType == 1.1 then Color.Gray else if CBarType == 1 then Color.Light_Gray else if CBarType == -1 then Color.Dark_Gray else if CBarType == 2.2 then Color.Green else if CBarType == 2.1 then Color.Light_Green else if CBarType == 2 then Color.Dark_Green else if CBarType == -2 then Color.Red else if CBarType == -2.1 then Color.Light_Red else if CBarType == -2.2 then Color.Dark_Red else if CBarType == 3.1 then Color.Yellow else if CBarType == -3 then Color.Dark_Orange else if CBarType == 3 then Color.Orange else Color.Black);

plot Strat4_Dot = if IsNaN(C) then Double.NaN else 4;
Strat4_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
Strat4_Dot.SetLineWeight(DotSize);
Strat4_Dot.AssignValueColor(if DBarType == 1.1 then Color.Gray else if DBarType == 1 then Color.Light_Gray else if DBarType == -1 then Color.Dark_Gray else if DBarType == 2.2 then Color.Green else if DBarType == 2.1 then Color.Light_Green else if DBarType == 2 then Color.Dark_Green else if DBarType == -2 then Color.Red else if DBarType == -2.1 then Color.Light_Red else if DBarType == -2.2 then Color.Dark_Red else if DBarType == 3.1 then Color.Yellow else if DBarType == -3 then Color.Dark_Orange else if DBarType == 3 then Color.Orange else Color.Black);

plot Strat5_Dot = if IsNaN(C) then Double.NaN else 5;
Strat5_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
Strat5_Dot.SetLineWeight(DotSize);
Strat5_Dot.AssignValueColor(if EBarType == 1.1 then Color.Gray else if EBarType == 1 then Color.Light_Gray else if EBarType == -1 then Color.Dark_Gray else if EBarType == 2.2 then Color.Green else if EBarType == 2.1 then Color.Light_Green else if EBarType == 2 then Color.Dark_Green else if EBarType == -2 then Color.Red else if EBarType == -2.1 then Color.Light_Red else if EBarType == -2.2 then Color.Dark_Red else if EBarType == 3.1 then Color.Yellow else if EBarType == -3 then Color.Dark_Orange else if EBarType == 3 then Color.Orange else Color.Black);

plot Strat6_Dot = if IsNaN(C) then Double.NaN else 6;
Strat6_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
Strat6_Dot.SetLineWeight(DotSize);
Strat6_Dot.AssignValueColor(if FBarType == 1.1 then Color.Gray else if FBarType == 1 then Color.Light_Gray else if FBarType == -1 then Color.Dark_Gray else if FBarType == 2.2 then Color.Green else if FBarType == 2.1 then Color.Light_Green else if FBarType == 2 then Color.Dark_Green else if FBarType == -2 then Color.Red else if FBarType == -2.1 then Color.Light_Red else if FBarType == -2.2 then Color.Dark_Red else if FBarType == 3.1 then Color.Yellow else if FBarType == -3 then Color.Dark_Orange else if FBarType == 3 then Color.Orange else Color.Black);

plot ASignal_Dot = if IsNaN(C) then Double.NaN else 8;
ASignal_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
ASignal_Dot.SetLineWeight(DotSize);
ASignal_Dot.AssignValueColor(if BullRev then Color.CYAN else if BearRev then Color.MAGENTA else if Double_Ones then Color.Light_Green else if Double_twoup then Color.green else if Double_twoDn then Color.Dark_Red else Color.Black);

plot BSignal_Dot = if IsNaN(C) then Double.NaN else 9;
BSignal_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
BSignal_Dot.SetLineWeight(DotSize);
BSignal_Dot.AssignValueColor(if BBullRev then Color.CYAN else if BBearRev then Color.MAGENTA else if BDouble_Ones then Color.Light_Green else if BDouble_twoup then Color.green else if BDouble_twoDn then Color.Dark_Red else Color.Black);

plot CSignal_Dot = if IsNaN(C) then Double.NaN else 10;
CSignal_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
CSignal_Dot.SetLineWeight(DotSize);
CSignal_Dot.AssignValueColor(if CBullRev then Color.CYAN else if CBearRev then Color.MAGENTA else if CDouble_Ones then Color.Light_Green else if CDouble_twoup then Color.green else if CDouble_twoDn then Color.Dark_Red else Color.Black);
plot DSignal_Dot = if IsNaN(C) then Double.NaN else 11;

DSignal_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
DSignal_Dot.SetLineWeight(DotSize);
DSignal_Dot.AssignValueColor(if DBullRev then Color.CYAN else if DBearRev then Color.MAGENTA else if DDouble_Ones then Color.Light_Green else if DDouble_twoup then Color.green else if DDouble_twoDn then Color.Dark_Red else Color.Black);

plot ESignal_Dot = if IsNaN(C) then Double.NaN else 12;
ESignal_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
ESignal_Dot.SetLineWeight(DotSize);
ESignal_Dot.AssignValueColor(if EBullRev then Color.CYAN else if EBearRev then Color.MAGENTA else if EDouble_Ones then Color.Light_Green else if EDouble_twoup then Color.green else if EDouble_twoDn then Color.Dark_Red else Color.Black);

plot FSignal_Dot = if IsNaN(C) then Double.NaN else 13;
FSignal_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
FSignal_Dot.SetLineWeight(DotSize);
FSignal_Dot.AssignValueColor(if FBullRev then Color.CYAN else if FBearRev then Color.MAGENTA else if FDouble_Ones then Color.Light_Green else if FDouble_twoup then Color.green else if FDouble_twoDn then Color.Dark_Red else Color.Black);

AssignPriceColor(if APC == 1 and BarType == 1.1 then Color.Gray else if APC == 1 and BarType == 1 then Color.Light_Gray else if APC == 1 and BarType == -1 then Color.Dark_Gray else if APC == 1 and BarType == 2.2 then Color.Green else if APC == 1 and BarType == 2.1 then Color.Light_Green else if APC == 1 and BarType == 2 then Color.Dark_Green else if APC == 1 and BarType == -2 then Color.Red else if  APC == 1 and BarType == -2.1 then Color.Light_Red else if APC == 1 and BarType == -2.2 then Color.Dark_Red else if APC == 1 and BarType == 3.1 then Color.Yellow else if APC == 1 and BarType == -3 then Color.Orange else if APC == 1 and BarType == 3 then Color.Dark_Orange else
if APC == 2 and BBarType == 1.1 then Color.Gray else if APC == 2 and BBarType == 1 then Color.Light_Gray else if APC == 2 and BBarType == -1 then Color.Dark_Gray else if APC == 2 and BBarType == 2.2 then Color.Green else if APC == 2 and BBarType == 2.1 then Color.Light_Green else if APC == 2 and BBarType == 2 then Color.Dark_Green else if APC == 2 and BBarType == -2 then Color.Red else if  APC == 2 and BBarType == -2.1  then Color.Light_Red else if APC == 2 and BBarType == -2.2 then Color.Dark_Red else if APC == 2 and BBarType == 3.1 then Color.Yellow else if APC == 2 and BBarType == -3 then Color.Dark_Orange else if APC == 2 and BBarType == 3 then Color.Orange else
if APC == 3 and CBarType == 1.1 then Color.Gray else if APC == 3 and CBarType == 1 then Color.Light_Gray else if APC == 3 and CBarType == -1 then Color.dark_Gray else if APC == 3 and CBarType == 2.2 then Color.Green else if APC == 3 and CBarType == 2.1 then Color.Light_Green else if APC == 3 and CBarType == 2 then Color.Dark_Green else if APC == 3 and CBarType == -2 then Color.Red else if  APC == 3 and CBarType == -2.1  then Color.Light_Red else if APC == 3 and  CBarType == -2.2 then Color.Dark_Red else if APC == 3 and CBarType == 3.1 then Color.Yellow else if APC == 3 and CBarType == -3 then Color.Dark_Orange else if APC == 3 and CBarType == 3 then Color.Orange else
if APC == 4 and DBarType == 1.1 then Color.Gray else if APC == 4 and DBarType == 1 then Color.Light_Gray else if APC == 4 and DBarType == -1 then Color.Dark_Gray else if APC == 4 and DBarType == 2.2 then Color.Green else if APC == 4 and DBarType == 2.1 then Color.Light_Green else if APC == 4 and DBarType == 2 then Color.Dark_Green else if APC == 4 and DBarType == -2 then Color.Red else if  APC == 4 and DBarType == -2.1  then Color.Light_Red else if APC == 4 and DBarType == -2.2 then Color.Dark_Red else if APC == 4 and DBarType == 3.1 then Color.Yellow else if APC == 4 and DBarType == -3 then Color.Dark_Orange else if APC == 4 and DBarType == 3 then Color.Orange else
if APC == 5 and EBarType == 1.1 then Color.Gray else if APC == 5 and EBarType == 1 then Color.Light_Gray else if APC == 5 and EBarType == -1 then Color.Dark_Gray else if APC == 5 and EBarType == 2.2 then Color.Green else if APC == 5 and EBarType == 2.1 then Color.Light_Green else if APC == 5 and EBarType == 2 then Color.Dark_Green else if APC == 5 and EBarType == -2 then Color.Red else if  APC == 5 and EBarType == -2.1  then Color.Light_Red else if APC == 5 and EBarType == -2.2 then Color.Dark_Red else if APC == 5 and EBarType == 3.1 then Color.Yellow else if APC == 5 and EBarType == -3 then Color.Dark_Orange else if APC == 5 and EBarType == 3 then Color.Orange else
if APC == 6 and FBarType == 1.1 then Color.Gray else if APC == 6 and FBarType == 1 then Color.Light_Gray else if APC == 6 and FBarType == -1 then Color.Dark_Gray else if APC == 6 and FBarType == 2.2 then Color.Green else if APC == 6 and FBarType == 2.1 then Color.Light_Green else if APC == 6 and FBarType == 2 then Color.Dark_Green else if APC == 6 and FBarType == -2 then Color.Red else if  APC == 6 and FBarType == -2.1 then Color.Light_Red else if APC == 6 and FBarType == -2.2 then Color.Dark_Red else if APC == 6 and FBarType == 3.1 then Color.Yellow else if APC == 6 and FBarType == -3 then Color.Dark_Orange else if APC == 6 and FBarType == 3 then Color.Orange else Color.current);

# HAMMER

input Hammer_length = 30;
input Hammer_trendSetup = 3;
input Hammer_bodyFactor = 0.3;
input Hammer_shadowFactor = 2.0;

Assert(Hammer_bodyFactor >= 0, "'body factor' must not be negative: " + Hammer_bodyFactor);
Assert(Hammer_shadowFactor >= 0, "'shadow factor' must not be negative: " + Hammer_shadowFactor);

def Hammer_BodyHeight = BodyHeight();
def Hammer_AverageBodyHeight = Average(Hammer_BodyHeight, Hammer_length);
def Hammer_ErrMargin = 0.25 * Hammer_AverageBodyHeight;
def Hammer_IsShort = Hammer_BodyHeight <= Hammer_bodyFactor * Hammer_AverageBodyHeight;
def Hammer = IsDescending(C, Hammer_trendSetup)[1] and

    Hammer_IsShort and
    H - Max(O, C) <= Hammer_ErrMargin and
    Min(O, C) - L > Hammer_shadowFactor * Hammer_BodyHeight;

# SHOOTER

input Star_length = 30;
input Star_trendSetup = 3;
input Star_bodyFactor = 0.3;
input Star_shadowFactor = 2.0;

Assert(Star_bodyFactor >= 0, "'body factor' must not be negative: " + Star_bodyFactor);
Assert(Star_shadowFactor >= 0, "'shadow factor' must not be negative: " + Star_shadowFactor);
def Star_BodyHeight = BodyHeight();
def Star_AverageBodyHeight = Average(Star_BodyHeight, Star_length);
def Star_ErrMargin = 0.25 * Star_AverageBodyHeight;
def Star_IsShort = Star_BodyHeight <= Star_bodyFactor * Star_AverageBodyHeight;
def ShootingStar = IsAscending(C, Star_trendSetup)[1] and
 
    Star_IsShort and
    Min(O, C) - L <= Star_ErrMargin and
    H - Max(O, C) > Star_shadowFactor * Star_BodyHeight;

# -------------------------
# ACTIONABLE SIGNALS
# -------------------------

def InsideUp = insidebar[1] and C crosses above H[1] and C > H[1];
def InsideDown = insidebar[1] and C crosses below L[1] and C < L[1];
def KickingBull = O >= H[1] and C > O;
def KickingBear = O <= L[1] and C < O;
def HammerRev = Hammer[1] and C crosses above H[1] and C > H[1];
def ShooterRev = ShootingStar[1] and C crosses below L[1] and C < L[1];
def MomoStar = IsDescending(C, Star_trendSetup)[2] and
    Star_IsShort[1] and
    Min(O[1], C[1]) - L[1] <= Star_ErrMargin and
    H[1] - Max(O[1], C[1]) > Star_shadowFactor * Star_BodyHeight and
C crosses below L[1] and C < L[1];
def MomoHammer = IsAscending(C, Hammer_trendSetup)[2] and
    Hammer_IsShort[1] and
    H[1] - Max(O[1], C[1]) <= Hammer_ErrMargin and
    Min(O[1], C[1]) - L[1] > Hammer_shadowFactor * Hammer_BodyHeight and
C crosses above H[1] and C > H[1];

input RangeAVG = AverageType.SIMPLE;
input RangeLength = 13;
input MeasuredMove_Sensitivity = 50;
def MMS = MeasuredMove_Sensitivity / 100;
def ATR = MovingAverage(RangeAVG, TrueRange(H, C, L), RangeLength);
def MeasuredUp = (TrueRange(H[2], C[2], L[2]) > MMS * ATR) and IsAscending(C, 2) and insidebar[1] and C crosses above H[1];
def MeasuredDown = (TrueRange(H[2], C[2], L[2]) > MMS * ATR) and IsDescending(C, 2) and insidebar[1] and C crosses below L[1];
def ActionableUp = InsideUp or KickingBull or RevStratBull or HammerRev or MomoHammer or MeasuredUp;
def ActionableDown = InsideDown or KickingBear or RevStratBear or ShooterRev or MomoStar or MeasuredDown;

# -------------------------
# SIGNAL ALERTS
# -------------------------

AddLabel(ActionableUp or ActionableDown, ("ACTIONABLE: " + if InsideUp then ”Inside Up” else if KickingBull then ”Kicking Bull” else if RevStratBull then “Rev Strat Bull” else if HammerRev then ”Hammer Rev” else if MomoHammer then ”Momentum Hammer” else if MeasuredUp then “Measured Move Up” else if InsideDown then “Inside Down” else if KickingBear then “Kicking Bear” else if RevStratBear then “Rev Strat Bear” else if ShooterRev then "Shooter Rev" else if MomoStar then "Momentum Star" else if MeasuredDown then " Measured Move Down" else ""), if ActionableUp then Color.CYAN else if ActionableDown then Color.MAGENTA else Color.BLACK);

Lines 1 thru 6 are the STRAT over 6 time frames with line 1 being the smallest time frame, Lines 8 thru 13 are the Multi bar setups with line 8 being the smallest time frame
hw3Mkqf.png
 
Thanks for the incredible amount of work you put into this, but I just get an big empty box below the chart with the name of the study? I copied it all and eliminated all Strat related studies in the chart thinking they might be interfering. I don't get it?
 
Thanks for the incredible amount of work you put into this, but I just get an big empty box below the chart with the name of the study? I copied it all and eliminated all Strat related studies in the chart thinking they might be interfering. I don't get it?
Did you set the aggregation periods? The first time period should be set for the time period you are using as the base chart then the next 5 time periods

Click on the beaker on top/ clic on the gear next to the name of the indicator/ then set your time frames.
 
Thanks, this is awesome. I have a question about the 312 Bullish Reversal. The definition in this indicator requires that the 3-bar be a pivot low of the last 6 bars. Is this from an official definition of the 312? I haven't seen official definitions and would like to know what the best reference for theStrat setups would be. I'm trying to make my own indicators and I find myself fine tuning because I don't have the exact definitions. Thanks.
 
Thanks, this is awesome. I have a question about the 312 Bullish Reversal. The definition in this indicator requires that the 3-bar be a pivot low of the last 6 bars. Is this from an official definition of the 312? I haven't seen official definitions and would like to know what the best reference for theStrat setups would be. I'm trying to make my own indicators and I find myself fine tuning because I don't have the exact definitions. Thanks.
The bottom 6 lines are the single bar descriptions. The Top lines 8 thru 13 are from the strat indicator at the start of this dialog
 
The bottom 6 lines are the single bar descriptions. The Top lines 8 thru 13 are from the strat indicator at the start of this dialog
I may not have worded my question well. The 312 reversal is a 3 followed by a 1 and a 2. In the logic for this indicator, there is additional logic that requires the 3 also be a pivot low:

def ThreeOneTwoBull = twoup and insidebar[1] and outsidebardown[2] and pivot_low[2];

The pivot low in this script requires that this bar's low is lower than the previous 6 bars and the 2 that follow.
def pivot_low = L <= Lowest(L[1], 6) and L < Lowest(L[-2], 2);

Is this from an official "theStrat" definition that I can get a link to? I'd like to know that the indicators that I create are consistent with official setup definitions for theStrat.

Thanks
 
I may not have worded my question well. The 312 reversal is a 3 followed by a 1 and a 2. In the logic for this indicator, there is additional logic that requires the 3 also be a pivot low:

def ThreeOneTwoBull = twoup and insidebar[1] and outsidebardown[2] and pivot_low[2];

The pivot low in this script requires that this bar's low is lower than the previous 6 bars and the 2 that follow.
def pivot_low = L <= Lowest(L[1], 6) and L < Lowest(L[-2], 2);

Is this from an official "theStrat" definition that I can get a link to? I'd like to know that the indicators that I create are consistent with official setup definitions for theStrat.

Thanks
yes the pivot lows and pivot highs are coded into the 3/1/2 "s Bullish and bearish
 
Hey man, much gratitude for the quality and amount if work you have done here. Watched you video but puzzled a bit.

6UEB4Y9.png


Hope attachment works.

I use multi-times setups to trade. Using the regular grid. On my attached chart the R and S lines appear over and under each candle. This is my 1D- 5min. chart. I edited to say No on all time frames higher than 1 Day (tried turning 1D off as well.) l, also changed to No under 5 min, because I do not trade lower than 5. I have the same issues on my 10 min chart. Hoping you can help me with setting this up correctly as its not useful like this. Please advise.

I have noticed the background change and assumed it means. go, stop, and wait. Also, the grey arrows are your buy and sell signals, correct? Assuming all other conditions are right with my other indicators, would you trade right on that candle? Or wait to confirm direction? If so, would you look at The Strat for confirmation? Or up/down fractals, etc.?

If you have time to help, I would be grateful,

@DannyBoy
Sorry, I have been so busy with life in general, this is the first chance I've had to come on here in a while. No, the gray arrows only appear when there is FTFC up or down. They definitely are not buy/sell signals. That decision has to be based on more than just time frame continuity. Honestly I discontinued the background color on the main TFC script because it was really messing with my psyche. I like the overlay charts and the study that is included in them that draws the horizontal lines for the beginning of FTFC in each direction. In ranging markets, I find a lot of good confirmation for scalps when going from the bottom line to the top line. In trending markets, you want to see continuation above/below these lines
 
Sorry, I have been so busy with life in general, this is the first chance I've had to come on here in a while. No, the gray arrows only appear when there is FTFC up or down. They definitely are not buy/sell signals. That decision has to be based on more than just time frame continuity. Honestly I discontinued the background color on the main TFC script because it was really messing with my psyche. I like the overlay charts and the study that is included in them that draws the horizontal lines for the beginning of FTFC in each direction. In ranging markets, I find a lot of good confirmation for scalps when going from the bottom line to the top line. In trending markets, you want to see continuation above/below these lines
One more thing, (no I am not a Steve Jobs protege) the red background did freak me out. The other day I ran into a version of your work that let you hide the 2's. Only looked at it briefly and now I can't find it again. Do you happen to know what this is and where to find it? Much easlier on the eyes as well.
 
One more thing, (no I am not a Steve Jobs protege) the red background did freak me out. The other day I ran into a version of your work that let you hide the 2's. Only looked at it briefly and now I can't find it again. Do you happen to know what this is and where to find it? Much easlier on the eyes as well.
Any version of the strat numbers script will have that ability. Look in the settings, you'll see a toggle for "Show Twos." The strat numbers script and the versions of the remix study that number candles should all have that in the settings
 
I just created a lower study that's similar to that of @henry1224. Made it for the purpose of backtesting and possibly day trading. Here's my simple (but way less cool) code:

Code:
script GetCandleType{
  input tf = AggregationPeriod.MIN;
  def o;
  def c;
  def grn;
  def red;
  def net;

  if GetAggregationPeriod() <= tf {
    o = open(period = tf);
    c = close(period = tf);
    grn    = if o < c then 1 else Double.NaN;
    red    = if o > c then 2 else Double.NaN;
    net    = if o == c then 0 else Double.NaN;
  } else {
    o = 0;
    c = 0;
    grn    = Double.NaN;
    red    = Double.NaN;
    net    = Double.NaN;
  }
  plot color = if !isNan(grn) && isNaN(net) then 1 else if !isNaN(red) && isNaN(net) then 2 else 0;
}


declare lower;

DefineGlobalColor("2up",  Color.Green);
DefineGlobalColor("2down",  Color.Red);


plot "1m" = 0;
plot "5m" = 1;
plot "15m" = 2;
plot "30m" = 3;
plot "1H" = 4;
plot "1D" = 5;

"1m".SetPaintingStrategy(paintingStrategy = PaintingStrategy.POINTS);
"5m".SetPaintingStrategy(paintingStrategy = PaintingStrategy.POINTS);
"15m".SetPaintingStrategy(paintingStrategy = PaintingStrategy.POINTS);
"30m".SetPaintingStrategy(paintingStrategy = PaintingStrategy.POINTS);
"1H".SetPaintingStrategy(paintingStrategy = PaintingStrategy.POINTS);
"1D".SetPaintingStrategy(paintingStrategy = PaintingStrategy.POINTS);

"1m".SetLineWeight(5);
"5m".SetLineWeight(5);
"15m".SetLineWeight(5);
"30m".SetLineWeight(5);
"1H".SetLineWeight(5);
"1D".SetLineWeight(5);

"1m".HideBubble();
"5m".HideBubble();
"15m".HideBubble();
"30m".HideBubble();
"1H".HideBubble();
"1D".HideBubble();

#---------- 1min ----------
def color1      = GetCandleType(AggregationPeriod.MIN).color;
"1m".AssignValueColor(if color1 == 1 then GlobalColor("2up") else if color1 == 2 then GlobalColor("2down") else color.light_gray);

#---------- 5min ----------
def color5      = GetCandleType(AggregationPeriod.FIVE_MIN).color;
"5m".AssignValueColor(if color5 == 1 then GlobalColor("2up") else if color5 == 2 then GlobalColor("2down") else color.light_gray);

#---------- 15min ----------
def color15      = GetCandleType(AggregationPeriod.FIFTEEN_MIN).color;
"15m".AssignValueColor(if color15 == 1 then GlobalColor("2up") else if color15 == 2 then GlobalColor("2down") else color.light_gray);

#---------- 30min ----------
def color30      = GetCandleType(AggregationPeriod.THIRTY_MIN).color;
"30m".AssignValueColor(if color30 == 1 then GlobalColor("2up") else if color30 == 2 then GlobalColor("2down") else color.light_gray);

#---------- 1H ----------
def color1H      = GetCandleType(AggregationPeriod.HOUR).color;
"1H".AssignValueColor(if color1H == 1 then GlobalColor("2up") else if color1H == 2 then GlobalColor("2down") else color.light_gray);

#---------- 1D ----------
def color1D      = GetCandleType(AggregationPeriod.DAY).color;
"1D".AssignValueColor(if color1D == 1 then GlobalColor("2up") else if color1D == 2 then GlobalColor("2down") else color.light_gray);

All this code does is show a green dot a 2U candle, a red dot for a 2D, or a gray dot for a doji from the 1 minute up to the chosen max aggregation period. For me, this provides some amazing trading opportunities on the 1m chart when paired with other indicators. (Yeah, yeah, I'm aware that the STRAT frowns upon indicators. Please forgive me.) But the only problem I have is that it repaints. I need that to stop. Does anyone know how to fix this issue?

Thanks in advance.
 
using higher time frame Aggregations on lower time frames will always repaint until the highest time frame completes it's calculation.

It helps with knowing which way the higher time frame is leaning though!
 
I have a question on the TOS scripts. I took the liberty to download Strat Bars Numbers 2.0 and copied the code for ones and three. Works great on my laptop but not on IPad . Anything special I should do to convert?

Any help would be appreciated

Jim Shaw
 
Last edited by a moderator:
using higher time frame Aggregations on lower time frames will always repaint until the highest time frame completes it's calculation.

It helps with knowing which way the higher time frame is leaning though!
Is there a way to use recursion to somewhat handle the repainting issue?
 
So if anyone has tried to use any of these indicators on mobile youll find they dont work. I tried to modify just the simple strat numbers indicator the best way I could (basic thinkscript understanding). If anyone has an even better way to make this work on MOBILE please chime in. I was forced to use arrows and must resort to coloring them differently to note a 1 from a 2 and 3.

Screenshot:
https://ibb.co/C8kv3SP

Code:
#------------------------------------
# S T R A T    N U M B E R S
#
# A study by Ramon DV. aka Pelonsax
#
# Version 1.0  8/01/20
#
# Version 2.0 8/4/20 Corrected errors in logic for scenarios
#
# Version 3.1 3/13/22 Modified to work with mobile app by SilverWolf
#
#------------------------------------
#------------------------------------
# DEFINE SCENARIOS
#------------------------------------
def H = high;
def L = low;
def C = close;
def O = open;

def insidebar =  (H < H[1] and L > L[1]) or (H == H[1] and L > L[1]) or (H < H[1] and L == L[1]) or (H == H[1] and L == L[1]);
def outsidebar =  H  > H[1] and L <  L[1];
def twoup  = H > H[1] and L >= L[1];
def twodown  = H <= H[1] and L < L[1];

#------------------------------------
# STRAT NUMBERS
#------------------------------------
input Show_Strat_Numbers = yes;
input Show_Twos = yes;
plot barType1 = if Show_Strat_Numbers and insidebar then 1 else Double.NaN;
barType1.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
barType1.AssignValueColor(Color.YELLOW);

plot barType3 = if Show_Strat_Numbers and outsidebar then 3 else Double.NaN;
barType3.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
barType3.AssignValueColor(Color.BLUE);

plot barTypeDN = if Show_Strat_Numbers and !insidebar and !outsidebar and Show_Twos and twodown then 2 else Double.NaN;
barTypeDN.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
barTypeDN.AssignValueColor(Color.RED);

plot barTypeUP = if Show_Strat_Numbers and !insidebar and !outsidebar and Show_Twos and twoup then 2 else Double.NaN;
barTypeUP.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
barTypeUP.AssignValueColor(Color.GREEN);
 
Last edited:

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

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
305 Online
Create Post

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