Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 10/7/2004 Posts: 35
|
When I create an EasyScan using a PCF that returns a Boolean value (True or False), the scan editor provides a dropdown selection box to pick the PCF that I would like to use. It then returns the selected PCF to the evolving scan, assuming that the desired condition is True. In some cases, that is appropriate. In other cases, I need to use False, rather than True. For example, another TCNet user and I are sharing PCFs that identify overlapping sets of symbols. We would like to be able to create scans that produce the intersection set (both conditions true) and the outliers (the union set minus the intersection set). This could be accomplished by creating an additional PCF for each case, where the second PCF multiplies the value returned by the first PCF to negate the condition (flip the value from True to False or False to True). That's another item in a long and ever growing list. It would be nice if I could use the scan editor to set the desired value for the Boolean condition to true or false as needed. Is this there, and I missed where to find it, or is this to be addressed in a future upgrade?
Thanks for your help!
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 18,819
|
If you put a SGN() around your Boolean elements it will return a 0 for false and a -1 for true instead of TRUE/FALSE.
When you add it to the scan you will get a range selector with two possible values (-1 to 0). You can then limit the values to 0.
Here is an example
AVGC10>AVGC20
This will return a value of TRUE if the 10 is above the 20. You add this to an EasyScan and you will immediately limit the results to stocks where TRUE was returned for this condition
Now try this:
SGN(AVGC10>AVGC20)
This will return -1 if the Boolean is true, 0 if it is false. If you add this to an EasyScan you will get the range selector and you can choose one value over the other.
- Craig Here to Help!
|
|
Registered User Joined: 10/7/2004 Posts: 35
|
Thanks! That's a solution that avoids the need to maintain several copies of a PCF! This is one case where less is REALLY more! You've made my day!
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 18,819
|
For kicks and giggles you should check out this video:
Constructing more versatile and reusable Personal Criteria Formulas
It shows how to avoid Boolean all together and increase the flexibilty of your PCFs.
- Craig Here to Help!
|
|
Guest-1 |