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 vs 'Create Scan Condition' Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
fuhr
Posted : Monday, June 23, 2014 12:14:25 PM
Registered User
Joined: 9/27/2010
Posts: 29

Hi Bruce,

I have learned to write any PCF that I have need of, and have recently used the 'Create Scan Condition' feature on your charts for comparing related indicators - with good results.  Are these two scan methods equal in their results and speed of execution?  Any reason to favor one over the other (ie my PCF vs your internal code) for regular use in streaming scans?

Thanks

Bruce_L
Posted : Monday, June 23, 2014 1:01:17 PM


Worden Trainer

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

Create Scan Condition is almost always faster and more efficient to do the same thing as a Personal Criteria Formula. If you can click on the chart and select Create Scan Condition to do what you want, it is almost always the best way to do it.

In general, the reasons to use a PCF are because it can't be done by clicking on the chart and selecting Create Scan Condition, you need to plot the results on the chart, you need to use OR in an EasyScan, you need multiple conditions reflected in a WatchList Column or because it just ends up being really complicated to create by using Create Scan Condition.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
fuhr
Posted : Monday, June 23, 2014 1:58:06 PM
Registered User
Joined: 9/27/2010
Posts: 29

Hi Bruce,

Great, that's clear in my mind now and I will use 'Create Scan Conditions' wherever possible.

So I can use multiple 'Create Scan Conditions' for the same scan, but they will be cumulative with an expressed or implied 'AND' between them - but 'OR' cannot be used.  Correct? 

 

My scans are never complicated, but there is one scan I have never managed to create in 'Create Scan Conditions'.  That is to find instances where the 4 period ema of the 12 26 4 histogram is greater than the prior period, ie a rising ema (or macd or whatever) line.  Ideally, a bottoming ema, where this period is rising but the prior period was falling, but that may be asking a lot.

I do this now using a PCF, and it works, but the speed is 'Slow'.   Does 'Slow' imply that the results of the scan will be delayed on receipt by, what,  - 1, 2, 5, 20 seconds?

 

With reference to the ema question above, how do I compare one period of an indicator relative to the prior period of the same indicator in a created scan condition?

I see conditions like 'down net', 'down %', 'down amount', 'down smart', but nothing 'down relative'.  What am I missing?

Thanks

Bruce_L
Posted : Monday, June 23, 2014 2:34:01 PM


Worden Trainer

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

You are correct about how conditions are combined in EasyScans. There is in implied AND between all of the conditions and no way to use an OR instead without using a formula of sort.

You can use your condition as a WatchList Column and then right-click on the WatchList Column and select Edit Columns to determine by how much a particular condition would be delayed as the minimum available setting for the Refresh Rate reflects how speed and resource intensity of that WatchList Column.

Moving Down Net, Moving Down % and Moving Down Smart are all relative to prior bar.

You could be able to click on the 4-period exponential moving average of the MACD Histogram and select Create Scan Condition to create the desired condition.

You would probably want to use Moving Down Net with the Period set to 1 (so versus the previous bar) and Net Change < set to 0.00.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
fuhr
Posted : Friday, July 11, 2014 3:12:18 AM
Registered User
Joined: 9/27/2010
Posts: 29

Hi Bruce,

I need a bit more clarification here..

Suppose I needed to create a new scan that alerts me to a bottoming 10 period FW ema.  I want the current period ema to be greater than the prior period, and the prior period to be less than the one before.

This is easy (but slower) in a PCF, but how do I do it using Create Scan Condition methods?

I need two conditions in the scan.  The first one uses the condtion  of 'Moving Up Net' with the Period equal to '1' and Net Change set to '0.00'.  That gets me watchlist items with the ema moving up this period relative to the prior period.

The second condition, I think, would use the condition of 'Moving Down Net' with the Period equal to '2' and Net Change set to '0.00'.  But I suspect that what I am getting is condtions where my current ema value is less than the ema value of 2 periods ago.  That is, 0 > 1 AND 0 < 2.

