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

PCF Condition Formula Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
truetrend
Posted : Thursday, January 5, 2017 3:28:38 PM
Registered User
Joined: 6/16/2005
Posts: 131

Can I create this PC Condition Formula that shows as true in a range?  In other words, a PCF that does the following...

C.30>cavg300.30 and (sometime between 2 and 29 days ago, price touches or crosses below cavg300)

Its the range of 'between 2 & 29 days' that has me.  I dont care when the cross/touch occurs, but just that it does between 2 and 29 days ago.  Thanks.

StockGuy
Posted : Thursday, January 5, 2017 3:40:03 PM

Administration

Joined: 9/30/2004
Posts: 9,187

Not really a way to do that easliy in the current PCF language, but the next release of TC2000 version 17 will have a "SinceTrue" fuction.

You will be able to plot the following as a Custom PCF Indicator...

SinceTrue(C1>AVGC300 and C <= AVGC300, 30)

...and then create a scan condition from that plot and scan for values between 2 and 29.

Bruce_L
Posted : Thursday, January 5, 2017 3:40:38 PM


Worden Trainer

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

Please try the following Condition Formula.

C30 > AVGC300.30 AND (L2 <= AVGC299.3 OR L3 <= AVGC299.4 OR L4 <= AVGC299.5 OR L5 <= AVGC299.6 OR L6 <= AVGC299.7 OR L7 <= AVGC299.8 OR L8 <= AVGC299.9 OR L9 <= AVGC299.10 OR L10 <= AVGC299.11 OR L11 <= AVGC299.12 OR L12 <= AVGC299.13 OR L13 <= AVGC299.14 OR L14 <= AVGC299.15 OR L15 <= AVGC299.16 OR L16 <= AVGC299.17 OR L17 <= AVGC299.18 OR L18 <= AVGC299.19 OR L19 <= AVGC299.20 OR L20 <= AVGC299.21 OR L21 <= AVGC299.22 OR L22 <= AVGC299.23 OR L23 <= AVGC299.24 OR L24 <= AVGC299.25 OR L25 <= AVGC299.26 OR L26 <= AVGC299.27 OR L27 <= AVGC299.28 OR L28 <= AVGC299.29 OR L29 <= AVGC299.30)



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
truetrend
Posted : Thursday, January 5, 2017 4:04:31 PM
Registered User
Joined: 6/16/2005
Posts: 131

Stockguy - Thanks.  When will the next V17 be released?

Bruce - Thanks.  I will test it tonight.

StockGuy
Posted : Thursday, January 5, 2017 4:05:50 PM

Administration

Joined: 9/30/2004
Posts: 9,187

No ETA yet but should be soon.

Bruce_L
Posted : Thursday, January 5, 2017 4:06:23 PM


Worden Trainer

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

You're welcome. The next version should be released soon, but I don't have a specific date.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
truetrend
Posted : Thursday, January 5, 2017 4:15:01 PM
Registered User
Joined: 6/16/2005
Posts: 131

Bruce - Why did yu switch to using the 299ma verses the 300ma in the above formula? Curious as to your thought processes. 

Bruce_L
Posted : Thursday, January 5, 2017 4:26:04 PM


Worden Trainer

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

The low being below the 300 period simple moving average of the close does not mean price was ever actually touching the 300 period simple moving average.

This is because at the time of the low, the 300 period simple moving average would have been lower then the eventual value of the 300 period simple moving average. So the low could be above the 300 period simple moving average at the time of the low even though the low ends up being below the eventual 300 period simple moving average. So price never actually touched the 300 period simple moving average.

The 300 period simple moving average at the time of the low would be:

(L + 299 * AVGC299.1) / 300

So, at the time for the low, the following would need to be true for price to touch or be below the 200 period simple moving average.

L <= (L + 299 * AVGC299.1) / 300

300 * L <= L + 299 * AVGC299.1

299 * L <= 299 * AVGC299.1

L <= AVGC299.1

It is that last simplification which I used in the formula.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
truetrend
Posted : Thursday, January 5, 2017 4:42:09 PM
Registered User
Joined: 6/16/2005
Posts: 131

Thanks Bruce.

Bruce_L
Posted : Thursday, January 5, 2017 4:45:24 PM


Worden Trainer

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

You're welcome.



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