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 |

PCF code for exponential average in the past Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
Ricshar
Posted : Monday, June 25, 2018 11:34:11 AM
Registered User
Joined: 1/17/2018
Posts: 3

Is there a way to represent an exponential average from one or more days ago in PCF? 

Thanks...

Bruce_L
Posted : Monday, June 25, 2018 11:40:28 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

The 10 period exponential moving average of 1 bar ago would be:

XAVGC10.1

The 20 period expenential moving average of 3 bars ago would be:

XAVGC20.3

Moving Average



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Ricshar
Posted : Wednesday, June 27, 2018 3:56:52 PM
Registered User
Joined: 1/17/2018
Posts: 3

Thanks.

Can you do the same for Above Average Volume? (For example, did the stock close with above its 50-day average volume 1 bar ago?)

Bruce_L
Posted : Wednesday, June 27, 2018 4:02:00 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Please try the following.

V1 > AVGV50.1



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Ricshar
Posted : Wednesday, June 27, 2018 7:21:41 PM
Registered User
Joined: 1/17/2018
Posts: 3

That worked.

It occurred to me that I could also use the Prebuilt Condition "Above Average Volume" and set the "True" option to 1 bar ago. Does that yield the same result?

Bruce_L
Posted : Thursday, June 28, 2018 8:31:54 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

I had to actually add the prebuilt condition to my layout so I could check it out to see if it was using a 50 period simple moving average, but yes, that should work the same way without having to create a formula (it might even have a faster minimum refresh rate when done this way).



-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.