What I want is 0 > 1 AND 1<= 2, given that '0' is the current period, '1' is the prior period, '2' is the period before that. 

How do I do that without being able to specify the period numbers to compare, using the more efficient  'Create Scan Condition' rather than a PCF?

 

Bruce_L
Posted : Friday, July 11, 2014 9:45:47 AM


Worden Trainer

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

You are correct that setting the Period of the Moving Down Net condition to 2 is comparing the current value to the value from 2 bars ago.

I'll start with the way I would normally create a bottoming condition. I add a 2-period simple moving average to whatever it is I'm checking and then look for whatever it is I'm checking to be crossing up the 2-period simple moving average.

Now the more general answer to your question of how to create conditions for a certain number of bars ago also involves adding a moving average. I generally add 1-period exponential moving average to the indicator of interest. Then set the Offset setting of the moving average to the number of bars ago of interest.

So using this technique would involve creating a condition for your 10 period FW ema moving up and another condition for a 1-period ema with the Offset set to 1 moving down.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
fuhr
Posted : Friday, July 11, 2014 11:49:06 AM
Registered User
Joined: 9/27/2010
Posts: 29

HI Bruce,

OK, let's see if I've got it right.

I have created an indicator, linked to 'Price', identified on the chart as 'FAvg 10'. 

I have created a second indicator, linked to 'FAvg 10', which is a one period EMA of the 'FAvg 10' indicator, and has the Period set to '1' and the Offset set to '2'.  This indicator is identified on the chart as 'EAvg 1 +2'

Then I created a scan condition for the 'FAvg 10' indicator, which has as its Condition 'Crossing Up Exp Moving Average 1 +2'.

This scan appears to give me the results I want.  Does the above construct, to generate a bottoming ema, appear correct to you?  You suggested " a 1-period ema with the Offset set to 1 moving down.".  I used an offset of '2' because I wanted to pick up a value two periods ago, but I'm not certain that I've got it right.

On a general note, is the purpose of 'offset' in the moving average toolkit to give us a chance to do these multiperiod compares?  Where can I read more about the purpose and usage of the offset value, both positive and negative signs'?

Bruce_L
Posted : Friday, July 11, 2014 1:13:26 PM


Worden Trainer

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

QUOTE (fuhr)
I have created an indicator, linked to 'Price', identified on the chart as 'FAvg 10'. 

I have created a second indicator, linked to 'FAvg 10', which is a one period EMA of the 'FAvg 10' indicator, and has the Period set to '1' and the Offset set to '2'.  This indicator is identified on the chart as 'EAvg 1 +2'

Then I created a scan condition for the 'FAvg 10' indicator, which has as its Condition 'Crossing Up Exp Moving Average 1 +2'.

This scan appears to give me the results I want.  Does the above construct, to generate a bottoming ema, appear correct to you?  You suggested " a 1-period ema with the Offset set to 1 moving down.".  I used an offset of '2' because I wanted to pick up a value two periods ago, but I'm not certain that I've got it right.

You want it to be moving down during the previous bar and moving up during the current bar, right?

If so, you need to have the offset set to 1, not 2, as you are interested in if it is moving down 1 bar ago.

This is true even though the condition needs to know both the values of 1-bar ago and 2-bars ago in order to determine if it is moving down 1-bar ago.

QUOTE (fuhr)
On a general note, is the purpose of 'offset' in the moving average toolkit to give us a chance to do these multiperiod compares?  Where can I read more about the purpose and usage of the offset value, both positive and negative signs'?

The purpose is to displace the moving average so it is either shifted to the left or shifted to the right by a certain number of bars. This is allowed because this is the preferred way to view moving averages for some technical analysts.

Try an internet search for "displaced moving average" to find more information about interpretation and why you might want to shift the moving average from where it is normally displayed.

The fact that it allows us to create conditions based on older values of indicators instead of just creating conditions based on the current values is just a neat little workaround which results from how they work.



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