OPEN-SOURCE SCRIPT

2 MA + Strat Candle Colors

195
The "2 MA + Strat Candle Colors" indicator combines two customizable moving averages (MAs) with a strategic candle-coloring system to help traders analyze trends and price action. Here’s a breakdown of its features:

1. Two Moving Averages (MAs):
MA 1 & MA 2 Settings:

Users can select between 7 MA types for each line: SMA, EMA, WMA, HMA, VWMA, LSMA, SMMA.

Adjustable periods and price sources (e.g., close, open) for both MAs.

Default settings: MA 1 = 9-period EMA, MA 2 = 20-period EMA.

Plotting:

MA 1 is blue, MA 2 is red (colors customizable via inputs).

Crossovers between the MAs can signal trend changes.

2. Strategic Candle Coloring:
Candles are colored based on their relationship to the previous candle:

Green (Bullish): "Two-Up Bar" – current high > prior high, and low does not break prior low.

Red (Bearish): "Two-Down Bar" – current low < prior low, and high does not break prior high.

Purple (Outside Bar): "Three Bar" – current candle engulfs the prior candle (higher high and lower low).

Yellow (Inside Bar): "One Bar" – current candle is contained within the prior candle’s range.

Candle coloring is based on: https://tradingview.com/v/PWJRC2Nt/

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.