OPEN-SOURCE SCRIPT

MACD Crossover with Price Action and Alerts

79
The MACD should use the default parameters (12, 26, 9) for fast EMA, slow EMA, and signal EMA, respectively, applied to the Close price. Instead of simple MACD crossovers, the indicator should analyze price action in relation to the MACD histogram to generate signals. Specifically: 1. BUY signal: Generate a buy signal (an up arrow displayed below the low of the signal bar in green color) when the MACD histogram crosses above zero AND the price action shows a bullish engulfing pattern (the current candle's body completely engulfs the previous candle's body). 2. SELL signal: Generate a sell signal (a down arrow displayed above the high of the signal bar in red color) when the MACD histogram crosses below zero AND the price action shows a bearish engulfing pattern (the current candle's body completely engulfs the previous candle's body). The arrows should be non-repainting, meaning that once an arrow is plotted on a bar, it should not disappear or change position as the chart updates. The indicator should also plot the MACD line, signal line, and histogram using their default calculations. The MACD line should be blue, the signal line should be orange, and the histogram should be displayed using green bars for positive values and red bars for negative values. The indicator should also have customizable inputs for the MACD fast EMA period, slow EMA period, signal EMA period and engulfing pattern check enabled/disabled. If engulfing pattern check disabled, the indicator will generate signals based only on MACD histogram crossing zero.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.