Overall Statistics
Total Orders
11180
Average Win
0.15%
Average Loss
-0.09%
Compounding Annual Return
66.910%
Drawdown
16.100%
Expectancy
0.548
Start Equity
100000
End Equity
1485637.82
Net Profit
1385.638%
Sharpe Ratio
2.263
Sortino Ratio
2.883
Probabilistic Sharpe Ratio
99.728%
Loss Rate
43%
Win Rate
57%
Profit-Loss Ratio
1.71
Alpha
0.356
Beta
0.728
Annual Standard Deviation
0.188
Annual Variance
0.036
Information Ratio
2.214
Tracking Error
0.149
Treynor Ratio
0.586
Total Fees
$32180.33
Estimated Strategy Capacity
$3600000.00
Lowest Capacity Asset
VIXM UT076X30D0MD
Portfolio Turnover
14.34%
#region imports
from AlgorithmImports import *
#endregion


# Your New Python File
#region imports
from AlgorithmImports import *
#endregion
from AlgorithmImports import *
from indicators import *
from main import YellowCatStrat

class TQQQFTLTStrategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
        if GetCurrentPrice(self.algorithm,'SPY') > SMA(self.algorithm, 'SPY', 200):
            if RSI(self.algorithm, 'TQQQ', 10) > 78:
                AH(self.algorithm, ['SPXU', 'UVXY', 'SQQQ'], 1, 0.33)
            else:
                if RSI(self.algorithm, 'SPXL', 10) > 79:
                    AH(self.algorithm, ['SPXU', 'UVXY', 'SQQQ'], 1, 0.33)
                else:
                    if CumReturn(self.algorithm, 'TQQQ', 4) > 0.2:
                        if RSI(self.algorithm, 'TQQQ', 10) < 31:
                            AH(self.algorithm, 'TQQQ', 1, 1)
                        else:
                            if RSI(self.algorithm, 'UVXY', 10) > RSI(self.algorithm, 'SQQQ', 10):
                                AH(self.algorithm, ['SPXU', 'UVXY', 'SQQQ'], 1, 0.33)
                            else:
                                AH(self.algorithm, 'SQQQ', 1, 1)
                    else:
                        AH(self.algorithm, 'TQQQ', 1, 1)
        else:
            if RSI(self.algorithm, 'TQQQ', 10) < 31:
                AH(self.algorithm, 'TECL', 1, 1)
            else:
                if RSI(self.algorithm, 'SMH', 10) < 30:
                    AH(self.algorithm, 'SOXL', 1, 1)
                else:
                    if RSI(self.algorithm, 'DIA', 10) < 27:
                        AH(self.algorithm, 'UDOW', 1, 1)
                    else:
                        if RSI(self.algorithm, 'SPY', 14) < 28:
                            AH(self.algorithm, 'UPRO', 1, 1)
                        else:
                            self.Group1()
                            self.Group2()

    def Group1(self):
        if CumReturn(self.algorithm, 'QQQ', 200) < -0.2:
            if GetCurrentPrice(self.algorithm,'QQQ') < SMA(self.algorithm, 'QQQ', 20):
                if CumReturn(self.algorithm, 'QQQ', 60) < -0.12:
                    self.Group5()
                    self.Group6()
                else:
                    if RSI(self.algorithm, 'TLT', 10) > RSI(self.algorithm, 'SQQQ', 10):
                        AH(self.algorithm, 'TQQQ', 1, 0.5)
                    else:
                        AH(self.algorithm, 'SQQQ', 1, 0.5)
            else:
                if RSI(self.algorithm, 'SQQQ', 10) < 31:
                    AH(self.algorithm, 'PSQ', 1, 0.5)
                else:
                    if CumReturn(self.algorithm, 'QQQ', 9) > 0.055:
                        AH(self.algorithm, 'PSQ', 1, 0.5)
                    else:
                        if RSI(self.algorithm, 'TQQQ', 10) > RSI(self.algorithm, 'SOXL', 10):
                            AH(self.algorithm, 'TQQQ', 1, 0.5)
                        else:
                            AH(self.algorithm, 'SOXL', 1, 0.5)

    def Group2(self):
        if GetCurrentPrice(self.algorithm,'QQQ') < SMA(self.algorithm, 'QQQ', 20):
            if CumReturn(self.algorithm, 'QQQ', 60) < -0.12:
                self.Group3()
                self.Group4()
            else:
                if RSI(self.algorithm, 'TLT', 10) > RSI(self.algorithm, 'SQQQ', 10):
                    AH(self.algorithm, 'TQQQ', 1, 0.5)
                else:
                    AH(self.algorithm, 'SQQQ', 1, 0.5)
        else:
            if RSI(self.algorithm,'TQQQ', 10) > RSI(self.algorithm,'SOXL', 10):
                AH(self.algorithm, 'TQQQ', 1, 0.5)
            else:
                AH(self.algorithm, 'SOXL', 1, 0.5)

    def Group3(self):
        if GetCurrentPrice(self.algorithm,'SPY') > SMA(self.algorithm, 'SPY', 20):
            AH(self.algorithm, 'SPY', 1, 0.25)
        else:
            if RSI(self.algorithm, 'TLT', 10) > RSI(self.algorithm, 'SQQQ', 10):
                AH(self.algorithm, 'QQQ', 1, 0.25)
            else:
                AH(self.algorithm, 'PSQ', 1, 0.25)

    def Group4(self):
        if RSI(self.algorithm, 'TLT', 10) > RSI(self.algorithm, 'SQQQ', 10):
            AH(self.algorithm, 'QQQ', 1, 0.25)
        else:
            AH(self.algorithm, 'PSQ', 1, 0.25)

    def Group5(self):
        if GetCurrentPrice(self.algorithm,'SPY') > SMA(self.algorithm, 'SPY', 20):
            AH(self.algorithm, 'SPY', 1, 0.25)
        else:
            if RSI(self.algorithm, 'TLT', 10) > RSI(self.algorithm, 'SQQQ', 10):
                AH(self.algorithm, 'QQQ', 1, 0.25)
            else:
                AH(self.algorithm, 'PSQ', 1, 0.25)
    def Group6(self):
        if RSI(self.algorithm, 'TLT', 10) > RSI(self.algorithm, 'SQQQ', 10):
            AH(self.algorithm, 'QQQ', 1, 0.25)
        else:
            AH(self.algorithm, 'PSQ', 1, 0.25)

class TQQQorNotStrategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
        if RSI(self.algorithm,'TQQQ',10) > 78:
            AH(self.algorithm,['SPXU','UVXY','SQQQ'],2,1/3)
        else:
            if CumReturn(self.algorithm,'TQQQ',6) < -0.12:
                if CumReturn(self.algorithm,'TQQQ',1) > 0.055:
                    AH(self.algorithm,['SPXU','UVXY','SQQQ'],2,1/3)
                else:
                    if RSI(self.algorithm,'TQQQ',10) < 32:
                        AH(self.algorithm,'TQQQ',2,1)
                    else:
                        if MaxDD(self.algorithm,'TMF',10)<0.07:
                            AH(self.algorithm,'TQQQ',2,1)
                        else:
                            AH(self.algorithm,'BIL',2,1)
            else:
                if MaxDD(self.algorithm,'QQQ',10)>0.06:
                    AH(self.algorithm,'BIL',2,1)
                else:
                    if MaxDD(self.algorithm,'TMF',10)>0.07:
                        AH(self.algorithm,'BIL',2,1)
                    else:
                        if GetCurrentPrice(self.algorithm,'QQQ') > SMA(self.algorithm,'QQQ', 25):
                            AH(self.algorithm,'TQQQ',2,1)
                        else:
                            if RSI(self.algorithm,'SPY',60) > 50:
                                if RSI(self.algorithm,'BND',45) > RSI(self.algorithm,'SPY',45):
                                    AH(self.algorithm,'TQQQ',2,1)
                                else:
                                    AH(self.algorithm,'BIL',2,1)
                            else:
                                if RSI(self.algorithm,'IEF',200) < RSI(self.algorithm,'TLT',200):
                                    if RSI(self.algorithm,'BND',45) > RSI(self.algorithm,'SPY',45):
                                        AH(self.algorithm,'TQQQ',2,1)
                                    else:
                                        AH(self.algorithm,'BIL',2,1)
                                else:
                                    AH(self.algorithm,'BIL',2,1)



class DereckCustomBetaBallerStrategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
        self.DereckCustomBetaBaller()

    def DereckCustomBetaBaller(self):
        if SMADayRet(self.algorithm,'TLT',350) < SMADayRet(self.algorithm,'TLT',550):
            if GetCurrentPrice(self.algorithm,'SPY') < SMA(self.algorithm,'SPY',200):
                self.V1()
            else:
                self.B2()
        else:
            self.N3()
    def V1(self):
        if RSI(self.algorithm,'BIL',8) < 35:
            if RSI(self.algorithm,'TQQQ',10) > 80:
                self.O6()
            else:
                AH(self.algorithm,'SOXL',3,1)
        else:
            if RSI(self.algorithm,'SPY',6) < 27:
                self.E77()
            else:
                self.B5()
    def O6(self):
        Sort(self.algorithm,"RSI",["VIXM","VIXY"],13,False,1,3,1)

    def E77(self):
        if RSI(self.algorithm,'BSV',7) < RSI(self.algorithm,'SPHB',7):
            Sort(self.algorithm,"RSI",["SOXS","SOXS"],7,False,1,3,1)
        else:
           Sort(self.algorithm,"RSI",["SOXL","TECL"],7,False,1,3,1)
    def B5(self):
        if RSI(self.algorithm,'BSV',7) > RSI(self.algorithm,'SHY',7):
            self.B4()
        else:
            AH(self.algorithm,'SOXL',3,1)
    def B4(self):
        if RSI(self.algorithm,'QQQ',10) < 30:
            Sort(self.algorithm,"SMADayRet",["TQQQ","SPXL","SOXL","UPRO"],5,True,1,3,1)
        else:
            if RSI(self.algorithm,'SPY',10) < 30:
                AH(self.algorithm,'UPRO',3,1)
            else:
                if GetCurrentPrice(self.algorithm,'QLD') > SMA(self.algorithm,'QLD',20):
                    self.B14()
                else:
                    self.A42()
    def B14(self):
        if 50 > RSI(self.algorithm,'IEF',7):
            self.B15()
        else:
            if RSI(self.algorithm,'SPY',6) > 75:
                AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
            else:
                AH(self.algorithm,'SOXL',3,1)
    def B15(self):
        if GetCurrentPrice(self.algorithm,'TLT') < SMA(self.algorithm,'TLT',21):
            self.B16()
        else:
            self.B17()
    def B16(self):
        if EMA(self.algorithm,'SPY',210) <= SMA(self.algorithm,'SPY',360):
            if RSI(self.algorithm,'TQQQ',10) < 30:
                Sort(self.algorithm,"SMADayRet",["TQQQ","SOXL","UPRO"],5,True,1,3,1)
            else:
                if CumReturn(self.algorithm,'SPY',2) < -0.02:
                    Sort(self.algorithm,"CumReturn",["SPXS","TECS","SOXS","SQQQ","ERX"],5,False,1,3,1)
                else:
                    if CumReturn(self.algorithm,'SPXU',6) > CumReturn(self.algorithm,'UPRO',3):
                        Sort(self.algorithm,"CumReturn",["SOXS","SQQQ","EPI"],5,True,1,3,1)
                    else:
                        Sort(self.algorithm,"SMADayRet",["TECL","SOXL","TMV"],5,False,1,3,1)
        else:
            if SMADayRet(self.algorithm,'SPY',210) > SMADayRet(self.algorithm,'DBC',360):
                if RSI(self.algorithm,'TQQQ',11) > 77:
                    AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
                else:
                    if CumReturn(self.algorithm,'TQQQ',6) < -0.1:
                        if CumReturn(self.algorithm,'TQQQ',1) > 0.055:
                            AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
                        else:
                            Sort(self.algorithm,"SMADayRet",["SOXL","IYK","TMV"],5,False,1,3,1)
                    else:
                        if 50 < RSI(self.algorithm,'IEF',7):
                            Sort(self.algorithm,"SMADayRet",["TQQQ","IYK","SOXL","UPRO","TECL"],5,True,1,3,1)
                        else:
                            Sort(self.algorithm,"SMADayRet",["SOXL","IYK","UPRO"],22,False,1,3,1)
            else:
                self.Defence()
    def Defence(self):
        if STD(self.algorithm,'DBC',20) > STD(self.algorithm,'SPY',20):
            if STD(self.algorithm,'DBC',10) > 0.03:
                if STD(self.algorithm,'TMV',5) < STD(self.algorithm,'DBC',5):
                    AH(self.algorithm,'TMV',3,1)
                else:
                    AH(self.algorithm,'DBC',3,1)
            else:
                if 50 < RSI(self.algorithm,'IEF',7):
                    Sort(self.algorithm,"SMADayRet",["TMV","SOXS","SPXU"],5,True,1,3,1)

                else:
                    Sort(self.algorithm,"CumReturn",["EFA","EEM","SPXS","SOXS","UCO","TMV"],5,False,1,3,1)
        else:
            if 50 < RSI(self.algorithm,'IEF',7):
                Sort(self.algorithm,"SMADayRet",["EPI","SOXL","UPRO","IYK"],5,False,1,3,1)

            else:
                Sort(self.algorithm,"CumReturn",["EWZ","TECS","SOXS","EUO","YCS","TMV"],5,False,1,3,1)
    def B17(self):
        if EMA(self.algorithm,'SPY',210) <= SMA(self.algorithm,'SPY',360):
            if CumReturn(self.algorithm,'SPY',2) < -0.02:
                Sort(self.algorithm,"SMADayRet",["SPXS","TECS","SOXS","SQQQ"],5,True,1,3,1)
            else:
                if CumReturn(self.algorithm,'SPXU',6) > CumReturn(self.algorithm,'UPRO',3):
                    Sort(self.algorithm,"CumReturn",["BIL","AGG","TMF"],5,False,1,3,1)
                else:
                    Sort(self.algorithm,"SMADayRet",["TECL","SOXL","TQQQ","EWZ","TMF"],5,False,1,3,1)
        else:
            if SMADayRet(self.algorithm,'SPY',210) > SMADayRet(self.algorithm,'DBC',360):
                if EMA(self.algorithm,'SPY',210) > EMA(self.algorithm,'SPY',360):
                    if RSI(self.algorithm,'TQQQ',11) > 77:
                        AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
                    else:
                        if CumReturn(self.algorithm,'TQQQ',6) < -0.1:
                            if CumReturn(self.algorithm,'TQQQ',1) > 0.055:
                                AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
                            else:
                                Sort(self.algorithm,"SMADayRet",["TECL","TQQQ","SPXL","EPI","SOXL","UPRO","QLD","EWZ","MVV","XLU","IYK","USD","TMF"],7,False,1,3,1)
                        if 50 < RSI(self.algorithm,'IEF',7):
                            Sort(self.algorithm,"SMADayRet",["TECL","SPXL","EPI","SOXL","UPRO","MVV"],7,False,1,3,1)
                        else:
                            Sort(self.algorithm,"CumReturn",["SOXS","TMF"],5,True,1,3,1)
                else:
                    Sort(self.algorithm,"RSI",["SPXS","SQQQ","TECS","SOXS"],5,False,1,3,1)
            else:
                self.Defence2()
    def Defence2(self):
        if STD(self.algorithm,'DBC',20) > STD(self.algorithm,'SPY',20):
            Sort(self.algorithm,"RSI",["SPXS","EPI","TECS","SOXS","SQQQ"],5,False,1,3,1)
        else:
            Sort(self.algorithm,"SMADayRet",["TECL","TQQQ","SOXL","TMF"],5,True,1,3,1)
    def A42(self):
        if RSI(self.algorithm,'TQQQ',9) < 32:
            if CumReturn(self.algorithm,'TQQQ',2) > CumReturn(self.algorithm,'TQQQ',5):
                self.A41()
            else:
                Sort(self.algorithm,"RSI",["TMF","UCO","USD","SOXL","SQQQ"],5,False,1,3,1)
        else:
             self.A43()
    def A41(self):
        self.Substrategy1()
        self.Substrategy2()
    def Substrategy1(self):
        Sort(self.algorithm,"RSI",["TECL","SOXL","SHY"],10,False,1,3,0.5)
    def Substrategy2(self):
        Sort(self.algorithm,"RSI",["SHY","SOXL"],5,False,1,3,0.5)
    def A43(self):
        if GetCurrentPrice(self.algorithm,'TLT') > SMA(self.algorithm,'TLT',200):
            self.A19()
        else:
            self.B18()
    def A19(self):
        if SMADayRet(self.algorithm,'TLT',20) < 0:
            self.A44()
        else:
            self.A55()
    def A44(self):
        if EMA(self.algorithm,'SPY',210) <= SMA(self.algorithm,'SPY',360):
            if RSI(self.algorithm,'TQQQ',10) < 30:
                Sort(self.algorithm,"SMADayRet",["TECL","TQQQ","SOXL","UPRO"],5,False,1,3,1)
            else:
                if CumReturn(self.algorithm,'SPXU',6) > CumReturn(self.algorithm,'UPRO',3):
                    Sort(self.algorithm,"CumReturn",["SOXS","EUO","YCS"],5,True,1,3,1)
                else:
                    Sort(self.algorithm,"SMADayRet",["TECL","SOXL","TQQQ","CURE"],5,False,1,3,1)
        else:
            if RSI(self.algorithm,'TQQQ',11) > 77:
                AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
            else:
                Sort(self.algorithm,"SMADayRet",["SOXL","TECL","TMV","TQQQ","UPRO"],5,False,1,3,1)
    def A55(self):
        if EMA(self.algorithm,'SPY',210) <= SMA(self.algorithm,'SPY',360):
            if RSI(self.algorithm,'TQQQ',10) < 30:
                Sort(self.algorithm,"SMADayRet",["TECL","SOXL","TQQQ"],5,False,1,3,1)
            else:
                if CumReturn(self.algorithm,'SPY',2) < -0.02:
                    Sort(self.algorithm,"CumReturn",["TECS","SOXS","SQQQ"],5,True,1,3,1)
                else:
                    if CumReturn(self.algorithm,'SPXU',6) > CumReturn(self.algorithm,'UPRO',3):
                        Sort(self.algorithm,"CumReturn",["ERX","EUO","YCS"],5,True,1,3,1)
                    else:
                        Sort(self.algorithm,"SMADayRet",["EWZ","SOXL","MVV","USD"],5,False,1,3,1)
        else:
            if SMADayRet(self.algorithm,'SPY',210) > SMADayRet(self.algorithm,'DBC',360):
                if RSI(self.algorithm,'TQQQ',11) > 77:
                    AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
                else:
                    if CumReturn(self.algorithm,'TQQQ',6) < -0.1:
                        if CumReturn(self.algorithm,'TQQQ',1) > 0.055:
                            AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
                        else:
                            if 50 < RSI(self.algorithm,'IEF',7):
                                AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
                            else:
                                Sort(self.algorithm,"CumReturn",["EWZ","UUP","TMF","UCO"],5,True,1,3,1)
                    else:
                        if 50 < RSI(self.algorithm,'IEF',7):
                            Sort(self.algorithm,"SMADayRet",["TQQQ","SPXL","QLD","USD","TECL"],5,False,1,3,1)
                        else:
                            Sort(self.algorithm,"CumReturn",["EWZ","EWZ","TMF"],5,True,1,3,1)
            else:
                self.Defence3()
    def Defence3(self):
        if STD(self.algorithm,'DBC',20) > STD(self.algorithm,'SPY',20):
            Sort(self.algorithm,"RSI",["SHY","EWZ","GLD","SPXS","TECS","SOXS","UCO","YCS"],5,False,1,3,1)
        else:
            if 50 < RSI(self.algorithm,'IEF',7):
                Sort(self.algorithm,"SMADayRet",["SOXL","USD","TMF"],5,False,1,3,1)
            else:
                Sort(self.algorithm,"CumReturn",["EWZ","SPXS","SOXS","UCO","YCS"],5,True,1,3,1)
    def B18(self):
        if SMADayRet(self.algorithm,'TLT',20) < 0:
            self.A57()
        else:
            self.B17()
    def A57(self):
        if EMA(self.algorithm,'SPY',210) <= SMA(self.algorithm,'SPY',360):
            if RSI(self.algorithm,'TQQQ',10) < 30:
                Sort(self.algorithm,"SMADayRet",["TQQQ","SOXL","UPRO"],5,True,1,3,1)
            else:
                if CumReturn(self.algorithm,'SPY',2) < -0.02:
                    Sort(self.algorithm,"CumReturn",["SPXS","TECS","SOXS","SQQQ","ERX"],5,False,1,3,1)
                else:
                    if CumReturn(self.algorithm,'SPXU',6) > CumReturn(self.algorithm,'UPRO',3):
                        Sort(self.algorithm,"CumReturn",["SOXS","SQQQ","EPI"],5,True,1,3,1)
                    else:
                        Sort(self.algorithm,"SMADayRet",["TECL","SOXL","TMV"],5,False,1,3,1)
        else:
            if SMADayRet(self.algorithm,'SPY',210) > SMADayRet(self.algorithm,'DBC',360):
                if RSI(self.algorithm,'TQQQ',11) > 77:
                    AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
                else:
                    if CumReturn(self.algorithm,'TQQQ',6) < -0.1:
                        if CumReturn(self.algorithm,'TQQQ',1) > 0.055:
                            AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
                        else:
                            Sort(self.algorithm,"SMADayRet",["SOXL","IYK","TMV"],5,False,1,3,1)
                    else:
                        if 50 < RSI(self.algorithm,'IEF',7):
                            Sort(self.algorithm,"SMADayRet",["TQQQ","SOXL","IYK","TMV","UPRO","TECL"],5,True,1,3,1)
                        else:
                            Sort(self.algorithm,"SMADayRet",["SOXL","IYK","UPRO"],22,False,1,3,1)
            else:
                self.Defence()
    def B2(self):
        if RSI(self.algorithm,'SPY',40) > 75:
            if 50 < RSI(self.algorithm,'IEF',7):
                AH(self.algorithm,'QQQ',3,1)
            else:
                AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
        else:
            self.A54()
    def A54(self):
        if 50 > RSI(self.algorithm,'IEF',7):
            self.A53()
        else:
            if RSI(self.algorithm,'SPY',6) > 75:
                AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
            else:
                AH(self.algorithm,'SOXL',3,1)
    def A53(self):
        if RSI(self.algorithm,'TQQQ',14) > 75:
            AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
        else:
            if RSI(self.algorithm,'SPXL',10) > 80:
                AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
            else:
                self.B23()
    def B23(self):
        if GetCurrentPrice(self.algorithm,'TLT') > SMA(self.algorithm,'TLT',200):
            self.A24()
        else:
            self.A52()
    def A24(self):
        if RSI(self.algorithm,'TLT',14) < 50:
            self.A22()
        else:
            self.A26()
    def A22(self):
        if GetCurrentPrice(self.algorithm,'TLT') > SMA(self.algorithm,'TLT',5):
            self.A25()
        else:
            self.A51()
    def A25(self):
        if EMA(self.algorithm,'SPY',210) <= SMA(self.algorithm,'SPY',360):
            if RSI(self.algorithm,'TQQQ',10) < 30:
                Sort(self.algorithm,"SMADayRet",["TQQQ","SOXL","UPRO","TECL","SPXL"],5,True,1,3,1)
            else:
                if CumReturn(self.algorithm,'SPXU',6) > CumReturn(self.algorithm,'UPRO',3):
                    Sort(self.algorithm,"CumReturn",["TECS","SOXS","SQQQ","TMF","SHY"],5,True,1,3,1)
                else:
                    Sort(self.algorithm,"SMADayRet",["TECL","SOXL","UPRO","EWZ","TMF","TQQQ"],5,False,1,3,1)
        else:
            if CumReturn(self.algorithm,'TQQQ',6) < -0.1:
                Sort(self.algorithm,"SMADayRet",["TECL","TQQQ","TMF"],7,False,1,3,1)
            else:
                Sort(self.algorithm,"SMADayRet",["SOXL","TMF"],7,False,1,3,1)
    def A51(self):
        if RSI(self.algorithm,'TLT',14) < 20:
            AH(self.algorithm,'SHY',3,1)
        else:
            if SMADayRet(self.algorithm,'TLT',20) < 0:
                self.A21()
            else:
                self.A50()
    def A21(self):
        if EMA(self.algorithm,'SPY',210) <= SMA(self.algorithm,'SPY',360):
            if CumReturn(self.algorithm,'SPXU',6) >= CumReturn(self.algorithm,'UPRO',3):
                Sort(self.algorithm,"CumReturn",["SOXS","ERX","SHY"],5,True,1,3,1)
            else:
                Sort(self.algorithm,"SMADayRet",["TQQQ","SOXL","CURE","EWZ","SHY"],5,False,1,3,1)
        else:
            if SMA(self.algorithm,'SPY',210) > SMA(self.algorithm,'DBC',360):
                if RSI(self.algorithm,'TQQQ',11) > 77:
                    AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
                else:
                    if CumReturn(self.algorithm,'TQQQ',6) < -0.1:
                        if CumReturn(self.algorithm,'TQQQ',1) > 0.055:
                            AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
                        else:
                            Sort(self.algorithm,"SMADayRet",["TECL","TQQQ","SOXL","UPRO","TMV","SHY"],5,False,1,3,1)
                    else:
                        Sort(self.algorithm,"SMADayRet",["TECL","TQQQ","SOXL","UPRO","TMV","SHY"],5,True,1,3,1)
            else:
                self.A49()
    def A49(self):
        if STD(self.algorithm,'DBC',20) > STD(self.algorithm,'SPY',20):
            Sort(self.algorithm,"RSI",["EEM","TECS","SOXS","TMV"],5,False,1,3,1)
        else:
            Sort(self.algorithm,"RSI",["EEM","TECS","SOXS","TMV"],10,False,1,3,1)
    def A50(self):
        if EMA(self.algorithm,'SPY',210) <= SMA(self.algorithm,'SPY',360):
            if CumReturn(self.algorithm,'SPXU',6) >= CumReturn(self.algorithm,'UPRO',3):
                Sort(self.algorithm,"SMADayRet",["TQQQ","SOXL","UPRO","TECL","TMF"],5,True,1,3,1)
            else:
                Sort(self.algorithm,"SMADayRet",["TECL","TQQQ","SOXL","TMF"],5,False,1,3,1)
        elif SMADayRet(self.algorithm,'SPY',210) > SMADayRet(self.algorithm,'DBC',360):
            if RSI(self.algorithm,'TQQQ',11) > 77:
                AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
            elif CumReturn(self.algorithm,'TQQQ',6) < -0.1:
                if CumReturn(self.algorithm,'TQQQ',1) > 0.055:
                    AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
                else:
                    Sort(self.algorithm,"SMADayRet",["TECL","TQQQ","SPXL","EPI","SOXL","UPRO","QLD","EWZ","MVV","PUI","IYK","USD","TMF"],7,False,1,3,1)
            else:
                if 50 < RSI(self.algorithm,'IEF',7):
                    Sort(self.algorithm,"SMADayRet",["TECL","TQQQ","SOXL","PUI"],5,False,1,3,1)
                else:
                    Sort(self.algorithm,"CumReturn",["SOXS","SQQQ","UCO","DIG"],5,False,1,3,1)
        else:
            Sort(self.algorithm,"SMADayRet",["EPI","UPRO","SOXL","TQQQ"],5,True,1,3,1)
    def A26(self):
        if RSI(self.algorithm,'TLT',14) > 80:
            self.A27()
        else:
            if GetCurrentPrice(self.algorithm,'TLT') < SMA(self.algorithm,'TLT',21):
                self.A44()
            else:
                self.A55()
    def A27(self):
        if SMADayRet(self.algorithm,'SPY',210) > SMADayRet(self.algorithm,'DBC',360):
            if CumReturn(self.algorithm,'TQQQ',6) < -0.1:
                if CumReturn(self.algorithm,'TQQQ',1) > 0.055:
                    AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
                else:
                    Sort(self.algorithm,"SMADayRet",["TECL","TQQQ","SOXL","UPRO"],5,False,1,3,1)
            else:
                Sort(self.algorithm,"RSI",["SQQQ","TECS","SOXS","TMV"],5,True,1,3,1)
        else:
            Sort(self.algorithm,"SMADayRet",["EPI","UPRO","SOXL","TQQQ","TMV"],5,True,1,3,1)
    def A52(self):
        if GetCurrentPrice(self.algorithm,'TLT') < SMA(self.algorithm,'TLT',21):
            self.A57()
        else:
            self.A56()
    def A56(self):
        if EMA(self.algorithm,'SPY',210) <= SMA(self.algorithm,'SPY',360):
            if CumReturn(self.algorithm,'SPY',2) <= -0.02:
                Sort(self.algorithm,"CumReturn",["SPXS","TECS","SOXS","SQQQ"],5,True,1,3,1)
            elif CumReturn(self.algorithm,'SPXU',6) >= CumReturn(self.algorithm,'UPRO',3):
                Sort(self.algorithm,"CumReturn",["BIL","AGG","TMF"],5,False,1,3,1)
            else:
                Sort(self.algorithm,"SMADayRet",["TECL","TQQQ","SOXL","EWZ","TMF"],5,False,1,3,1)
        elif SMADayRet(self.algorithm,'SPY',210) > SMADayRet(self.algorithm,'DBC',360):
            if EMA(self.algorithm,'SPY',210) > EMA(self.algorithm,'SPY',360):
                if RSI(self.algorithm,'TQQQ',11) > 77:
                    AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
                elif CumReturn(self.algorithm,'TQQQ',6) < -0.1:
                    if CumReturn(self.algorithm,'TQQQ',1) > 0.055:
                        AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
                    else:
                        Sort(self.algorithm,"SMADayRet",["TECL","TQQQ","SPXL","EPI","SOXL","UPRO","QLD","EWZ","MVV","XLU","IYK","USD","TMF"],7,False,1,3,1)
                elif 50 < RSI(self.algorithm,'IEF',7):
                    Sort(self.algorithm,"SMADayRet",["TECL","SPXL","EPI","SOXL","UPRO","MVV","UGE"],7,False,1,3,1)
                else:
                    Sort(self.algorithm,"CumReturn",["SOXS","TMF"],5,True,1,3,1)
            else:
                Sort(self.algorithm,"RSI",["SPXS","SQQQ","TECS","SOXS"],5,False,1,3,1)
        else:
            self.Defence2()
    def N3(self):
        if GetCurrentPrice(self.algorithm,'SPY') > SMA(self.algorithm,'SPY',200):
            if RSI(self.algorithm,'QQQ',14) > 80:
                AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
            else:
                if RSI(self.algorithm,'SPY',10) > 80:
                    AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
                else:
                    self.A31()
        else:
            if RSI(self.algorithm,'TQQQ',9) < 32:
                if CumReturn(self.algorithm,'TQQQ',2) >= CumReturn(self.algorithm,'TQQQ',5):
                    self.A41()
                else:
                    if RSI(self.algorithm,'SPY',10) < 30:
                        self.A40()
                    else:
                        if GetCurrentPrice(self.algorithm,'TQQQ') > SMA(self.algorithm,'TQQQ',20):
                            if RSI(self.algorithm,'SQQQ',10) < 31:
                                AH(self.algorithm,'SQQQ',3,1)
                            else:
                                AH(self.algorithm,'TQQQ',3,1)
                        else:
                            Sort(self.algorithm,"RSI",["TMF","UCO","USD","SOXL","SQQQ"],5,False,1,3,1)
            else:
                self.A31()
    def A31(self):
        if GetCurrentPrice(self.algorithm,'TLT') > SMA(self.algorithm,'TLT',200):
            self.A30()
        else:
            self.A37()
    def A30(self):
        if RSI(self.algorithm,'TLT',14) < 50:
            self.A29()
        else:
            self.A28()
    def A29(self):
        if GetCurrentPrice(self.algorithm,'TLT') > SMA(self.algorithm,'TLT',5):
            self.A32()
        else:
            self.A33()
    def A32(self):
        if EMA(self.algorithm,'SPY',210) <= SMA(self.algorithm,'SPY',360):
            if RSI(self.algorithm,'TQQQ',10) < 30:
                Sort(self.algorithm,"SMADayRet",["TECL","TQQQ","SOXL","UPRO"],5,True,1,3,1)
            else:
                if CumReturn(self.algorithm,'SPXU',6) >= CumReturn(self.algorithm,'UPRO',3):
                    Sort(self.algorithm,"CumReturn",["TECS","SOXS","SQQQ","TMF","SHY"],5,True,1,3,1)
                else:
                    Sort(self.algorithm,"SMADayRet",["TECL","TQQQ","SOXL","UPRO","EWZ","TMF"],5,False,1,3,1)
        else:
            if CumReturn(self.algorithm,'TQQQ',6) < -0.1:
                Sort(self.algorithm,"SMADayRet",["TECL","TQQQ","TMF"],7,False,1,3,1)
            else:
                Sort(self.algorithm,"SMADayRet",["SOXL","TMF"],7,False,1,3,1)
    def A33(self):
        if RSI(self.algorithm,'TLT',14) < 20:
            AH(self.algorithm,'TMF',3,1)
        else:
            if SMADayRet(self.algorithm,'TLT',20) < 0:
                self.A21()
            else:
                self.A34()
    def A34(self):
        if EMA(self.algorithm,'SPY',210) <= SMA(self.algorithm,'SPY',360):
            if CumReturn(self.algorithm,'SPXU',6) >= CumReturn(self.algorithm,'UPRO',3):
                Sort(self.algorithm,"SMADayRet",["TQQQ","SOXL","UPRO","TECL","TMF"],5,True,1,3,1)
            else:
                Sort(self.algorithm,"SMADayRet",["TECL","TQQQ","SOXL","TMF"],5,False,1,3,1)
        elif SMA(self.algorithm,'SPY',210) > SMA(self.algorithm,'DBC',360):
            if RSI(self.algorithm,'TQQQ',11) > 77:
                AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
            elif CumReturn(self.algorithm,'TQQQ',6) < -0.1:
                if CumReturn(self.algorithm,'TQQQ',1) > 0.055:
                    AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
                else:
                    Sort(self.algorithm,"SMADayRet",["TECL","TQQQ","EPI","SOXL","UPRO","QLD","EWZ","MVV","XLU","USD","TMF"],7,False,1,3,1)
            elif 50 < RSI(self.algorithm,'IEF',7):
                Sort(self.algorithm,"SMADayRet",["TECL","TQQQ","SOXL","XLU"],5,False,1,3,1)
            else:
                Sort(self.algorithm,"CumReturn",["SOXS","SQQQ","UCO","DIG"],5,False,1,3,1)
        else:
            Sort(self.algorithm,"SMADayRet",["EPI","UPRO","SOXL","TQQQ"],5,True,1,3,1)
    def A28(self):
        if RSI(self.algorithm,'TLT',14) > 80:
            self.A27()
        else:
            self.A35()
    def A35(self):
        if SMADayRet(self.algorithm,'TLT',20) < 0:
            self.A44()
        else:
            self.A36()
    def A36(self):
        if EMA(self.algorithm,'SPY',210) <= SMA(self.algorithm,'SPY',360):
            if RSI(self.algorithm,'TQQQ',10) < 30:
                Sort(self.algorithm,"SMADayRet",["TECL","TQQQ","SOXL"],5,False,1,3,1)
            elif CumReturn(self.algorithm,'SPY',2) <= -0.02:
                Sort(self.algorithm,"CumReturn",["TECS","SOXS","SQQQ"],5,True,1,3,1)
            elif CumReturn(self.algorithm,'SPXU',6) >= CumReturn(self.algorithm,'UPRO',3):
                Sort(self.algorithm,"CumReturn",["ERX","EUO","YCS"],5,True,1,3,1)
            else:
                Sort(self.algorithm,"SMADayRet",["SOXL","EWZ","MVV","USD"],5,False,1,3,1)
        elif SMADayRet(self.algorithm,'SPY',210) > SMADayRet(self.algorithm,'DBC',360):
            if RSI(self.algorithm,'TQQQ',11) > 77:
                AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
            elif CumReturn(self.algorithm,'TQQQ',6) < -0.1:
                if CumReturn(self.algorithm,'TQQQ',1) > 0.055:
                    AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
                elif 50 < RSI(self.algorithm,'IEF',7):
                    AH(self.algorithm,'SOXL',3,1)
                else:
                    Sort(self.algorithm,"CumReturn",["EWZ","UUP","TMF","UCO"],5,True,1,3,1)
            elif 50 < RSI(self.algorithm,'IEF',7):
                Sort(self.algorithm,"SMADayRet",["TECL","TQQQ","UPRO","QLD","USD"],5,False,1,3,1)
            else:
                Sort(self.algorithm,"CumReturn",["EWZ","UUP","TMF"],5,True,1,3,1)
        else:
            self.A45()
    def A45(self):
        if STD(self.algorithm,'DBC',20) > STD(self.algorithm,'SPY',20):
            Sort(self.algorithm,"RSI",["SHY","EWZ","GLD","SPXU","TECS","SOXS","UCO","YCS"],5,False,1,3,1)
        elif 50 < RSI(self.algorithm,'IEF',7):
            Sort(self.algorithm,"SMADayRet",["SOXL","USD","TMF"],5,False,1,3,1)
        else:
            Sort(self.algorithm,"CumReturn",["EWZ","SPXU","SOXS","UCO","YCS"],5,True,1,3,1)
    def A37(self):
        if GetCurrentPrice(self.algorithm,'TLT') < SMA(self.algorithm,'TLT',21):
            self.A38()
        else:
            self.A39()
    def A38(self):
        if EMA(self.algorithm,'SPY',210) <= SMA(self.algorithm,'SPY',360):
            if RSI(self.algorithm,'TQQQ',10) < 30:
                Sort(self.algorithm,"SMADayRet",["TQQQ","SOXL","UPRO"],5,True,1,3,1)
            else:
                if CumReturn(self.algorithm,'SPY',2) <= -0.02:
                    Sort(self.algorithm,"CumReturn",["SPXU","TECS","SOXS","SQQQ","ERX"],5,False,1,3,1)
                else:
                    if CumReturn(self.algorithm,'SPXU',6) >= CumReturn(self.algorithm,'UPRO',3):
                        Sort(self.algorithm,"CumReturn",["SOXS","SQQQ","EPI"],5,True,1,3,1)
                    else:
                        Sort(self.algorithm,"SMADayRet",["TECL","SOXL","TMV"],5,False,1,3,1)
        else:
            if SMA(self.algorithm,'SPY',210) > SMA(self.algorithm,'DBC',360):
                if RSI(self.algorithm,'TQQQ',11) > 77:
                    AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
                else:
                    if CumReturn(self.algorithm,'TQQQ',6) < -0.1:
                        if CumReturn(self.algorithm,'TQQQ',1) > 0.055:
                            AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
                        else:
                            Sort(self.algorithm,"SMADayRet",["SOXL","IYK","TMV"],5,False,1,3,1)
                    else:
                        if 50 < RSI(self.algorithm,'IEF',7):
                            Sort(self.algorithm,"SMADayRet",["TQQQ","SOXL","UPRO","TMV","TECL"],5,True,1,3,1)
                        else:
                            Sort(self.algorithm,"SMADayRet",["SOXL","UPRO","IYK"],22,False,1,3,1)
            else:
                self.A46()
    def A46(self):
        if STD(self.algorithm,'DBC',20) > STD(self.algorithm,'SPY',20):
            if STD(self.algorithm,'DBC',10) >= 0.03:
                if STD(self.algorithm,'TMV',5) <= STD(self.algorithm,'DBC',5):
                    AH(self.algorithm,'TMV',3,1)
                else:
                    AH(self.algorithm,'DBC',3,1)
            else:
                if 50 < RSI(self.algorithm,'IEF',7):
                    Sort(self.algorithm,"SMADayRet",["TMV","SOXS","SPXU"],5,True,1,3,1)
                else:
                    Sort(self.algorithm,"CumReturn",["EFA","EEM","SPXU","SOXS","UCO","TMV"],5,False,1,3,1)
        else:
            if 50 < RSI(self.algorithm,'IEF',7):
                Sort(self.algorithm,"SMADayRet",["EPI","SOXL","UPRO"],5,False,1,3,1)
            else:
                Sort(self.algorithm,"CumReturn",["EWZ","TECS","SOXS","EUO","YCS","TMV"],5,True,1,3,1)
    def A39(self):
        if EMA(self.algorithm,'SPY',210) <= SMA(self.algorithm,'SPY',360):
            if CumReturn(self.algorithm,'SPY',2) < -0.02:
                Sort(self.algorithm,"CumReturn",["SPXU","TECS","SOXS","SQQQ"],5,True,1,3,1)
            else:
                if CumReturn(self.algorithm,'SPXU',6) >= CumReturn(self.algorithm,'UPRO',3):
                    Sort(self.algorithm,"CumReturn",["BIL","AGG","TMF"],5,False,1,3,1)
                else:
                    Sort(self.algorithm,"CumReturn",["TECL","TQQQ","SOXL","EWZ","TMF"],5,False,1,3,1)
        else:
            if SMA(self.algorithm,'SPY',210) > SMA(self.algorithm,'DBC',360):
                if EMA(self.algorithm,'SPY',210) > EMA(self.algorithm,'SPY',360):
                    if RSI(self.algorithm,'TQQQ',11) > 77:
                        AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
                    else:
                        if CumReturn(self.algorithm,'TQQQ',6) < -0.1:
                            if CumReturn(self.algorithm,'TQQQ',1) > 0.055:
                                AH(self.algorithm,['BIL','UVXY','SQQQ'],3,0.33)
                            else:
                                Sort(self.algorithm,"SMADayRet",["TECL","TQQQ","EPI","SOXL","UPRO","QLD","EWZ","MVV","XLU","USD","TMF"],7,True,1,3,1)
                        else:
                            if 50 < RSI(self.algorithm,'IEF',7):
                                Sort(self.algorithm,"SMADayRet",["TECL","EPI","SOXL","UPRO","MVV"],7,False,1,3,1)
                            else:
                                Sort(self.algorithm,"CumReturn",["SOXS","TMF"],5,True,1,3,1)
                else:
                    Sort(self.algorithm,"RSI",["SPXU","SQQQ","TECS","SOXS"],5,False,1,3,1)
            else:
                self.A47()
    def A47(self):
        if STD(self.algorithm,'DBC',20) > STD(self.algorithm,'SPY',20):
            Sort(self.algorithm,"RSI",["SPXU","EPI","TECS","SOXS","SQQQ"],5,False,1,3,1)
        else:
            Sort(self.algorithm,"SMADayRet",["TECL","TQQQ","SOXL","TMF"],5,True,1,3,1)
    def A40(self):
        Sort(self.algorithm,"SMADayRet",["TECL","TQQQ","SOXL","UPRO","QLD"],5,False,1,3,1)

