This strategy calculates a Volume-Weighted Moving Average Convergence Divergence (VWMA MACD) and its histogram average to generate trade signals in a separate pane.
1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
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
79 lines of Pine Script v5 from Tradingview/macd-vwma-strategy.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
MACD VWMA Strategy enters long positions when the MACD histogram crosses above its simple moving average and short positions when it crosses below. Users can filter trades by specific session hours, start date, and direction toggles. The script has no built-in stop loss or take profit orders, relying on signal crossovers or exits.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Fast Length
int
13
fast_length
Slow Length
int
21
slow_length
Source
source
close
src
Signal Smoothing
int
3
signal_length
Oscillator MA Type
string
VWMA
sma_source
Signal Line MA Type
string
VWMA
sma_signal
MACD Line
color
#2962FF
col_macd
Signal Line
color
#FF6D00
col_signal
Above Grow
color
#26A69A
col_grow_above
Fall
color
#B2DFDB
col_fall_above
Below Grow
color
#FFCDD2
col_grow_below
Fall
color
#FF5252
col_fall_below
Show all 18 settings
Setting
Type
Default
Variable
Histogram Average
int
10
strategy_length
Strategy Start Date
time
timestamp("01 January 2020 00:00:00 UTC-5")
strategy_start
Use Trading Hours
bool
false
use_trading_hours
session
0930-1600
trading_time
Long Trades
bool
true
long_trades
Short Trades
bool
true
short_trades
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.
This strategy plots a MACD oscillator in a separate pane and trades Bitcoin futures from zero-line and signal-line crosses. Optional early momentum signals, a volume filter, and a trend moving-average filter can confirm entries. It sizes positions as fixed con
This strategy plots an On-Balance Volume oscillator in a separate pane and applies a fast and a slow exponential moving average to it. It enters long or short when those averages cross, with a strategy type that can reverse, stay long only, or stay short only,
This Pine Script strategy calculates the accumulation/distribution line with ta.accdist and its 21-period EMA. It plots these in a separate pane. The strategy issues long entries on ta.crossover of the accumulation/distribution line above its EMA and short ent
This strategy enters long on an outside bar when the candle is bullish, the Klinger Volume Oscillator is positive, and price is above a Hull moving average. It enters short on an inside bar when the candle is bearish, the oscillator is negative, and price is b
This intraday strategy implements Mark Fisher's Opening Range Breakout (ORB) methodology tailored for index futures like ES and NQ. It calculates session opening ranges, volume z-scores, and VWAP bands to plot support, resistance, and confirmation levels on th
This strategy trades on the price chart using multiple indicators. It enters long positions when price dips meet conditions on Bollinger Bands 40 and 20, RSI, MFI, volume and other thresholds. It exits at custom ROI profit levels based on RSI or after timeout