Registered User Joined: 5/17/2018 Posts: 1
|
Hello,
I’m testing the Bollinger Band %B(20, 2) against the EMA (9 periods) over it.
The PCF I’m writing is asking this question (in pseudo code): %B > (1.3*EMA9)
The actual code is:
((C0 - XAVGC20.0) / 2 / 2 / STDDEV20.0) +0.5 > 1.3*XAVG(((C0 - XAVGC20.0) / 2 / 2 / STDDEV20.0) + .5, 9)
As it stands, the above code is slow. You can see the duplication. Is my approach to the above question correct? Can I create and assign variables to speed up the code?
Thank you for any advise you can give me.
Regards
Renny
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
There really isn't all that much you can cut from the formula.
(C - XAVGC20) / STDDEV20 > 1.3 * XAVG((C - XAVGC20) / STDDEV20, 9)
It is not possible to create user defined variables in the Personal Criteria Formula Language.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|