from indicators import *
from project.main import YellowCatStrat

#https://app.composer.trade/symphony/dgSMXwsjnzgBgD59Emf7/details

class ProposalV304cBetaBallerTCCCWithBelcampo692012DDReductionAdditionalOverallDDReductionStrategy(YellowCatStrat):
    def __init__(self, algorithm):
        super().__init__()
        self.algorithm = algorithm

    def Execute(self):
        if RSI(self.algorithm, 'BIL', 42) < RSI(self.algorithm, 'IEF', 70):
            if RSI(self.algorithm, 'SPY', 7) > 75:
                Sort(self.algorithm, 'RSI', ('UVXY', 'VIXY'), 12, False, 1, 130, 1)
            else:
                if RSI(self.algorithm, 'SOXL', 5) <= 75:
                    Sort(self.algorithm,'SMA',('SOXL', 'TQQQ', 'TECL'),12,True,1,130,1)
                else:
                    Sort(self.algorithm,'SMA',('SOXS', 'SQQQ'),12,True,1,130,1)
        else:
            if RSI(self.algorithm, 'SPY', 6) < 27:
                if RSI(self.algorithm, 'SHY', 7) < RSI(self.algorithm, 'SPHB', 8):
                    Sort(self.algorithm,'RSI',('SOXS', 'SQQQ'),7,False,1,130,1)
                else:
                    Sort(self.algorithm,'RSI',('SOXL', 'SPXL', 'TECL', 'TMF', 'UPRO', 'USD', 'TQQQ'),18,False,1,130,1)
            else:
                if RSI(self.algorithm, 'SPY', 10) < 30:
                    Sort(self.algorithm,'RSI',('SOXL', 'TECL', 'TMF', 'UPRO'),17,False,1,130,1)
                else:
                    if RSI(self.algorithm, 'UVXY', 10) > 84:
                        if self.algorithm.Portfolio['TLT'].Price > SMA(self.algorithm, 'TLT', 200):
                            if SMA(self.algorithm, 'TLT', 20) < 0:
                                if EMA(self.algorithm, 'SPY', 210) <= SMA(self.algorithm, 'SPY', 360):
                                    if RSI(self.algorithm, 'TQQQ', 10) < 30:
                                        Sort(self.algorithm,'SMA',('TECL', 'TQQQ', 'SOXL', 'UPRO'),5,False,1,130,0.21)
                                    else:
                                        if CumReturn(self.algorithm, 'SPXU', 6) <= CumReturn(self.algorithm, 'UPRO', 3):
                                            Sort(self.algorithm,'CumReturn',('SQQQ', 'EUO', 'YCS'),5,True,1,130,0.21)
                                        else:
                                            Sort(self.algorithm,'SMA',('TECL', 'TQQQ', 'SOXL', 'CURE'),5,False,1,130,0.21)
                                else:
                                    if RSI(self.algorithm, 'TQQQ', 11) > 77:
                                        AH(self.algorithm, 'UVXY', 130, 0.21)
                                    else:
                                        Sort(self.algorithm,'SMA',('TECL', 'TQQQ', 'SOXL', 'UPRO', 'TMV'),5,False,1,130,0.21)
                            else:
                                if EMA(self.algorithm, 'SPY', 210) <= SMA(self.algorithm, 'SPY', 360):
                                    if RSI(self.algorithm, 'TQQQ', 10) < 30:
                                        Sort(self.algorithm,'SMA',('TECL', 'TQQQ', 'SOXL'),5,False,1,130,0.21)
                                    else:
                                        if CumReturn(self.algorithm, 'UUP', 2) >= 1:
                                            Sort(self.algorithm,'CumReturn',('TECS', 'SOXS', 'SQQQ'),5,True,1,130,0.21)
                                        else:
                                            if CumReturn(self.algorithm, 'SPXU', 5) >= CumReturn(self.algorithm, 'UPRO', 4):
                                                Sort(self.algorithm,'CumReturn',('ERX', 'EUO', 'YCS'),5,True,1,130,0.21)
                                            else:
                                                Sort(self.algorithm,'SMA',('SOXL', 'EWZ', 'MVV', 'USD'),5,False,1,130,0.21)
                                else:
                                    if SMA(self.algorithm, 'SPY', 210) > SMA(self.algorithm, 'DBC', 360):
                                        if RSI(self.algorithm, 'TQQQ', 11) > 77:
                                            AH(self.algorithm, 'UVXY', 130, 0.21)
                                        else:
                                            if CumReturn(self.algorithm, 'TQQQ', 6) < -10:
                                                if CumReturn(self.algorithm, 'TQQQ', 1) > 5.5:
                                                    AH(self.algorithm, 'UVXY', 130, 0.21)
                                                else:
                                                    if RSI(self.algorithm, 'BIL', 7) < RSI(self.algorithm, 'IEF', 7):
                                                        Sort(self.algorithm,'SMA',('SOXL',),5,False,1,130,0.21)
                                                    else:
                                                        Sort(self.algorithm,'CumReturn',('EWZ', 'UUP', 'TMF', 'UCO'),5,True,1,130,0.21)
                                            else:
                                                if RSI(self.algorithm, 'BIL', 7) < RSI(self.algorithm, 'IEF', 7):
                                                    Sort(self.algorithm,'SMA',('TECL', 'TQQQ', 'SPXL', 'QLD', 'USD'),5,False,1,130,0.21)
                                                else:
                                                    Sort(self.algorithm,'CumReturn',('EWZ', 'UUP', 'TMF'),5,True,1,130,0.21)
                                    else:
                                        if STD(self.algorithm, 'DBC', 20) > STD(self.algorithm, 'SPY', 20):
                                            Sort(self.algorithm,'RSI',('SHY', 'EWZ', 'GLD', 'SPXS', 'TECS', 'SOXS', 'UCO', 'YCS'),5,False,1,130,0.21)
                                        else:
                                            if RSI(self.algorithm, 'BIL', 7) < RSI(self.algorithm, 'IEF', 7):
                                                Sort(self.algorithm,'SMA',('SOXL', 'USD', 'TMF'),5,False,1,130,0.21)
                                            else:
                                                Sort(self.algorithm,'CumReturn',('EWZ', 'SPXS', 'SOXS', 'UCO', 'YCS'),5,True,1,130,0.21)
                        else:
                            if SMA(self.algorithm, 'TLT', 20) < 0:
                                if EMA(self.algorithm, 'SPY', 210) <= SMA(self.algorithm, 'SPY', 360):
                                    if RSI(self.algorithm, 'TQQQ', 10) < 30:
                                        Sort(self.algorithm,'SMA',('TQQQ', 'SOXL', 'UPRO'),5,True,1,130,0.21)
                                    else:
                                        if CumReturn(self.algorithm, 'UUP', 2) >= 1:
                                            Sort(self.algorithm,'CumReturn',('SPXS', 'TECS', 'SOXS', 'SQQQ', 'ERX'),5,False,1,130,0.21)
                                        else:
                                            if CumReturn(self.algorithm, 'SPXU', 5) >= CumReturn(self.algorithm, 'UPRO', 4):
                                                Sort(self.algorithm,'CumReturn',('SOXS', 'SQQQ', 'EPI'),5,True,1,130,0.21)
                                            else:
                                                if CumReturn(self.algorithm, 'BIL', 3) >= CumReturn(self.algorithm, 'TMV', 3):
                                                    Sort(self.algorithm,'SMA',('TECL', 'SOXL', 'TNA'),5,False,1,130,0.21)
                                                else:
                                                    Sort(self.algorithm,'SMA',('TECL', 'SOXL', 'TMV'),3,False,1,130,0.21)
                            else:
                                if SMA(self.algorithm, 'SPY', 210) > SMA(self.algorithm, 'DBC', 360):
                                    if RSI(self.algorithm, 'TQQQ', 11) > 77:
                                        AH(self.algorithm, 'UVXY', 130, 0.21)
                                    else:
                                        if CumReturn(self.algorithm, 'TQQQ', 6) < -10:
                                            if CumReturn(self.algorithm, 'TQQQ', 1) > 5.5:
                                                AH(self.algorithm, 'UVXY', 130, 0.21)
                                            else:
                                                Sort(self.algorithm,'SMA',('SOXL', 'TMV'),5,False,1,130,0.21)
                                        else:
                                            if RSI(self.algorithm, 'BIL', 7) < RSI(self.algorithm, 'IEF', 7):
                                                Sort(self.algorithm,'SMA',('TQQQ', 'SOXL', 'UPRO', 'TMV', 'TECL'),5,True,1,130,0.21)
                                            else:
                                                Sort(self.algorithm,'SMA',('SOXL', 'UPRO'),22,False,1,130,0.21)
                                else:
                                    if STD(self.algorithm, 'DBC', 20) > STD(self.algorithm, 'SPY', 20):
                                        if STD(self.algorithm, 'DBC', 10) >= 3:
                                            if STD(self.algorithm, 'TMV', 5) <= STD(self.algorithm, 'DBC', 5):
                                                AH(self.algorithm, 'TMV', 130, 0.21)
                                            else:
                                                AH(self.algorithm, 'DBC', 130, 0.21)
                                        else:
                                            if RSI(self.algorithm, 'BIL', 7) < RSI(self.algorithm, 'IEF', 7):
                                                Sort(self.algorithm,'SMA',('TMV', 'SOXS', 'SPXU'),5,True,1,130,0.21)
                                            else:
                                                Sort(self.algorithm,'CumReturn',('EFA', 'EEM', 'SPXS', 'SOXS', 'UCO', 'TMV'),5,False,1,130,0.21)
                                    else:
                                        if RSI(self.algorithm, 'BIL', 7) < RSI(self.algorithm, 'IEF', 7):
                                            Sort(self.algorithm,'SMA',('EPI', 'SOXL', 'UPRO'),5,False,1,130,0.21)
                                        else:
                                            Sort(self.algorithm,'CumReturn',('EWZ', 'TECS', 'SOXS', 'EUO', 'YCS', 'TMV'),5,True,1,130,0.21)
                    else:
                        if RSI(self.algorithm, 'UVXY', 10) > 74:
                            AH(self.algorithm, 'UVXY', 130, 1)
                        else:
                            if self.algorithm.Portfolio['TLT'].Price > SMA(self.algorithm, 'TLT', 200):
                                if SMA(self.algorithm, 'TLT', 20) < 0:
                                    if EMA(self.algorithm, 'SPY', 210) <= SMA(self.algorithm, 'SPY', 360):
                                        if RSI(self.algorithm, 'TQQQ', 10) < 30:
                                            Sort(self.algorithm,'SMA',('TECL', 'TQQQ', 'SOXL', 'UPRO'),5,False,1,130,0.5)
                                        else:
                                            if CumReturn(self.algorithm, 'SPXU', 6) <= CumReturn(self.algorithm, 'UPRO', 3):
                                                Sort(self.algorithm,'CumReturn',('SQQQ', 'EUO', 'YCS'),5,True,1,130,0.5)
                                            else:
                                                Sort(self.algorithm,'SMA',('TECL', 'TQQQ', 'SOXL', 'CURE'),5,False,1,130,0.5)
                                    else:
                                        if RSI(self.algorithm, 'TQQQ', 11) > 77:
                                            AH(self.algorithm, 'UVXY', 130, 0.5)
                                        else:
                                            Sort(self.algorithm,'SMA',('TECL', 'TQQQ', 'SOXL', 'UPRO', 'TMV'),5,False,1,130,0.5)
                                else:
                                    if EMA(self.algorithm, 'SPY', 210) <= SMA(self.algorithm, 'SPY', 360):
                                        if RSI(self.algorithm, 'TQQQ', 10) < 30:
                                            Sort(self.algorithm,'SMA',('TECL', 'TQQQ', 'SOXL'),5,False,1,130,0.5)
                                        else:
                                            if CumReturn(self.algorithm, 'UUP', 2) >= 1:
                                                Sort(self.algorithm,'CumReturn',('TECS', 'SOXS', 'SQQQ'),5,True,1,130,0.5)
                                            else:
                                                if CumReturn(self.algorithm, 'SPXU', 5) >= CumReturn(self.algorithm, 'UPRO', 4):
                                                    Sort(self.algorithm,'CumReturn',('ERX', 'EUO', 'YCS'),5,True,1,130,0.5)
                                                else:
                                                    if CumReturn(self.algorithm, 'BIL', 3) >= CumReturn(self.algorithm, 'TMV', 3):
                                                        Sort(self.algorithm,'SMA',('TECL', 'TQQQ', 'SPXL', 'QLD', 'USD'),5,False,1,130,0.5)
                                                    else:
                                                        Sort(self.algorithm,'SMA',('TECL', 'TQQQ', 'TMV'),5,False,1,130,0.5)
                                    else:
                                        if SMA(self.algorithm, 'SPY', 210) > SMA(self.algorithm, 'DBC', 360):
                                            if RSI(self.algorithm, 'TQQQ', 11) > 77:
                                                AH(self.algorithm, 'UVXY', 130, 0.5)
                                            else:
                                                if CumReturn(self.algorithm, 'TQQQ', 6) < -10:
                                                    if CumReturn(self.algorithm, 'TQQQ', 1) > 5.5:
                                                        AH(self.algorithm, 'UVXY', 130, 0.5)
                                                    else:
                                                        if RSI(self.algorithm, 'BIL', 7) < RSI(self.algorithm, 'IEF', 7):
                                                            Sort(self.algorithm,'SMA',('SOXL',),5,False,1,130,0.5)
                                                        else:
                                                            Sort(self.algorithm,'CumReturn',('EWZ', 'UUP', 'TMF', 'UCO'),5,True,1,130,0.5)
                                                else:
                                                    if RSI(self.algorithm, 'BIL', 7) < RSI(self.algorithm, 'IEF', 7):
                                                        Sort(self.algorithm,'SMA',('TECL', 'TQQQ', 'SPXL', 'QLD', 'USD'),5,True,1,130,0.5)
                                                    else:
                                                        Sort(self.algorithm,'SMA',('SOXL', 'UPRO'),22,False,1,130,0.5)
                                        else:
                                            if STD(self.algorithm, 'DBC', 20) > STD(self.algorithm, 'SPY', 20):
                                                Sort(self.algorithm,'RSI',('SHY', 'EWZ', 'GLD', 'SPXS', 'TECS', 'SOXS', 'UCO', 'YCS'),5,False,1,130,0.5)
                                            else:
                                                if RSI(self.algorithm, 'BIL', 7) < RSI(self.algorithm, 'IEF', 7):
                                                    Sort(self.algorithm,'SMA',('SOXL', 'USD', 'TMF'),5,False,1,130,0.5)
                                                else:
                                                    Sort(self.algorithm,'CumReturn',('EWZ', 'SPXS', 'SOXS', 'UCO', 'YCS'),5,True,1,130,0.5)
                            else:
                                if SMA(self.algorithm, 'TLT', 20) < 0:
                                    if EMA(self.algorithm, 'SPY', 210) <= SMA(self.algorithm, 'SPY', 360):
                                        if RSI(self.algorithm, 'TQQQ', 10) < 30:
                                            Sort(self.algorithm,'SMA',('TQQQ', 'SOXL', 'UPRO'),5,True,1,130,0.5)
                                        else:
                                            if CumReturn(self.algorithm, 'UUP', 2) >= 1:
                                                Sort(self.algorithm,'CumReturn',('SPXS', 'TECS', 'SOXS', 'SQQQ', 'ERX'),5,False,1,130,0.5)
                                            else:
                                                if CumReturn(self.algorithm, 'SPXU', 5) >= CumReturn(self.algorithm, 'UPRO', 4):
                                                    Sort(self.algorithm,'CumReturn',('SOXS', 'SQQQ', 'EPI'),5,True,1,130,0.5)
                                                else:
                                                    if CumReturn(self.algorithm, 'BIL', 3) >= CumReturn(self.algorithm, 'TMV', 3):
                                                        Sort(self.algorithm,'SMA',('TECL', 'SOXL', 'UPRO'),5,False,1,130,0.5)
                                                    else:
                                                        Sort(self.algorithm,'SMA',('TECL', 'SOXL', 'TMV', 'TQQQ'),3,False,1,130,0.5)
                                    else:
                                        if SMA(self.algorithm, 'SPY', 210) > SMA(self.algorithm, 'DBC', 360):
                                            if RSI(self.algorithm, 'TQQQ', 11) > 77:
                                                AH(self.algorithm, 'UVXY', 130, 0.5)
                                            else:
                                                if CumReturn(self.algorithm, 'TQQQ', 6) < -10:
                                                    if CumReturn(self.algorithm, 'TQQQ', 1) > 5.5:
                                                        AH(self.algorithm, 'UVXY', 130, 0.5)
                                                    else:
                                                        Sort(self.algorithm,'SMA',('SOXL', 'TMV'),5,False,1,130,0.5)
                                                else:
                                                    if RSI(self.algorithm, 'BIL', 7) < RSI(self.algorithm, 'IEF', 7):
                                                        Sort(self.algorithm,'SMA',('TQQQ', 'SOXL', 'UPRO', 'TMV', 'TECL'),5,True,1,130,0.5)
                                                    else:
                                                        Sort(self.algorithm,'SMA',('SOXL', 'UPRO'),22,False,1,130,0.5)
                                        else:
                                            if STD(self.algorithm, 'DBC', 20) > STD(self.algorithm, 'SPY', 20):
                                                if STD(self.algorithm, 'DBC', 10) >= 3:
                                                    if STD(self.algorithm, 'TMV', 5) <= STD(self.algorithm, 'DBC', 5):
                                                        AH(self.algorithm, 'TMV', 130, 0.5)
                                                    else:
                                                        AH(self.algorithm, 'DBC', 130, 0.5)
                                                else:
                                                    if RSI(self.algorithm, 'BIL', 7) < RSI(self.algorithm, 'IEF', 7):
                                                        Sort(self.algorithm,'SMA',('TMV', 'SOXS', 'SPXU'),5,True,1,130,0.5)
                                                    else:
                                                        Sort(self.algorithm,'CumReturn',('EFA', 'EEM', 'SPXS', 'SOXS', 'UCO', 'TMV'),5,False,1,130,0.5)
                                            else:
                                                if RSI(self.algorithm, 'BIL', 7) < RSI(self.algorithm, 'IEF', 7):
                                                    Sort(self.algorithm,'SMA',('EPI', 'SOXL', 'UPRO'),5,False,1,130,0.5)
                                                else:
                                                    Sort(self.algorithm,'CumReturn',('EWZ', 'TECS', 'SOXS', 'EUO', 'YCS', 'TMV'),5,True,1,130,0.5)
                                else:
                                    if EMA(self.algorithm, 'SPY', 210) <= SMA(self.algorithm, 'SPY', 360):
                                        if CumReturn(self.algorithm, 'SPY', 2) <= -2:
                                            Sort(self.algorithm,'CumReturn',('SPXS', 'TECS', 'SOXS', 'SQQQ'),5,True,1,130,0.5)
                                        else:
                                            if CumReturn(self.algorithm, 'SPXU', 6) >= CumReturn(self.algorithm, 'UPRO', 3):
                                                Sort(self.algorithm,'CumReturn',('BIL', 'AGG', 'TMF'),5,False,1,130,0.5)
                                            else:
                                                Sort(self.algorithm,'SMA',('TECL', 'TQQQ', 'SOXL', 'EWZ', 'TMF'),5,False,1,130,0.5)
                                    else:
                                        if SMA(self.algorithm, 'SPY', 210) > SMA(self.algorithm, 'DBC', 360):
                                            if EMA(self.algorithm, 'SPY', 210) > EMA(self.algorithm, 'SPY', 360):
                                                if RSI(self.algorithm, 'TQQQ', 11) > 77:
                                                    AH(self.algorithm, 'UVXY', 130, 0.5)
                                                else:
                                                    if CumReturn(self.algorithm, 'TQQQ', 6) < -10:
                                                        if CumReturn(self.algorithm, 'TQQQ', 1) > 5.5:
                                                            AH(self.algorithm, 'UVXY', 130, 0.5)
                                                        else:
                                                            Sort(self.algorithm,'SMA',('TECL', 'TQQQ', 'SPXL', 'EPI', 'SOXL', 'UPRO', 'QLD', 'EWZ', 'MVV', 'PUI', 'USD', 'TMF'),7,False,1,130,0.5)
                                                    else:
                                                        if RSI(self.algorithm, 'BIL', 7) < RSI(self.algorithm, 'IEF', 7):
                                                            Sort(self.algorithm,'SMA',('TECL', 'SPXL', 'EPI', 'SOXL', 'UPRO', 'MVV'),7,False,1,130,0.5)
                                                        else:
                                                            Sort(self.algorithm,'CumReturn',('SOXS', 'TMF'),5,True,1,130,0.5)
                                            else:
                                                Sort(self.algorithm,'RSI',('SPXS', 'SQQQ', 'TECS', 'SOXS'),5,False,1,130,0.5)
                                        else:
                                            if STD(self.algorithm, 'DBC', 20) > STD(self.algorithm, 'SPY', 20):
                                                Sort(self.algorithm,'RSI',('SPXS', 'EPI', 'TECS', 'SOXS', 'SQQQ'),5,False,1,130,0.5)
                                            else:
                                                Sort(self.algorithm,'SMA',('TECL', 'TQQQ', 'SOXL', 'TMF'),5,True,1,130,0.5)


