Page 1 of 1
average for 5 mins interval
Posted: Mon Apr 08, 2013 8:59 am
by james123
Hi, is anyone know how to calculate the 5 mins interval average?
I have 5 mins interval data for return from 8:00 to 15:00 everyday. And I am looking to calculate all the 8:00-8:05 average value. How to calculate it?
Many Thanks
Re: average for 5 mins interval
Posted: Mon Apr 08, 2013 10:27 am
by EViews Gareth
How is your workfile currently structured?
Re: average for 5 mins interval
Posted: Mon Apr 08, 2013 10:58 am
by james123
How is your workfile currently structured?
Hi, my workfile current structured as the following:
8/28/2012 08:00 5772.07
8/28/2012 08:05 5769.48
8/28/2012 08:10 5767.63
8/28/2012 08:15 5765.38
.....
3/12/2013 13:00 6508.39
3/12/2013 13:05 6509.67
3/12/2013 13:10 6509.27
3/12/2013 13:15 6511.84
3/12/2013 13:20 6511.73
and thanks for your reply.
Re: average for 5 mins interval
Posted: Mon Apr 08, 2013 11:01 am
by EViews Gareth
Could you provide the workfile?
Re: average for 5 mins interval
Posted: Mon Apr 08, 2013 11:04 am
by james123
Sure, and here it is.
Re: average for 5 mins interval
Posted: Mon Apr 08, 2013 11:40 am
by EViews Gareth
Possibly the easiest way is to open up the series, click on View->Descriptive Statistics->Stats by Classification, then enter "@hour @minute" in the Series/Group to classify box.
Re: average for 5 mins interval
Posted: Mon Apr 08, 2013 11:53 am
by james123
Thank you so much, the results are the exactly I need. Thank you again. :D
Re: average for 5 mins interval
Posted: Mon Apr 08, 2013 12:40 pm
by james123
Thank you for your helps, and I am wanding how to perform the following:
we have already performed to calculate the average for the 5 mins interval. Some averages show positive, and others show negative. Then, suppose we only care about, on average, either the price go up or go down (either positive or negative) in 5mins interval. How can test the following:
Basiclly, the totally obervisations are 14078, we can use 12000 sample to calculate the average for daily 5 mins interval. And then we use another 2078 sample to test the trending forecast ability ( either postive or negative). And calculate the probaility of correct direction forecasting.
Is it possible to do the above? If so, how?
Re: average for 5 mins interval
Posted: Mon Apr 08, 2013 1:33 pm
by EViews Gareth
You'll have to provide more details.
In response to the generic question "it is possible to use a subset of observations to estimate a model, then use the remaining observations to forecast from that model and judge forecast accuracy", then the answer is "yes, that's a main component of EViews".
Re: average for 5 mins interval
Posted: Mon Apr 08, 2013 4:10 pm
by james123
Thank you for your reply. Basically, there is no model. I want to test whether the average value of 5 mins interval can generally forecaste the other day's trend of 5 mins interval. According to the intraday periodicity characteristic, there should be a high forecast ability by using average, I guess. If the test results keep the consistency with the theory, says about 65% correct forecast of the trend by using average value. Then we can program a trading strategy. And the strategy is simple, that is only to trade if the forecasted average is positive.
The test I need to do is to test whether the pasted 5 mins interval average can generlly forecast the trend of other day's 5 mins interval. As you mentioned above, We can produce this average by using @hour @minute, but how to perform a test for out of sample period? Says, there is 14078 data in total, we calculate the 5 mins interval average by using 12078 data, and to use other 2000 to test the forecast ability. I attached the e-views workfile in this message as well.
Looking forward to hear from you
Many Thanks
Re: average for 5 mins interval
Posted: Mon Apr 08, 2013 5:21 pm
by EViews Gareth
You'll have to state the question more formally/precisely, I think.
However, if you want to show the averages over a subset of observations, you can set the workfile sample prior to showing the stats by classification. Use Proc->Set Sample on the workfile window to do so. You could either use dates to set the subsample (say "2012/08/28 2013/02/12"), or if you want an exact number of observations, using an if condition such as "@trend<12000".
Re: average for 5 mins interval
Posted: Tue Apr 09, 2013 3:29 am
by james123
Hi, thank you for these replies. I think we both can not understand each other percisely. :)
But still appreciate you effects to try to help.
Many Thanks