calebsandfort

Fair Value Strategy Ultimate

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 Balance

Formula for calculating the fair value of and Index using Net Liquidity looks like this: net_liquidity/1000000000/scalar - subtractor

The 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, RUT

Strategy: Short Only, Long Only, Long/Short

Inverse (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 trading

Close 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 =>

SPX
Scalar: 1.1
Subtractor: 1425
OB Threshold: 0
OS Threshold: -175

NDX
Scalar: 0.5
Subtractor: 250
OB Threshold: 0
OS Threshold: -25

RUT
Scalar: 3.2
Subtractor: 50
OB Threshold: 25
OS Threshold: -25
開源腳本

本著真正的TradingView精神,該腳本的作者將其開源發布,以便交易者可以理解和驗證它。為作者喝彩吧!您可以免費使用它,但在出版物中重複使用此代碼受網站規則的約束。 您可以收藏它以在圖表上使用。

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。

想在圖表上使用此腳本?