OPEN-SOURCE SCRIPT

250710 Momentum Buy Trigger

103
What It Does (Step by Step)

Sets Up a Moving Average
Calculates a 200-period Simple Moving Average (SMA) of the closing price.
You can change the period by adjusting the maPeriod input.
Calculates Momentum with MACD Histogram
Uses MACD (Moving Average Convergence Divergence) with standard settings:
Fast EMA: 12
Slow EMA: 26
Signal Line: 9

Subtracts the signal line from the MACD line to get the MACD histogram (a momentum indicator).

Defines a Buy Signal
The script checks two conditions:

Price is below the 200-period SMA → suggesting the asset is undervalued.

MACD histogram is rising (i.e., current value is greater than the previous bar) → suggesting bullish momentum is starting.

If both are true on the same bar, a "Buy" signal is generated.

Exención de responsabilidad

La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.