Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # You can download the latest version of this indicator here: https://pastebin.com/edit/M6ttyxDf
- #
- # In theory, Fed liquidity indicates the amount of money coming into the market.
- # If the SPX reaches the red zone it means that there is no more liquidity to continue rising.
- # If it is in the green zone, there is enough money flowing into the market to push it higher.
- #
- # Use only in SPX
- #
- # Based on the original work of:
- # https://twitter.com/maxjanderson/status/1546472693234470912
- # https://thinkscript101.com/fed-net-liquidity-indicator-thinkorswim/
- input Short_Zone = 350;
- input Long_Zone = -150;
- def a = If(IsNaN(close("WALCL:FRED")), a[1], close("WALCL:FRED"));
- def b = If(IsNaN(close("WTREGEN:FRED")), b[1], close("WTREGEN:FRED"));
- def c = If(IsNaN(close("RRPONTSYD:FRED")), c[1], close("RRPONTSYD:FRED"));
- def SPX = If(IsNaN(close("SPX")), SPX[1], close("SPX"));
- def SPXFairValueNetLiq = (a - (b + c) * 1000) / 1000 / 1.1 - 1625;
- def SPXFairValue = If(!IsNaN(close), SPXFairValueNetLiq, Double.NaN);
- AddLabel(yes, "FED Net Liquidity = Fed Balance Sheet - (Treasury General Account + Reverse Repo)");
- AddLabel(yes, "Use ONLY in SPX daily");
- plot los_colores = close;
- los_colores.DefineColor("Short_Zone", Color.DARK_RED);
- los_colores.DefineColor("Long_Zone", Color.DARK_GREEN);
- los_colores.SetHiding(yes);
- plot upperBand = SPXFairValue + Short_Zone;
- AddCloud(upperBand, upperBand + 200, Color.lIGHT_GREEN, Color.pink);
- upperBand.AssignValueColor(los_colores.color("Short_Zone"));
- plot red_short_arrow = if high>upperBand then high*1.01 else Double.NaN;
- red_short_arrow.setDefaultColor(Color.RED);
- red_short_arrow.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
- plot lowerBand = SPXFairValue + Long_Zone;
- AddCloud(lowerBand, lowerBand - 200, Color.lIGHT_GREEN, Color.pink);
- lowerBand.AssignValueColor(los_colores.color("Long_Zone"));
- plot green_long_arrow = if low<lowerBand then low*0.99 else Double.NaN;
- green_long_arrow.setDefaultColor(Color.GREEN);
- green_long_arrow.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement