Each trading day, each ETF gets an intraday move = (close โ open) รท open. The delta is the gap between the two moves: ฮ = IGV move โ SOXX move. When |ฮ| reaches your target you swap that day, at the close price.
๐ก Example A: IGV closes โ2% vs its open, SOXX +3% โ ฮ = โ5%. At a 5% target, SOXX is the day's winner, IGV the loser: sell SOXX, buy IGV. โ
๐ก Example B: IGV +7%, SOXX +1% โ ฮ = +6% โฅ target โ IGV is the winner: sell IGV (the stock on the rise), buy SOXX (the dip). โ
โ ๏ธ You only ever rotate the % of the winner's shares you set, so a widening spread can't force you all-in. No cash is ever parked โ sale proceeds immediately buy the loser at the same close price. Backtest ignores fees & slippage. Start: 100 shares of each ETF.
๐ช Per-stock mode ("buy the dip / sell the rip"): you pick one ETF to monitor (๐ก IGV or SOXX) and that ETF alone is the test portfolio: 100 shares + cash. On any day it closes at least X% above its open you sell X% of your portfolio value worth of shares (banking cash); on a day it closes at least X% below its open you spend up to X% of your portfolio buying more (capped by cash on hand). Starting cash defaults to $0 โ rally-sells fund later dip-buys; raise it if you want to buy dips before any sell. The other ETF stays on the price chart for context only.
โ = an executed trade (a swap, or a buy/sell action). Buy & hold = 100 shares of each ETF held from your chosen start date, never traded.