♥ 0 |
I’m working on adding multiple labels (with or w/o plots) but I want the label itself to say Stacked and turn green if the moving averages are stacked or red if they are not stacked. I’m using 10EMA, 21EMA, 50SMA, 200 SMA. By stacked, I mean the price is above the 10EMA, 21EMA, 50SMA, 200SMA. If price is below any one of those it should be RED. So here’s my current code for the moving averages but I’m struggling with the label and read through all of the other post and still confused. Thanks in advance! defineGlobalColor(“EMA10”, color.yellow); def sma200 = simpleMovingAvg(close,200); plot EMA10_ = ExpAverage(close,10); AddLabel(sma200,sma50, ema21, ema10″Stacked: ” ) , (if SMA200 < SMA50 <EMA21 < EMA10 < price then Color.GREEN else Color.Red)); RESOLVED
Marked as spam
|
Please log in to post questions.