CAD vs CAD with a 12 EMA

How do I test CAD(chaikin a/d) vs the 12 period exponential moving average of CAD?
CAD() > CAD(MA( BARS=12))?

Hi Stephen,

That script would give you the CAD of the Moving Average. Use this instead:

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

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

thank you