Registered User Joined: 1/28/2005 Posts: 6,049
|
Can a PCF be made to calculate the middle price of last month?
As of today July/2017 Monthly (H+L)/2.
Using date code it would not update as the days change.
I dont want to plot it but would like to test against it.
For future months it would require updating the date PCFs.
Thanks
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The middle price of last month using a monthly time frame would be the following.
(H1 + L1) / 2
There really isn't a way to do this using a daily time frame that would automatically update.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 1/28/2005 Posts: 6,049
|
This appears to work:
(GREATEST(
H.'7/03/17',
H.'7/05/17',
H.'7/06/17',
H.'7/07/17',
H.'7/10/17',
H.'7/11/17',
H.'7/12/17',
H.'7/13/17',
H.'7/14/17',
H.'7/17/17',
H.'7/18/17',
H.'7/19/17',
H.'7/20/17',
H.'7/21/17',
H.'7/24/17',
H.'7/25/17',
H.'7/26/17',
H.'7/27/17',
H.'7/28/17',
H.'7/31/17')+
LEAST(
L.'7/03/17',
L.'7/05/17',
L.'7/06/17',
L.'7/07/17',
L.'7/10/17',
L.'7/11/17',
L.'7/12/17',
L.'7/13/17',
L.'7/14/17',
L.'7/17/17',
L.'7/18/17',
L.'7/19/17',
L.'7/20/17',
L.'7/21/17',
L.'7/24/17',
L.'7/25/17',
L.'7/26/17',
L.'7/27/17',
L.'7/28/17',
L.'7/31/17'))/2
A little cumbersome but not too bad.
It plots and I can test against it.
Has a vertical look because its easier edit in a word document.
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Yes, but it has the fault you seemed to want to avoid. Having to change the formula all the time. If you are willing to do that, you can shorten the formula quite a bit.
(MAXH20.'7/31/2017' + MINL20.'7/31/2017') / 2
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 1/28/2005 Posts: 6,049
|
Thats what I was looking for.
I knew it would need to be updated each month.
When I mentioned update I was thinking of a range
like:
MAXH21.10 (whatever is needed to cover that trading day)
on the next trading day you make it:
MAXH21.11 and so on updating each day.
I was hoping date codes (like your PCF) would make it monthly updating vs daily.
Thanks
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Just make sure you count the number of trading days in the month before writing the formula.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|