Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Compare %B Boliinger value against its EMA Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
RennyU
Posted : Sunday, June 3, 2018 8:33:53 AM
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

Bruce_L
Posted : Monday, June 4, 2018 10:23:55 AM


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
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.