I am replicating Raghee Horner's 34 EMA wave with GRaB candles (green, red, and blue candles).
See attached "example image" file for what it should look like. Instead my code is filling candles nonsensically - see "error image" file for what my indicator is outputting. The code is also attached.
I am using if...else if... statements to sort whether the candle is up or down, and whether the candle's close is above the 34 EMA on the high, between the 34 EMA on the high and low (inside the wave), or below the 34 EMA on the low. Thus, when the market breaks up through all three EMAs, up bars should be lime and down bars (but still above the wave) is dark green. Bars that are inside the channel (close, that is) should be light blue for up and dark blue for down (these are choppy bars, non-trending or reversing). Bars that are below the channel (close below red 34 EMA on lows) should be red if up bars and dark red if down bars.
Any help / commentary / advice would be greatly appreciated! Thanks guys!
Edit: also, ignore thinner blue moving averages. These are 13 and 21 EMAs. The GRaB candles only are colored based on the 34 EMAs, the thicker green, blue, and red EMAs that form a channel.
Comment