Select Page

Strategy Premise

Moving Average Convergence Divergence (MACD) is a trend-following momentum indicator that shows the relationship between two moving averages of a security’s price  MACD is calculated by subtracting the long-term EMA (26 periods) from the short-term EMA (12 periods)  The MACD has a positive value whenever the 12-period EMA is above the 26-period EMA  and a negative value when the 12-period EMA is below the 26-period EMA.

MACD VXI Algo Strategy

Strategy Logic

Long Entry: When MACD Cross Over Signal Line, send LE.

Long Exit: Either when SL or Target is hit. If SL/TGT is not hit and MACD Cross Under Signal Line, send LX, SE.

Short Entry: When MACD Cross Under Signal Line, send SE

Short Exit: Either when SL or Target is hit. If SL/TGT is not hit and MACD Cross Over Signal Line, send SX, LE.

MACD VXI Strategy Parameters for TradingView Charts

FastLength : 12-period EMA

SlowLength : 26-period EMA  

Intraday Trade Session : Entry Trade Will be Taken only on this session.

EXIT  Session : Trades will be squared off in this timeframe

Quantity: This is used to specify the trade quantity 

Custom Stop Loss in Points: Movement in chart price against the momentum which will trigger exit

Custom Target in Points: Movement in chart price against the momentum which will trigger exit

TradingView Settings

1: Download The Pine Script Algo  here

2: Open desired Chart in trading View with normal Candlestick, Select desired timeframe of the chart, Go to the pine editor section, remove the default code, paste the downloaded code,  save the file, and to chart. 

MACD VXI Algo Strategy

3: Once Strategy applied on chart, click on settings to optimize parameters  for your own trading.

MACD VXI Algo Strategy

Before setting up an alert, make sure of few things.

(1) You have selected the desired script, timeframe, and strategy settings.

(2) API bridge is configured and running.

Once you have made sure, click on settings. Then add alert and paste {{strategy.order.comment}} in the message box. 

Important: do not change any settings during live trading.

NOTE: The pinescript works both with webhook alerts (TV Pro plan) and normal popup alerts (TV free plan).

MACD VXI Algo Strategy