Registered User Joined: 5/31/2011 Posts: 1
|
I have been creating a PCF to follow 20-Day Historical Volatility and I have a few questions:1) Is there a way to create variables so that I don't have to write out the formula for the mean average 20 times? That would help to keep the PCF cleaner.2) The Volatility numbers that I'm getting resemble figures I'm getting out of Excel, but do not match exactly. The calculations in the PCF are always a few points off. Is there a limitation in the PCFs regarding how far past the decimal point the calculations go? (The natural logs of the close to close price changes in my formula go out many places beyond the decimal point.) If that is the problem, is there any way to work around that in order to get exact figures? 3) Are there any shortcuts in the notation for standard deviation or variance? Something like: STDEV(), as it is in Excel?I am using TC2000 v.12Thank you so much for your help!
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The Personal Criteria Formula Language does not have syntax for constructing variables or loops. It is designed to represent a single formula on a single logical line and is not a scripting language. There is no built in syntax for standard deviation or variance.
Modelling Bollinger Bands (& Standard Deviation) in a TC PCF
The logarithmic historical volatility topic referenced by diceman should contain the correct PCF for the 20-Day Historical Volatility.
Based on my testing, the PCF Language seems to do its calculations using the IEEE 32-bit (4-byte) single precision floating point numbers. The values used can can range from -3.4028235E+38 through -1.401298E-45 for negative values and from 1.401298E-45 through 3.4028235E+38 for positive values. There is no way to force the calculations to use a different data type.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|