I have been trying to figure out how to add an alert to a MACD Histogram crossover of the zero line on thinkorswim charts. If ANYONE could help and tell me what I am doing wrong with the code, it would be GREATLY appreciated!!! I have tried a number of things, but nothing works for me. Hey, coding is hard! My latest attempt is as follows: ===== #MACDHistogram # declareby Erica - Trading Discussion
The following code works, now I need to tweak the colors! ======== declare upper; def avg8 = ExpAverage(close, 8); def avg20 = ExpAverage(close, 20); def isAbove = Average(close, 8) crosses above Average (close, 20); def isBelow = Average(close, 8) crosses below Average (close, 20); AssignBackgroundColor(if ExpAverage(close, 8)>=ExpAverage(close, 20) then color.LIGHT_GREby Erica - Trading Discussion
/TF, /NQ & /ES However, after you mentioned it, I tried some other equities (like AAPL), but still no luck. ??? I also tried to change the code for the color from: CreateColor(153, 255, 153) to Color.LIGHT_GREEN ... but it still would not work. ??? Maybe it's my computer? Thanks anyway!by Erica - Trading Discussion
Thanks! The code was accepted by TOS, but it does not change the background color on the crossovers. Any other thoughts???by Erica - Trading Discussion
First time poster. I am trying to do a simple script that changes the background color of the upper panel when the 8ema crosses above or below the 20ema. The following code does not work, any thoughts? Thanks! ============== declare upper; plot avg = ExpAverage(close, 8); plot avg = ExpAverage(close, 20); ExpAverage8.hide(); ExpAverage20.hide(); plot isAbove = Average(closby Erica - Trading Discussion