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

Create Scan Condition over multiple days Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
David-M
Posted : Sunday, February 10, 2013 2:40:15 PM
Platinum Customer Platinum Customer

Joined: 1/1/2005
Posts: 5

Hello,

I am wondering how to create a scan condition that scans the last n bars. For example, search for the 50 bar MA crossing up through the 100 day MA anytime in the last 5 bars.

Is it possible to do that with the new scan features of v12.3 or do I need to resort to using a PCF?

Thanks in advance.

Bruce_L
Posted : Monday, February 11, 2013 11:01:01 AM


Worden Trainer

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

You will need to use a formula of some sort. The purely formula based method of doing this would be something like the following:

(AVGC50 > AVGC100 AND AVGC50.1 <= AVGC100.1) OR (AVGC50.1 > AVGC100.1 AND AVGC50.2 <= AVGC100.2) OR (AVGC50.2 > AVGC100.2 AND AVGC50.3 <= AVGC100.3) OR (AVGC50.3 > AVGC100.3 AND AVGC50.4 <= AVGC100.4) OR (AVGC50.4 > AVGC100.4 AND AVGC50.5 <= AVGC100.5)

But there is another way to do this that while probably not necessary for something as short as five bars, is a lot more efficient when you are checking over a longer number of bars. Start by using a Condition Formula for a crossup as the Boolean Formula in a Custom PCF % True Indicator:

AVGC50 > AVGC100 AND AVGC50.1 <= AVGC100.1

Then set the Period of the Custom PCF % True Indicator to 5 and the Average Type to Simple. The Custom PCF % True Indicator will now be greater than 0 if the Condition was true at any point during the most recent 5-bars.

This allows you to click on the Custom PCF % True Indicator and select Create Scan Condition to create a Condition for the Custom PCF % True Indicator being greater than zero which will return the same results as the longer formula given above.

Create Conditions from Your Chart



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