#https://app.composer.trade/symphony/eWuObiu8EmMaM1wLJjar/details

class V3BWCManagedFuturesStrategy(YellowCatStrat):
    def __init__(self, algorithm):
        super().__init__()
        self.algorithm = algorithm

    def Execute(self):
        self.v3_bwc_managed_futures()
    
    def v3_bwc_managed_futures(self):
        Sort(self.algorithm, 'STD', ('DBMF', 'KMLM', 'FMF', 'CTA', 'WTMF'), 20, False, 1, 128, 0.25)
        Sort(self.algorithm, 'RSI', ('DBMF', 'KMLM', 'FMF', 'CTA', 'WTMF'), 10, False, 1, 128, 0.25)
        Sort(self.algorithm, 'MaxDD', ('DBMF', 'KMLM', 'FMF', 'CTA', 'WTMF'), 20, False, 1, 128, 0.25)
        Sort(self.algorithm, 'RSI', ('DBMF', 'KMLM', 'FMF', 'CTA', 'WTMF'), 14, False, 1, 128, 0.25)

#https://app.composer.trade/symphony/0K6liVmTr0q82Y5HdspZ/details

class The60408020StyleDeez21JUL2023Strategy(YellowCatStrat):
    def __init__(self, algorithm):
        super().__init__()
        self.algorithm = algorithm

    def Execute(self):
        self.group1()
        self.group2()
        self.group3()
        self.group4()
    
    def group1(self):
        AH(self.algorithm, 'QQQ', 129, 0.12)
        AH(self.algorithm, 'SPY', 129, 0.12)
    def group2(self):
        AH(self.algorithm, 'TQQQ', 129, 0.48)
        AH(self.algorithm, 'UPRO', 129, 0.48)
    def group3(self):
        AH(self.algorithm, 'TLT', 129, 0.32)
        AH(self.algorithm, 'IEF', 129, 0.32)        
    def group4(self):
        AH(self.algorithm, 'TMF', 129, 0.08)
        AH(self.algorithm, 'TYD', 129, 0.08)

