USO Mean Reversion Code

Good afternoon. I’m looking to check a USO mean reversion system.

Buy Rules: Ticker = $USO, Rate of change 40 days > 0, Rate of change 2 days < 0, XLK closed higher than yesterday, XLK closed higher yesterday than the day before
Sell Rules: RSI(2) + RSI(2,1) > 100

Looks ok with just the first 3 buys rules, but I can’t figure out how to input the XLK pricing rules. My buy rule attempt is below. Any suggestions?


USO buy.jpg


Try it without the dollar signs. It should work, but let me know if it doesn’t.

Thank you again Yuval. We haven’t met, but I always enjoy your content on SA, YouTube, and this forum. As usual, this “$” solved the issue. It’s not a massive return, but the equity curve is consistent, it’s not correlated to SPY, and it’s only in the market ~20% of the time.