[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

2 questions --> Mark Brown...



PureBytes Links

Trading Reference Links

I get the data into SWP as follows: 
Collect from CSI and have it store the ascii data in c:\UA_Text\*.* Use
a simple program to read the data, subtracts 28 years from each date and
then write the new ascii data to c:\SWP_Text\*.*  The programming is
real, real simple. In fact Excel would probably do it. For example in
basic:

{CSI text record for July Cotton today using a DOP file of DHLC =
20020611, 39.05, 38.40, 38.95}

{So read the record in}
read oldDate,High,Low,Close

{calc SWP date,}
{for example, using oldDate="20020611"}

NewYrString=SUBSTR(oldDate,1,4)      {peels off "2002")
NewYr=NUMVAL(NewYrString) - 28      {converts "2002" to 2002 then
subtracts 28 = 1974)
NewYrString=STRVAL(NewYr)             {converts 1974 to "1974"}
NewMoString=SUBSTR(oldDate,5,2)     {peels off "06"}
NewDaString=SUBSTR(oldDate,7.2)     {peels off "11"}
newDate=NewYrString+NewMoString+NewDaString     {result is "19740611"}

{write the record out as} 
newDate, High, Low, Close

I add more indicators and so forth in the calculations but it's that
simple. And the dates check out. For example, today is Tue. In windows
outlook look up the day of week for 6/11/74. Works every time. It has
something to do with having a leap year every 4 years and 7 days in a
week and 4 times 7.