#https://app.composer.trade/symphony/SB3GTubqQnGWm3eQptUX/details

class JasonKozsFearForTheLongTermOriginalStrategy(YellowCatStrat):
    def __init__(self, algorithm):
        super().__init__()
        self.algorithm = algorithm

    def Execute(self):
        AH(self.algorithm, 'SVIX', 132, 0.75)
        AH(self.algorithm, 'UVIX', 132, 0.25)
#region imports
from AlgorithmImports import *
#endregion


# Your New Python File
#CombinedStrategy2 version1.py
from AlgorithmImports import *
#endregion
from AlgorithmImports import *
from indicators import *
from main import YellowCatStrat

#https://app.composer.trade/symphony/oLw39T5NArarGky6aLhC/details

class ZeroFiveBetaYoloStrategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
        Sort(self.algorithm,'RSI',('AMN','CHD','CVBF','DG','ERIE','FCN','FFNW','NTES','OTTR','PGR','PINC','QDEL','RLI','RMD','SFM','SMMF','TPB','UBCP','VIPS','VRTX','WDFC','ZM'),10,False,5,4,1)
    
#https://app.composer.trade/symphony/EqmnUjWtHBbCT7PUBbSK/details

class FortyTwovs69BILVSSOXLFIGHTStrategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
      if RSI(self.algorithm, 'BIL', 12) > RSI(self.algorithm, 'IEF', 12):
            AH(self.algorithm, 'BIL', 5, 1) 
      else:
            AH(self.algorithm, 'SOXL', 5, 1)

