Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 10/12/2012 Posts: 6
|
Hello all,
Please can I have some help writing the following as a PCF Condition?
if ((Hours of the trading day past) * Current Volume) > 20 day moving average volume {
return true;
} else return false;
An example of "Hours of the trading day past" is as follows:
at 10am, "Hours of the trading day past" = 0.5,
I am using TC2000 v 12.3 Gold.
Thanks.
A.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
While it uses a 100-Period Simple Moving Average of Daily Volume instead of a 20-Period Moving Average, this is how Volume Buzz works.
You can use Volume Buzz as a WatchList Column, but it is not possible to use it as an EasyScan Condition. It is also not possible to create the desired Condition Formula as the Personal Criteria Formula Language does not have syntax for referencing the time of day.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 10/12/2012 Posts: 6
|
Thanks Bruce.
Allow me to explain my higher level problem that I wish to solve as it's possible that I'm not asking the right question.
I am not a professional trader. I use TC2000 to send simple price alerts to my cell phone.
When a stock is above a certain price I receive a text message and then I check the volume using the TC2000 android app. If the volume is high then I will place an order to buy the stock.
So I want to create an alert that is as follows:
if ((price > my price) && (volume is high)) {
return true;
} else {
return false;
}
Do you have any suggestions? Perhaps a completely different approach will work, e.g. watchlists.
Thanks,
A.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
There is no way to make an Alert or EasyScan which takes the time of day into account when determining if "volume is high".
It is possible to add a Volume Buzz WatchList Column and then save your WatchList Column so you can bring it up in TC2000 for Tablets.
Adding & Editing WatchList Columns
Saving & Re-Using Groups of Columns
But I do not know of a way to display Volume Buzz in TC2000 for Mobile Phones.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Gold Customer
Joined: 10/7/2004 Posts: 50
|
I have been away for some time and want to get into writing a few PCFs again - this one is too complicated for me at this point. I want to have a PCF that finds a MACD kiss. Namely, a point when the MACD and its moving average are very close though not necessarily a cross over. I looked through the MACD posts and could not find this. Can you help me? Thanks.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
A Condition Formula for the difference between an Exponential MACD 12,26 and its 9-Period Exponential Moving Average is the same as the formula for an Exponential MACD Histogram 12,26,9:
XAVGC12- XAVGC26 - XAVG(XAVGC12,9) + XAVG(XAVGC26,9)
The absolute value of this would just be:
ABS(XAVGC12- XAVGC26 - XAVG(XAVGC12,9) + XAVG(XAVGC26,9))
While you could check for this to be less than some arbitrary value (the following is just an example):
ABS(XAVGC12- XAVGC26 - XAVG(XAVGC12,9) + XAVG(XAVGC26,9)) < .05
This would probably not be desirable because the magnitude of this value depends as much on the magnitude of price as upon any perceived closeness. So what you would probably want to do is calculate the closeness as the percentage of price or the moving average of price.The long period of the MACD is as good a value as any. The following checks for the magnitude of the difference to be less than 1% of the long moving average, but you can adjust it as desired.
100 * ABS(XAVGC12- XAVGC26 - XAVG(XAVGC12,9) + XAVG(XAVGC26,9)) / XAVGC26 < 1
Understanding MACD
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Gold Customer
Joined: 10/7/2004 Posts: 50
|
Thanks, Bruce. I visually backtested several stocks and found that .03 is a reasonable squeeze size to start. Having said this, using a percentage can still be widely variable as you infer. This should be very helpful in the future when applied to many stocks however. It is taking me awhile to get back into writing PCFs like I did years ago. However, I am almost to the point where, thanks to you, I am seriously thinking about upgrading to Platinum. Cheers, glmus
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |