[R-sig-finance] Price change after breakout

James Sogi zubin.al.genubi at gmail.com
Sun Jan 23 00:08:25 CET 2005


R-Sig Finance List:

May I ask your help  (or where  to look, or who to consult)to find 
the appropriate functions or data set up to reference price on  prior
days, and subsequent days to answer  a question typical of the  query
below   on the data base sample SP mini CME shown below without having
to do separate columns for all combinations of changes over many days.
I was able to use subset or apply for intraday changes  using columns,
but wanted to be able to report changes upon certain conditions by
reference to prior days and subsequent days.  Many thanks.

Query:  What is the change to open tomorrow  after price today 
exceeds yesterday's high when yesterdays close < the day before
yesterdays close.

sample data  ES3.t column is 1= 9:30 2=11:00 3= 2:30 4=4:00
ES3.p is price open at specified time
ES3.jd is julian date.
c1-c4 are changes one bar to the next
oc is change from open to close

        ES3.d ES3.jd ES3.dw ES3.t   ES3.p      c ES3.c1 ES3.c2 ES3.c3
ES3.c4     oc
1  1998-06-11  10388    Thu     1 1321.25   5.00  -6.00  -7.00  -8.00 
 1.75 -21.00
2  1998-06-11  10388    Thu     2 1315.25  -6.00  -7.00  -8.00   1.75 
-3.25 -13.25
3  1998-06-11  10388    Thu     3 1308.25  -7.00  -8.00   1.75  -3.25 
-6.00  -9.50
4  1998-06-11  10388    Thu     4 1300.25  -8.00   1.75  -3.25  -6.00 
15.75  -7.50
5  1998-06-12  10389    Fri     1 1302.00   1.75  -3.25  -6.00  15.75
-14.50   6.50
6  1998-06-12  10389    Fri     2 1298.75  -3.25  -6.00  15.75 -14.50 
 6.75  -4.75
7  1998-06-12  10389    Fri     3 1292.75  -6.00  15.75 -14.50   6.75 
-4.75   8.00
8  1998-06-12  10389    Fri     4 1308.50  15.75 -14.50   6.75  -4.75
-15.25 -12.50
9  1998-06-15  10392    Mon     1 1294.00 -14.50   6.75  -4.75 -15.25 
 8.50 -13.25
10 1998-06-15  10392    Mon     2 1300.75   6.75  -4.75 -15.25   8.50 
 3.25 -11.50
11 1998-06-15  10392    Mon     3 1296.00  -4.75 -15.25   8.50   3.25 
-6.00  -3.50
12 1998-06-15  10392    Mon     4 1280.75 -15.25   8.50   3.25  -6.00 
 8.00   5.75
13 1998-06-16  10393    Tue     1 1289.25   8.50   3.25  -6.00   8.00 
 9.50   5.25
14 1998-06-16  10393    Tue     2 1292.50   3.25  -6.00   8.00   9.50 
10.25  11.50
15 1998-06-16  10393    Tue     3 1286.50  -6.00   8.00   9.50  10.25 
 6.75  27.75
16 1998-06-16  10393    Tue     4 1294.50   8.00   9.50  10.25   6.75 
-3.75  26.50
17 1998-06-17  10394    Wed     1 1304.00   9.50  10.25   6.75  -3.75 
-2.25  13.25
18 1998-06-17  10394    Wed     2 1314.25  10.25   6.75  -3.75  -2.25 
-0.75   0.75
19 1998-06-17  10394    Wed     3 1321.00   6.75  -3.75  -2.25  -0.75 
 1.25  -6.75


-- 
James Sogi
Kona, Hawaii
zubin.al.genubi at g.mail.com



More information about the R-sig-finance mailing list