Optuma Forums › Optuma Scripting › CAD vs CAD with a 12 EMA › Reply To: CAD vs CAD with a 12 EMA
January 4, 2021 at 10:32 am
#61909
- Topics: 40
- Replies: 2,017
- Posts: 2,057
Hi Stephen,
That script would give you the CAD of the Moving Average. Use this instead:
1 2 3 |
MA(CAD(), BARS=12, STYLE=Exponential) |
This is the Moving Average of the CAD.
When you say “Test” are you using the signal tester to compare them? Or are you looking for a signal when the CAD crosses above the MA of the CAD? If so, remember that greater than is true for every day while the CAD is above the MA. We call that a “condition”. A signal is a discrete event that happens once. Try this code instead
1 2 3 4 5 |
c1 = CAD(); m1 = MA(c1, BARS=12, STYLE=Exponential); c1 CrossesAbove m1 |
On running this though, there may be issues because volume is being used in this value. See how you go but you may need to divide c1 by 10000000
All the best
Mathew