looking for some help - i want to create an alert based on this custom candle coloring strategy (see below). Can someone help me?
so for example, i'd like to get an alert when the candles on a chart in my watchlist change from dark red to light red, or dark green to light green. i have about 10 stocks in my watchlist.
input price = close;
plot ma09 = ExpAverage(price, 9);
plot ma21 = ExpAverage(price, 21);
plot ma100 = ExpAverage(price, 100);
plot ma200 = ExpAverage(price, 200);
def bearish = ma100 < ma200 and ma09 < ma21;
def weakbear = ma100 < ma200 and ma09 > ma21;
def bullish = ma100 > ma200 and ma09 > ma21;
def weakbull = ma100 > ma200 and ma09 < ma21;
Assignpricecolor (if bearish then color.light_red else if weakbear then color.dark_red else if bullish then color.light_green else if weakbull then color.dark_green else color.current);
so for example, i'd like to get an alert when the candles on a chart in my watchlist change from dark red to light red, or dark green to light green. i have about 10 stocks in my watchlist.
input price = close;
plot ma09 = ExpAverage(price, 9);
plot ma21 = ExpAverage(price, 21);
plot ma100 = ExpAverage(price, 100);
plot ma200 = ExpAverage(price, 200);
def bearish = ma100 < ma200 and ma09 < ma21;
def weakbear = ma100 < ma200 and ma09 > ma21;
def bullish = ma100 > ma200 and ma09 > ma21;
def weakbull = ma100 > ma200 and ma09 < ma21;
Assignpricecolor (if bearish then color.light_red else if weakbear then color.dark_red else if bullish then color.light_green else if weakbull then color.dark_green else color.current);