#https://app.composer.trade/symphony/GsdpzOHycF5UKJxRohRR/details

class SeventySOXL30SOXSStrategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
        AH(self.algorithm, 'SOXS', 6, 0.3)
        AH(self.algorithm, 'SOXL', 6, 0.7)

#https://app.composer.trade/symphony/Do36TWTu1gWh8SewO1Go/details

class Six040ReturnStackingStrategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
        AH(self.algorithm, 'NTSX', 7,0.66)
        AH(self.algorithm, 'DBMF', 7,0.15) 
        AH(self.algorithm, 'BSJN', 7,0.15) 
        AH(self.algorithm, 'VIXM', 7,0.04)

#https://app.composer.trade/symphony/PQaK6XWI4Ird5bT5b7Bo/details

class Nine010UNHCOSTQQQSMHStrategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
        AH(self.algorithm, 'UNH', 8,0.45)
        AH(self.algorithm, 'COST', 8,0.45) 
        AH(self.algorithm, 'QQQ', 8,0.05) 
        AH(self.algorithm, 'SMH', 8,0.05)

#https://app.composer.trade/symphony/T2vzrOHG6E9Rk1flV0di/details

class Two30407BatshitSimplev10SharedCopyStrategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
        AHIV(self.algorithm, ('JEPI', 'UPRO'), 10, 9,1)

