New Members: Be sure to confirm your email address by clicking on the link that was sent to your email inbox. You will not be able to post messages until you click that link.

Calculating a Percent Variance

I'd like to calculate the absolute difference between's today's 9EMA and 20EMA then divide that result by the original 9EMA. Once that value has been determine, I want to test that it is less than 1%.

The formula I'm after is: (AbsVal(9EMA-20EMA)/(9EMA))<.01

I tried nesting the difference in EMA's with brackets (with & without the AbsVal operator), then used the "/" division component to divided that value by the 9EMA (also with brackets). However, I received a syntax error as it does not recognize the "/" operator.

What am I missing or is there another way to approach this calculation?

Thanks

Comments

  • Unfortunately, the absval function only returns the absolute value of an indicator, not a mathematical operation.

    so, you have to do it with or statements. The first or statement would account for the 9 above the 20, the second would account for the 20 above the nine. I'm not sure if want to account for the 9 equals the 20.
Sign In or Register to comment.