AMEX:XLK   SPDR Select Sector Fund - Technology
» Stop Loss can be set in settings. 0.90, means that it will apply a 10% stop loss setting.
» You can set how many shares it buys at a time
» MaPeriod, that is set to 5, looks to buy shares if instruments price dips below this moving average.
» I have set the broker fee to $1, that's what I pay with Interactive Brokers, but you can edit that in the code as you wish

// COMMENTS
//——————————————————————————————————————————————————————————————————————————————
// » MEAN REVERSION SYSTEM, NOT A TREND TRADING SYSTEM
// » DESIGNED TO WORK ON ETF WITH GOOD LINEARITY
// » PRICE MUST BE ABOVE 200 MA
// » CLOSE MUST BE BELOW THE FastMa TO BUY AT LOW PRICES
// » USE ONLY ON DAILY OR HIGHER TIME FRAMES
// » IMPORTS DATA FROM LOWN TICKET TO CHECK THAT NOT TOO MANY STOCKS ARE MAKING NEW HIGHS

Can be used on tickers like

SPY, SPX, SSO, SPXL, TQQQ, QQQ, and sector ETFs like these below.
AMEX:XLE,AMEX:XLF,AMEX:XLK,AMEX:XLB,AMEX:XLU,AMEX:XLI,AMEX:XLV,AMEX:XLY,AMEX:XRT,AMEX:XLP,AMEX:XLRE,AMEX:XLC,AMEX:XSD,AMEX:XTL,AMEX:GXC

Can also be used on stocks, I would recommend adjusting the stop loss and MaPeriod to dip buy
Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.