#https://app.composer.trade/symphony/QzwW2e6QFcxxfmNClUw8/details

class AutoIndexDeez6JUL2023Strategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
        Sort(self.algorithm,'SMADayRet',('AAPL','TSLA','GOOG'),90,True,1,10,0.8)
        Sort(self.algorithm,'SMADayRet',('MSFT','NVDA','JNJ','AMZN','V','JPM','BRK/B','META','PG','MA'),42,True,1,10,0.2)


#https://app.composer.trade/symphony/iZICMymgVkj7lka9rBgO/details

class ApplebutbadStrategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
        if SMA(self.algorithm, 'AAPL', 21) > SMA(self.algorithm, 'AAPL', 252):
            AH(self.algorithm, 'BIL', 11, 1)
        else:
            Sort(self.algorithm,'CumReturn',('AAPL','BIL'),21,False,1,11,1)
    
#https://app.composer.trade/symphony/ysDMJE5KKVCP9lWD8FGS/details

class ApplealsoterribleDeez8JUL20233YRBTAR12Strategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
        if RSI(self.algorithm, 'AAPL', 2) > 69: 
            AH(self.algorithm, 'AAPL', 12, 1) 
        else:
            AH(self.algorithm, 'BIL', 12, 1)

#https://app.composer.trade/symphony/RtoW10P6KipuEE99fWbP/details

