♥ 0 |
Hello, I have found some answers that pertain to my desired outcome but have been unable to put them all together in a way that is accepted. Working on a 1 minute chart… when price closes higher than 9 EMA and higher than HMA 30 length then background changes to dark green
when price closes lower than 9 EMA and lower than HMA 30 length then background changes to dark red
when price is not above or below BOTH the 9 EMA and the HMA 30 length then background is current (which in my case is black). I have tried piecing together various bits of code to accomplish this task but have not been successful. Thanks for any help!
Marked as spam
|
Private answer
The same exact method used to change background colors of custom watchlist columns works for charts. So in order to find solutions like this you should also be sure to browse existing solutions in our "Watch Lists" topic. Using search, I discovered the following posts which are nearly a perfect match for your request: https://www.hahn-tech.com/ans/hma-and-ema-cross-to-watch-list/ https://www.hahn-tech.com/ans/how-many-days-ago-ema-cross-on-2hr/ The first post linked above actually points to the second one. Each request is slightly different but close enough that I was able to build your solution from the code provided in those previous posts. All I did was to change the moving averages to plot statements, removed the "data" variable which displayed the bar counts and removed two lines of code which performed the bar counts. You may find it helpful to use the watchlist solution in addition to your charts. Or you may find the watchlist solution is more effective.
Marked as spam
|
Please log in to post questions.