Fair Value Strategy Ultimate by calebsandfort

By calebsandfort

Performance Metrics

Description

This is a strategy using an index's (SPX, NDX, RUT) Fair Value derived from Net Liquidity.Net Liquidity function is simply: Fed Balance Sheet - Treasury General Account - Reverse Repo BalanceFormula for calculating the fair value of and Index using Net Liquidity looks like this: net_liquidity/1000000000/scalar - subtractorThe Index Fair Value is then subtracted from the Index value which creates an oscillating diff value.When diff is greater than the overbought threshold, Index is considered overbought and we go short/sell.When diff is less than the oversold signal, Index is considered oversold and we cover/buy.The net liquidity values I calculate outside of TradingView. If you'd like the strategy to work for future dates, you'll need to update the reference to my NetLiquidityLibrary, which I update daily.Parameters:Index: SPX, NDX, RUTStrategy: Short Only, Long Only, Long/ShortInverse (bool): check if using an inverse ETF to go long instead of short.Scalar (float)Subtractor (int)Overbought Threshold (int)Oversold Threshold (int)Start After Date: When the strategy should start tradingClose Date: Day to close open trades. I just like it to get complete results rather than the strategy ending with open trades.Optimal Parameters:I've optimized the parameters for each index using the python backtesting library and they are as follows =>SPXScalar: 1.1Subtractor: 1425OB Threshold: 0OS Threshold: -175NDXScalar: 0.5Subtractor: 250OB Threshold: 0OS Threshold: -25RUTScalar: 3.2Subtractor: 50OB Threshold: 25OS Threshold: -25

Browse all 5,900+ TradingView Pine Script strategies

View on TradingView