♥ 0 |
Hello, I am having trouble coding this study. I am trying to make a lower study that represents which ema is over the other. I need it so that if the 12 ema is above the 30 ema, a green dot is plotted in a lower study, and if the 30 ema is above the 12 ema a red dot is plotted in a lower study. Thank you!
Marked as spam
|
Private answer
Here is the code from the post I linked, with the Double moving average code replaced by two simple moving averages:
Marked as spam
|
|||
Private answer
Pretty sure we show how to do this here: https://www.hahn-tech.com/ans/horizontal-line-moving-average/ You will have to adapt it to work with your chosen moving averages, but the core components are all there. Marked as spam
|
Please log in to post questions.
How do I change the SMAs to EMAs in this script?
I must be doing a lousy job teaching this subject.
Check here for details:
http://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Tech-Analysis/ExpAverage.html
And here are the changes:
def ma1 = ExpAverage(close, MA1_length);
def ma2 = ExpAverage(close, MA2_length);