Price – % from EMA


Category:
0
0

Hi Pete,

You’ve been a major help to me with several TTM Squeeze scans – thanks! I now have a TOS WL question that I cannot find a related post on in the forum. Would it be possible to create a column that shows a percentage of how far away the last price is from an EMA? I’m using the 65 EMA as an example.

I’ve been trying to create this with the Condition Wizard but aren’t having any luck.

Thanks!

Nick

Marked as spam
Posted by (Questions: 3, Answers: 0)
Asked on January 25, 2021 6:07 pm
198 views
0
Private answer

This should do it:

input maLengthOne = 65;
input maTypeOne = AverageType.EXPONENTIAL;
input maPriceOne = close;
def maOne = MovingAverage(maTypeOne, maPriceOne, maLengthOne);
plot percentFrom = 100 * (close / maOne - 1);

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on January 26, 2021 10:58 am
0
I am trying to understand why you included details about the ATR and Keltner channels when your request seems to be nothing more than the following: "...background color turn green, when the parameters on the watchlists are between 0% and 0.30%..." If this is your true request, I suggest you post this as a new question as the solution is too complex to properly address in the comments section of a completed solution. Just be sure to leave out everything except the most essential details and include a link to this post so other viewers reference the original code.
( at November 29, 2022 6:00 pm)
0
...I suggest you post this as a new question as the solution is too complex to properly address in the comments section of a completed solution.
( at November 29, 2022 6:29 pm)