Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

PCF expression for exponential TSV Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
warrenshepherd
Posted : Tuesday, July 7, 2009 9:24:58 PM
Gold Customer Gold Customer

Joined: 12/21/2004
Posts: 13
I'm trying to build a PCF that uses the 19 day exponential average of the exponential 38 day TSV.  I want to write the phrase for that value and for that value 4 days ago..........

can you assist me?  thanks.......
Bruce_L
Posted : Wednesday, July 8, 2009 7:18:05 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
The current value of the 19-Period Exponential Moving Average of a 38-Period Exponential TSV could be written as:

(37 * XAVG(TSV,38) - 18 * XAVG(TSV,19)) / 19

The value from 4-Periods Ago of the 19-Period Exponential Moving Average of a 38-Period Exponential TSV could be written as:

(37 * XAVG(TSV1.4,38) - 18 * XAVG(TSV1.4,19)) / 19

You may wish to review the following:

Cascades of Moving Averages
How to create a Personal Criteria Forumula (PCF)
PCF Formula Descriptions
Handy PCF example formulas to help you learn the syntax of PCFs!

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
warrenshepherd
Posted : Thursday, July 9, 2009 3:25:51 PM
Gold Customer Gold Customer

Joined: 12/21/2004
Posts: 13
Bruce, thank you for your response.  The expression must be a way to calculate the value desired.  The expression is much more complicated than I thought it would be.

Can you assist me then with what I hope is a simpler question:  What is the proper expression for the current value of an exponential TSV of period 38?  I take it that there is no simple closed expression to indicate that the TSV is exponential versus simple?

thanks....warren
Bruce_L
Posted : Thursday, July 9, 2009 3:42:34 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
An 38-Period Exponential TSV can be written as:

XAVG(TSV,38)

It is a just the 38-Period Exponential Moving Average of the raw TSV.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
warrenshepherd
Posted : Thursday, July 9, 2009 7:41:55 PM
Gold Customer Gold Customer

Joined: 12/21/2004
Posts: 13
Thanks, Bruce.  Well, I guess I am quite confused now.  When one selects the TSV indicator, one has a choice of period (since it is an average), and one has a choice of whether the TSV is done arithmetically or exponentially.  So, I would think that one has two fundamental choices of TSV, arithmetic or exponential.  (And when one looks at the graph under either exponential or arithmetic, one gets different graphs.)  And that one would have two fundamental choices of an average of the TS, either arithmetic or exponential. (Again, they appear to give different graphs.)

Then, once one has chosen either the arithmetic or the exponential TSV, one may then take an average over another period, and that average can either be arithmetic or exponential.  

So, the way I have thought of it, there are 4 different items that should be differentiated:
(a) an arithmetic 38 period TSV with its arithmetic 19 period average;
(b) an arithmetic 38 peiod TSV with its exponential 19 period average
(c) an exponential 38 period TSV with its arithmetic 19 period average;and 
(d) an exponential 38 period TSV with its exponential  19 period average.

Do not all of these items exist and are they not distinct?
If they do not all exist, please let me know which do not.
If they do exist, please differentiate their written algebraic denotation.

Thanks, and sorry for my thorough confusion.............warren
Bruce_L
Posted : Friday, July 10, 2009 8:08:27 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
They all exist. The Period of the TSV refers to the Period of either a Simple or Exponential Moving Average that is applied to the raw TSV calculations. If the Period is set to 1, a Simple and Exponential Moving Average will return the same results.

The format of TSV and the Moving Average functions that can be applied in TeleChart's Personal Criteria Formula Language are as follows:

PCF Formula Descriptions

Indicator:

TSVy.z -> Time Segmented Volume

Functions:

AVG(w,x) -> Simple Moving Average
XAVG(w,x) -> Exponential moving Average

Where w is the Number or Indicator to which a Function is applied.
- w cannot be a formula or function for AVG(), XAVG()
Where x is the Period of the Indicator or Function.
Where y is a the Period of an additional Simple Moving Average.
Where z is the number of Periods Ago.
- z can also be a date. May 3, 2007 would be (single quotes required): '05/03/07'

The arguments in indicators are separated by periods while the arguments in functions are separated by commas.

The built in Simple Moving Average in the PCF syntax for TSV means a 38-Period Simple TSV can be represented as:

TSV38

Since the PCF syntax for TSV does not include an Exponential Moving Average, the Exponential Moving Average Function must be used to get an Exponential Moving Average of the raw TSV to represent a 38-Period Exponential TSV:

XAVG(TSV,38)

A 19-Period Simple Moving Average of a 38-Period Simple TSV can be created by applying the AVG() function to a TSV that is already using its Simple Moving Average parameter. Either of the following would return the correct result (as the order that the Moving Averages are applied does not matter):

AVG(TSV38,19)

Or:

AVG(TSV19,38)

In the case of a 19-Period Exponential Moving Average applied to a 38-Period Simple TSV, the EMA needs to be applied using a function while the Simple Moving Average can be applied using the TSV parameter:

XAVG(TSV38,19)

In the case of a 19-Period Simple Moving Average applied to a 38-Period Exponential TSV, the EMA still needs to be applied using a function while the Simple Moving Average can be applied using the TSV parameter:

XAVG(TSV19,38)

The 19-Period Exponential Moving Average of a 38-Period Exponential TSV is more complicated because the XAVG() function cannot accept functions or formulas as arguments. The following syntax would make sense except that it is not valid because of this limitation:

XAVG(XAVG(TSV,38),19)

We can use the techniques explained in Cascades of Moving Averages to "uncascade" the Moving Averages however into:

(37 * XAVG(TSV,38) - 18 * XAVG(TSV,19)) / 19

By using theorum 1 from Bustermu's Saturday, May 07, 2005 5:58:06 PM ET post.

Theorem 1: If P<>Q and X is any data sequence, then

EVG(EVG(X,P),Q) = ((P-1)/(P-Q))*EVG(X,P)+((Q-1)/(Q-P))*EVG(X,Q)

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