I need your help, please!  I also hope to learn more about using J in
other contexts from your responses.

I'm writing some software to manipulate my extensive stock market data
in different ways, and I need *explicit* code (NOT tacit code) for
several functions, which I'm splitting between multiple messages to
keep related responses together.  My first 3 function requests deal
with getting data into particular formats for subsequent processing by
my programs.  The 4th request deals with retrieving related data from
a huge file.

My first request actually requires 2 functions: a function and its
inverse.  The two data sets below show two approaches to represent
market data--trading days and calendar days--and I need functions to
convert the data both ways.  (For me, the tricky part is how to insert
dates [and data]--that is, seeking missing dates and processing
accordingly when converting A1 to A2.)
__________________________________________________

Function #1a needs to convert data set A1 to data set A2 (that is,
from trading days to calendar days):

DATA SET A1:

1952-05-22,261.78,264.02,261.54,263.33,1360000
1952-05-23,263.33,264.59,262.54,263.27,1150000
1952-05-24,263.27,263.47,262.84,263.23,300000
1952-05-26,263.23,264.87,262.62,264.22,940000
1952-05-27,264.22,265.17,262.82,263.92,1040000
1952-05-28,263.92,264.54,262.25,262.78,1130000
1952-05-29,262.78,263.51,261.62,262.94,1100000
1952-06-02,262.94,264.61,261.48,262.31,1190000
1952-06-03,262.31,262.82,260.83,262.09,940000
1952-06-04,262.09,264.20,261.91,263.67,1200000
1952-06-05,263.77,266.80,263.77,266.29,1410000
1952-06-06,266.29,268.95,266.21,268.03,1520000
1952-06-09,268.03,269.92,267.67,269.15,1270000
1952-06-10,269.15,269.15,266.76,267.67,1220000
1952-06-11,267.67,268.52,266.33,267.93,1190000

DATA SET A2:

1952-05-22,261.78,264.02,261.54,263.33,1360000
1952-05-23,263.33,264.59,262.54,263.27,1150000
1952-05-24,263.27,263.47,262.84,263.23,300000
1952-05-25,0,0,0,0,0
1952-05-26,263.23,264.87,262.62,264.22,940000
1952-05-27,264.22,265.17,262.82,263.92,1040000
1952-05-28,263.92,264.54,262.25,262.78,1130000
1952-05-29,262.78,263.51,261.62,262.94,1100000
1952-05-30,0,0,0,0,0
1952-05-31,0 0 0 0 0
1952-06-01,0,0,0,0,0
1952-06-02,262.94,264.61,261.48,262.31,1190000
1952-06-03,262.31,262.82,260.83,262.09,940000
1952-06-04,262.09,264.20,261.91,263.67,1200000
1952-06-05,263.77,266.80,263.77,266.29,1410000
1952-06-06,266.29,268.95,266.21,268.03,1520000
1952-06-07,0,0,0,0,0
1952-06-08,0,0,0,0,0
1952-06-09,268.03,269.92,267.67,269.15,1270000
1952-06-10,269.15,269.15,266.76,267.67,1220000
1952-06-11,267.67,268.52,266.33,267.93,1190000
__________________________________________________

Function #1b needs to convert data set A2 to data set A1 (that is,
from calendar days to trading days).  I presume this would be easier
than Function #1a.
__________________________________________________

Thanks in advance for any and all help you can give me!

Harvey
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to