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 |

Using a one custom PCF in another custom PCF...? Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
IBJAMIN
Posted : Saturday, August 17, 2013 6:19:00 PM
Registered User
Joined: 4/19/2012
Posts: 11

Is it possible to use a custom PCF I've created and saved (in My Indicators) in another custom PCF? I have named the custom indicator with no blanks or special characters (thinking maybe that was confusing the PCF editor) but can't seem to get the program to recognize it.

Bruce_L
Posted : Monday, August 19, 2013 10:33:08 AM


Worden Trainer

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

There is no syntax available in the Personal Criteria Formula Language for referencing another PCF. You would generally need to include all of the calculations of the PCF you wish to reference in order to utilize its value in another PCF.

PCF Formula Descriptions



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
IBJAMIN
Posted : Monday, August 19, 2013 5:57:57 PM
Registered User
Joined: 4/19/2012
Posts: 11

Thanks, Bruce. I was afraid of that. But perhaps there is another way to accomplish my objective.

What I want to do is calculate and plot an average of a variable when a certain condition is met. For instance, say the average price of a stock when its TSV is greater than 0. (Not the exact thing that I am trying to do, but it demonstrates the principles that I think are involved.) [I’ve been working with PCFs for only a short time, so please be gracious if my logic and skills are not quite up to snuff yet! ;-D]

As far as I can determine, I need to create two custom PCF cumulative indicators that would look something like this:

CountTSVgt0 = Formula( TSV > 0 , H < L , 1 )

and

CumPriceIfTSVgt0 = Formula( TSV > 0 , H < L , (H + L ) / 2 )

Then, a third custom PCF (not cumulative) indicator that would be:

CumPriceIfTSVgt0 / CountTSVgt0

I thought by creating the first two as specific &rdquo;My Indicators&rdquo; I could reference them directly in a third PCF. According to your answer to my initial question, this is not possible -- so I would have to include the calculations of a cumulative PCF in a non-cumulative PCF - can this be done? Or is there another way to do this? TIA!

Bruce_L
Posted : Tuesday, August 20, 2013 8:56:26 AM


Worden Trainer

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

You can do this as a Personal Criteria Formula using a fixed number of bars, but not as a cumulative indicator from the beginning of the plot. Let's say we did this over 5 bars. We would get the following for the count:

ABS(TSV > 0) - (TSV1.1 > 0) - (TSV1.2 > 0) - (TSV1.3 > 0) - (TSV1.4 > 0)

And the following for the sum over 5 bars:

(ABS(TSV > 0) * (H + L) - (TSV1.1 > 0) * (H1 + L1) - (TSV1.2 > 0) * (H2 + L2) - (TSV1.3 > 0) * (H3 + L3) - (TSV1.4 > 0) * (H4 + L4)) / 2

With the following as the average:

(ABS(TSV > 0) * (H + L) - (TSV1.1 > 0) * (H1 + L1) - (TSV1.2 > 0) * (H2 + L2) - (TSV1.3 > 0) * (H3 + L3) - (TSV1.4 > 0) * (H4 + L4)) / 2 / (ABS(TSV > 0) - (TSV1.1 > 0) - (TSV1.2 > 0) - (TSV1.3 > 0) - (TSV1.4 > 0) + .0000001)



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