Strategy · Pine Script v6 · Own pane

Liquidity Moving Average Cross

by AlanGuo

A macro strategy that builds a global central bank liquidity series from the Fed balance sheet, Treasury account, reverse repo, ECB, People's Bank of China and Bank of Japan, and a combined M2 money supply series, each convertible to dollars and switchable.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code164
Settings17inputs
LicenceNone stated
Last update7 months ago31 Mar 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.

Source Code

The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.

Overview

Liquidity Moving Average Cross enters when liquidity or M2 crosses above its 90-period average, and exits on a selectable condition based on M2, liquidity or the traded asset's own average. A cross offset percentage is configurable. Series plot in a separate pane, with no stop loss.

Details

Published by

AlanGuo on GitHub

Type

Strategy, Pine Script v6

Draws

Separate pane below the chart

Category

Trend, Moving averages

Markets

Any symbol

Timeframes

H4 and above

Risk Notes

  • The strategy enters trades without a stop loss

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
均线周期int90sma_length
商品均线周期int90hold_sma_length
交叉偏移百分比(%)float0.5cross_offset_pct
入场条件string央行流动性上穿均线entry_condition_type
出场条件stringM2下穿均线exit_condition_type
FED (Federal Reserve System)booltruefed_active
TGA (Treasury General Account)booltruetga_active
RRP (Reverse Repurchase Agreements)booltruerrp_active
ECB (European Central Bank)booltrueecb_active
PBC (People's Bank of China)booltruepbc_active
BOJ (Bank of Japan)booltrueboj_active
USM2 (USA Money Supply)booltrueusa_active
Show all 17 settings
SettingTypeDefaultVariable
EUM2 (Europe Money Supply)booltrueeurope_active
CNM2 (China Money Supply)booltruechina_active
JPM2 (Japan Money Supply)booltruejapan_active
开始日期timetimestamp("1 Jan 2000")start_date
结束日期timetimestamp("31 Dec 2099")end_date
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

330 stars

HA UnivLong&Short Futures calculates Heikin Ashi candles and builds a channel using simple moving averages of Heikin Ashi highs and lows. It enters long positions when the upper channel line crosses above the lower channel line and opens short positions on the

Strategy v5 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of HA UnivLong&Short Futures

MACD Crossover (tutorial)

by pineforge-4pass
193 stars

This strategy calculates the Moving Average Convergence Divergence indicator and plots the MACD line, signal line, and histogram in a separate pane. It enters long positions when the MACD line crosses above the signal line and enters short positions when it cr

Strategy v6 Oscillators & momentumMoving averages
Updated yesterday · Apache-2.0 GitHub repository of MACD Crossover (tutorial)

8 Whittle Down

by hasnocool
106 stars

This strategy executes short positions during the end-of-day session (14:29–15:00) when the price is below the 200-day simple moving average. If price moves higher against the initial short trade, it scales into the position by submitting a second short order

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of 8 Whittle Down

EMA Ribbon MACD

by iamrichardD
57 stars

This strategy combines an EMA ribbon with MACD confirmation and plots in a separate pane. It enters when ribbon alignment, optional MACD zero or signal crosses, volume, smart-money, and multi-timeframe filters agree, then exits with percentage stop loss and ta

Strategy v6 TrendMoving averages
Updated 1 year ago · Apache-2.0 GitHub repository of EMA Ribbon MACD

More strategys

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers