If you're feeling really nice, email your answers to: nayrsllew[@]hotmail.com (Remove the brackets of course)
Hey Pete,
I was wondering if you might be able to answer a quick BASIC question for
me? I'm stumped. I used to use the language all the time, but it has been
many years and now I am confused.
I am trying to import data from a file, intepret it and eventually write
some data back.
The issue is it doesn't like decimals. The source file is like this....
datestamp,timestamp,val1,val2,val3,val4,volume
2004.06.17,00:00,1.2006,1.2006,1.2005,1.2005,4
2004.06.17,00:03,1.2005,1.2005,1.2004,1.2005,6
2004.06.17,00:05,1.2005,1.2005,1.2004,1.2004,2
And it is Val1,2,3,4 that I need to interogate. But I'm getting scientific
notation instead of numerical values to four digits. HELP!@#@ Do you have
any idea of I can fix this?
I am very grateful for any help you can offer.
Many thanks
Ryan
PS; My source code is below if it helps. Hope I haven't made too many coding
faux pas!
Code: Select all
CLS
SL = .005
TP = .001
SPREAD = .0002
openprice = 1.234445
buytp = openprice + SPREAD + TP
buysl = (openprice + SPREAD) - SL
selltp = openprice - TP
sellsl = openprice + SL
PRINT buytp, buysl, selltp, sellsl
recordno = 1
OPEN "c:\fdata1.dat" FOR RANDOM AS #1
FOR xx = 1 TO 20
GET #1, recordno, checkdatestamp
GET #1, recordno + 1, checktimestamp
FOR count = 2 TO 5
GET #1, recordno + count, checkprice
IF checkprice >= buytp THEN PRINT "BUYTP"
IF checkprice <= buysl THEN PRINT "buysl"
IF checkprice <= selltp THEN PRINT "selltp"
IF checkprice >= sellsl THEN PRINT "sellsl"
PRINT recordno, count, checkprice
NEXT count
recordno = recordno + 7
DO
LOOP WHILE INKEY$ = ""
NEXT xx