class ALLIDOISWINWINWINNOMATTERWHATStrategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
        AH(self.algorithm, 'SPY', 13, 0.25) 
        AH(self.algorithm, 'QQQ', 13, 0.25) 
        AH(self.algorithm, 'DIA', 13, 0.25) 
        AH(self.algorithm, 'IWM', 13, 0.25)

#https://app.composer.trade/symphony/rCGPyUpqomZibcZLsLru/details

class ABetterQQQStrategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
        Sort(self.algorithm,'RSI',('ATEN','CCRD','CHKP','CRUS','CSCO','DQ','ECOM','ELTK','ERIC','HCKT','INFY','JKHY','LOGI','MNDO','MSFT','NSYS','QLYS','SIMO','TSM','TSRI','WSTG'),40,False,4,14,1)
    
#https://app.composer.trade/symphony/gWd5fpkaofGVtHMwLjYb/details

class ABadIdeaStrategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
        if MaxDD(self.algorithm, 'SVXY', 4) > 10:
            AH(self.algorithm, 'BIL', 15, 1) 
        else:
            AH(self.algorithm, 'SVXY', 15, 1)

#https://app.composer.trade/symphony/BwF1pzV15LjyY4OhVxVz/details

class BTCRothsDynamicDeez3JUL2023Strategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
        Sort(self.algorithm,'RSI',('MSTR','COIN','MARA','HUT','BITF','RIOT','BIL'),10,False,2,16,1)

#https://app.composer.trade/symphony/ddD6u7HvWFwOlFfmMnuh/details

class BrianEsPortfoliol26May2022Strategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
        AHIV(self.algorithm, ('UPRO', 'TQQQ', 'SOXL', 'UDOW', 'TECL'), 25, 17,1)
    
#https://app.composer.trade/symphony/VJB3T4rpOycCFc25K7tc/details

class BitetheApple10918Strategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
      if CumReturn(self.algorithm, 'AAPL', 10) > -1:
            AH(self.algorithm, 'AAPB', 18, 1) 
      else:
            AH(self.algorithm, 'AAPD', 18, 1)

#https://app.composer.trade/symphony/Ksz4NUONdDyUDLAH09MK/details

class BILtestdriveStrategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
      if STD(self.algorithm, 'BIL', 2) > STD(self.algorithm, 'BIL', 3):
          AH(self.algorithm, 'SPY', 19, 1) 
      else:
          AH(self.algorithm, 'BIL', 19, 1)
#https://app.composer.trade/symphony/bGVzMtaIInv85FuVysnm/details

class BestCryptoRebalancerFeaverStrategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
        AH(self.algorithm, 'MSTR', 20,0.375)
        AH(self.algorithm, 'BITX', 20,0.375)
        AH(self.algorithm, 'HUT', 20,0.0625)
        AH(self.algorithm, 'BITF', 20,0.0625)
        AH(self.algorithm, 'MARA', 20,0.0625)
        AH(self.algorithm, 'COIN', 20,0.0625)
        
#https://app.composer.trade/symphony/HAx2CLC7knePDxP4PlXQ/details

class BelieveinBigTechStrategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
        Sort(self.algorithm,'CumReturn',('META','AMZN','AAPL','MSFT','GOOG','PYPL','ADBE','NVDA'),20,True,2,21,1)

#https://app.composer.trade/symphony/6nP4CoYDtzIHq1tvNGt4/details

class BBsimpleStrategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
      if RSI(self.algorithm, 'BIL', 42) < 70:
            AH(self.algorithm, 'SPXL', 22, 1) 
      else:
            AH(self.algorithm, 'BIL', 22, 1)

#https://app.composer.trade/symphony/Vhhi0M0jPwArFBskS258/details

class BalancedPortfolioStrategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
        AH(self.algorithm, 'TLT', 23, 0.5) 
        AH(self.algorithm, 'SPY', 23, 0.5)

#https://app.composer.trade/symphony/aPm93t3bC3Jnfsh1WH1t/details

class CQFNGUTMVSTOPTRYINGSOHARD8223Strategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
        AH(self.algorithm, 'FNGU', 24, 0.5) 
        AH(self.algorithm, 'TMV', 24, 0.5)

#https://app.composer.trade/symphony/tuDq0KiVG9f6rXqUHmME/details

class CQBankBlenderV108223Strategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
        AH(self.algorithm, 'FNGU', 25, 1)

#https://app.composer.trade/symphony/6oGqcHPz8hb9s93lIeD2/details

class CopyRayDalioStrategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
        AH(self.algorithm, 'VTI', 26,0.3)
        AH(self.algorithm, 'TLT', 26,0.4)
        AH(self.algorithm, 'IEF', 26, 0.15) 
        AH(self.algorithm, 'DBC', 26, 0.075) 
        AH(self.algorithm, 'GLD', 26,0.075)

#https://app.composer.trade/symphony/zp49VUtDfrHce2eBvoEN/details

class CopyofYourABasicBroStrategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
        Sort(self.algorithm,'SMADayRet',('SVXY','UVXY','TQQQ','SQQQ','BIL','GLD','UDN','UUP','HEQT','BTAL','TJUL','RSBT','SPYC'),20,False,3,27,1.0)

#https://app.composer.trade/symphony/WP9xp1rLTO4c2H9UHUCQ/details

class CopyofTheboringIndexStrategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
        AHIV(self.algorithm, ('SPY', 'QQQ', 'IWM', 'DIA'), 90, 28,1)

#https://app.composer.trade/symphony/UW3aJor3qOT9fcQXOVPp/details

class DragonPortfolioStrategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
        AHIV(self.algorithm, ('UPRO', 'TMF', 'XLF'), 45, 29,1)

#https://app.composer.trade/symphony/6lLWbBtodpMpQjZlP1Od/details

class DiversifywithSinStocksStrategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
        AHIV(self.algorithm, ('GLD', 'UUP'), 26, 30,1)
    
#https://app.composer.trade/symphony/0dKcj7cKmeHhafQKlrHM/details

class DiversifywithGoldtheDollarStrategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
        AHIV(self.algorithm, ('GLD', 'UUP'), 26, 31,1)

#https://app.composer.trade/symphony/aXiDzYzGFlraxOVfSXtL/details

class DiversifiedPortfolioStrategy(YellowCatStrat):
    def __init__(self, algorithm):
        self.algorithm = algorithm

    def Execute(self):
        AH(self.algorithm, 'SPY', 32, 0.33) 
        AH(self.algorithm, 'VO', 32, 0.33) 
        AH(self.algorithm, 'IJR', 32, 0.33)

#https://app.composer.trade/symphony/DQsRooIeQ48GW9RThp6S/details

class DEVDoll