TradingView
TraderLeibniz
24 ตุลา 2022 เวลา 19 นาฬิกา 53 นาที

SPX Fair Value Bands V2 

S&P 500SP

คำอธิบาย

An updated version of the SPX Fair Value Bands script from dharmatech and based on the net liquidity concept by MaxJAnderson.

Now with full customization of parameters through the settings (Dialog Box) and allowing the options to the use of
1) Standard Bands based on Offsets of the Fair Value
2) Bollinger Bands
3) Keltner Channels
to better capture buy/sell areas rather than relying on noisy unreliably (and unevenly) updated data from the Treasury/Fed.

==================================

Net Liquidity's importance in the new post-COVID QE to QT regime as described MaxJAnderson

----------------

" In past cycles, size of Fed's balance sheet changed a lot, while TGA and RRP changed relatively little. So size of balance sheet roughly equated Net Liquidity.

(The Treasury General Account) TGA and (Reverse Repo) RRP didn't matter. They were rounding errors by comparison.
But starting in 2020, relative changes in TGA and RRP have been THREE TIMES LARGER than the change in size of the Fed's balance sheet. As result, changes in TGA and RRP have taken over as the primary drivers Net Liquidity.

This is new, and changes the game significantly. Again - the size of the Fed's balance sheet doesn't matter.
What matters is the portion of it that's available to circulate in the economy (Net Liquidity).

And ever since 2020, the Treasury and Reverse Repo have become what controls that. Not the size of Fed's balance sheet.

----------------

The idea that follows is simple,short when SPX reaches extreme levels of overvaluation, and close out when SPX returns to being undervalued. Here's the formulas I currently use to determine fair value:

Fair Value = (Fed Bal Sheet - TGA - RRP)/1.1 - 1625
And here's the trading rules I currently follow:

Short when diff of SPX - Fair Value > 350
Close when diff of SPX - Fair Value < 150

When one of these rules is triggered upon market close on a given day, trades are entered at open of the following day "

เอกสารเผยแพร่

Fixed Two Bugs:
  • [1] "netliq_expr" user input string for the "Net Liquidity Expression" configuration was not being used in "request.security(...)" statements.
    [2] "reg_offset" "input.float(...)" title='Regression Slope' was mislabeled.


Improvements:
  • User Configuration Organization with "groups"
  • Multi-timeframe Configurability of the bands under the "Band Timeframe Settings" grouping.

เอกสารเผยแพร่

Adding band colour controls for each type: Standard (Std) (as defined by Max J. Anderson), Bollinger Band (BB), and Keltner Channel (KC).

The colour can also be configured based on the close of the current bar (or another configurable TradingView allowable bar source arg---including another indicator). The four colours are chosen as follows:
  • if close BELOW Band
  • else close ABOVE Band
  • else close BELOW Fair Value (FV)
  • else close ABOVE Fair Value (FV)


ความคิดเห็น
shaikshabbeervali136
Plz add the indicator
alis87
Hi, awesome work! Cleanest implementation of this I've seen on here and I've trawled through most of them. Would it be possible to add the fill of the channels in to the next version, even as an option? Thanks.

fill(draw_bb_sell_band, draw_bb_buy_band, color=color.rgb(128, 82, 255, 95))
fill(draw_kc_sell_band, draw_kc_buy_band, color=color.rgb(128, 82, 255, 100))
TraderLeibniz
@alis87, Updated as requested. Everything is configurable in the Inputs and Style sections.

---------

Adding band colour controls for each type: Standard (Std) (as defined by Max J. Anderson), Bollinger Band (BB), and Keltner Channel (KC).

The colour can also be configured based on the close of the current bar (or another configurable TradingView allowable bar source arg---including another indicator). The four colours are chosen as follows:
if close BELOW Band
else close ABOVE Band
else close BELOW Fair Value (FV)
else close ABOVE Fair Value (FV)
jdc7789
Great work! I have been exploring this net liquidity dimension for a few days. What are your thoughts about the use of bar_offset? There is logically a slight lag in the effects of liquidity changes appearing in the indexes.
TraderLeibniz
@jdc7789, right now: 1) the Fed's balance sheet (WALCL) is updated weekly (Thursday afternoon after the close), and 2) FRED:WTREGEN TGA data that comes from the fed is a weekly updated moving average of the past week. These create distortions in the data as the RRP is updated daily.

For example, this week we are suppose to have 74B in treasuries roll off. This won't be reflected in the WALCL until after the close today. But RRP tuesday and wednesday offset that with the lowest levels in 5 months. The change in net liquidity should be zero for the week after all the gyrations you see in the daily data.

So offsetting this unevenly updated data further only adds more lag on a lagging indicator IMO. This is why I use the bollinger band derivation of the fair value +/- Max J Anderson's offset. It creates a really good envelope that captures the areas you should be interested in going long/short in SPX regardless of the update sequence.
jdc7789
@TraderLeibniz, Thanks a lot for sharing your experience on this, makes total sense...
เพิ่มเติม