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

RE: [amibroker] Re: Walt: Question on Sharing AB Database (File Splitter)



PureBytes Links

Trading Reference Links




I haven't traced the 
logic of the code but it looks to me that you might have a problem if 

<FONT face=Arial 
size=2>the do while 
Len(Ls_line)>0  fails the first time thru. If 
that happens then the lo_txt.Closewill give you 
that error since the lo_txt object was never declared <FONT 
color=#ff0000>Set lo_txt =....
<SPAN 
class=789041417-31052003> 
<SPAN 
class=789041417-31052003>d
<SPAN 
class=789041417-31052003> 
<FONT face=Arial color=#0000ff 
size=2>//*****************************************************EnableScript("vbscript");
 
<%
 
ab_excludeTick = Trueas_filename 
= "c:\out.csv"as_directory = "d:\stocks\"
 
Set io_fso = 
CreateObject("Scripting.FileSystemObject")Set lo_txtAll = 
io_fso.OpenTextFile(as_filename)
 
ls_lastTick = ""ls_line = 
lo_txtAll.ReadLine()ls_line = lo_txtAll.ReadLine()
 
do while 
Len(Ls_line)>0     ls_items = Split(ls_line, 
",")    if UBound(ls_items) = 6 
Then        if ls_items(0) <> 
ls_lastTick 
Then            if 
Len(ls_lastTick) > 0 
Then                
lo_txt.Close            
End if            
ls_curTick = 
Trim(ls_items(0))            
ls_curTick = Replace(ls_curTick, "^", 
"")            
ls_curTick = Replace(ls_curTick, "$", 
"")            
ls_curTick = Replace(ls_curTick, "\", 
"")            
ls_curTick = Replace(ls_curTick, "/", 
"")            
ls_curTick = Replace(ls_curTick, "?", 
"")            
Err.Clear            
'On Error Resume 
Next            <FONT 
color=#ff0000>Set lo_txt = io_fso.OpenTextFile(as_directory + ls_curTick + 
".csv", 2, 
-1)            
lb_fileOpen = (Err = 0)        End 
if        if lb_fileOpen 
Then            
ls_lastTick = 
ls_curTick            
if ab_excludeTick 
Then                
ls_line = Replace(ls_line, ls_curTick + ",", 
"")                
do while NOT IsNumeric(Left(ls_line, 
1))                    
ls_line = Right(ls_line, Len(ls_line) - 
1)                
Loop            End 
if            
lo_txt.writeline ls_line        End 
if    End if    
err.Clear    on error resume next    
ls_line = lo_txtAll.ReadLine()    if err=62 then exit 
doLoop
 
<FONT 
color=#ff0000>lo_txt.Closelo_txtAll.Close
 
%>
 
 

  
  <FONT 
  face=Tahoma size=2>-----Original Message-----From: walt 
  [mailto:WSCHWARZ@xxxxxxxxxxxxx] Sent: Saturday, May 31, 2003 1:00 
  PMTo: amibroker@xxxxxxxxxxxxxxxSubject: RE: [amibroker] 
  Re: Walt: Question on Sharing AB Database (File Splitter)
  Just 
  tried it again and it seems to work...
  <FONT face=Arial color=#0000ff 
  size=2> 
  Make 
  sure that the file spec and the directory exists.
   
  If 
  the directory is not there or if the directory spec is not correct, 
  pehaps missing a slash, the file cannot be opened...
   
  Also 
  if the ticker has an odd character that I did not replace, it will also 
  fail...
   
  <SPAN 
  class=171305616-31052003>                    <FONT 
  face=Arial color=#0000ff size=2>Walt 
  
    <FONT face=Tahoma 
    size=2>-----Original Message-----From: jnk1997 
    [mailto:jnk1997@xxxxxxxxx]Sent: Saturday, May 31, 2003 12:25 
    PMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] 
    Re: Walt: Question on Sharing AB Database (File 
    Splitter)Walt,When I click apply in 
    Indicator Builder I getSource: Microsoft VBScript runtime 
    errorLine:   99   Char:   
    1Error:  0  - Object required: 
    'lo_txt'Jim--- In amibroker@xxxxxxxxxxxxxxx, 
    walt <WSCHWARZ@xxxx> wrote:> Yes, and you can set 
    "ab_excludeTick" to true, if you do not need the ticker> in the 
    first column of every line or false to piut the ticker on every> 
    line...> >         
    Walt>   -----Original Message----->   
    From: jnk1997 [mailto:jnk1997@xxxx]>   Sent: Saturday, May 
    31, 2003 12:04 PM>   To: 
    amibroker@xxxxxxxxxxxxxxx>   Subject: [amibroker] Re: TJ or 
    Group: Question on Sharing AB Database> (File Splitter)> 
    > >   Ok, I exported data for 4 stocks (for 1 month) 
    into one file to try>   this out.> 
    >   Data exported to a new folder & file  
    C:\StockData\alldata.csv> >   If I understand 
    correctly I change the following in your formula:> 
    >   as_filename = "c:\out.csv" becomes  
    "c:\StockData\alldata.csv"> >   and> 
    >   as_directory = "d:\stocks\" becomes 
    "c:\StockData\"> >   Are these the required 
    changes?> >   Thanks for your 
    help!>   Jim> > > > > 
    > > > > > >   --- In 
    amibroker@xxxxxxxxxxxxxxx, walt <WSCHWARZ@xxxx> 
    wrote:>   > jim,>   
    >>   > after you export the file run this script from 
    the indicator>   builder and it>   > 
    will split the exported file into separate files for 
    you...>   > Note: Change the "filename" & directory 
    to suit...>   >>   
    >                     
    Walt>   >>   > 
    //*****************************************************>   
    > EnableScript("vbscript");>   >>   
    > <%>   >>   > ab_excludeTick 
    = True>   >>   > as_filename = 
    "c:\out.csv">   >>   > as_directory 
    = "d:\stocks\">   >>   > Set io_fso 
    = CreateObject("Scripting.FileSystemObject")>   
    >>   > Set lo_txtAll = 
    io_fso.OpenTextFile(as_filename)>   
    >>   > ls_lastTick = "">   
    >>   > ls_line = 
    lo_txtAll.ReadLine()>   >>   > 
    ls_line = lo_txtAll.ReadLine()>   >>   
    > do while Len(Ls_line)>0>   >>   
    > ls_items = Split(ls_line, ",")>   
    >>   > if UBound(ls_items) = 6 
    Then>   >>   > if ls_items(0) 
    <> ls_lastTick Then>   >>   > 
    if Len(ls_lastTick) > 0 Then>   >>   
    > lo_txt.Close>   >>   > End 
    if>   >>   > ls_curTick = 
    Trim(ls_items(0))>   >>   > 
    ls_curTick = Replace(ls_curTick, "^", "")>   
    >>   > ls_curTick = Replace(ls_curTick, "$", 
    "")>   >>   > ls_curTick = 
    Replace(ls_curTick, "\", "")>   >>   
    > ls_curTick = Replace(ls_curTick, "/", "")>   
    >>   > ls_curTick = Replace(ls_curTick, "?", 
    "")>   >>   > 
    Err.Clear>   >>   > 'On Error Resume 
    Next>   >>   > Set lo_txt = 
    io_fso.OpenTextFile(as_directory + ls_curTick>   + ".csv", 
    2, -1)>   >>   > lb_fileOpen = (Err 
    = 0)>   >>   > End 
    if>   >>   > if lb_fileOpen 
    Then>   >>   > ls_lastTick = 
    ls_curTick>   >>   > if 
    ab_excludeTick Then>   >>   > 
    ls_line = Replace(ls_line, ls_curTick + ",", "")>   
    >>   > do while NOT IsNumeric(Left(ls_line, 
    1))>   >>   > ls_line = 
    Right(ls_line, Len(ls_line) - 1)>   
    >>   > Loop>   
    >>   > End if>   
    >>   > lo_txt.writeline ls_line>   
    >>   > End if>   
    >>   > End if>   
    >>   > err.Clear>   
    >>   > on error resume next>   
    >>   > ls_line = 
    lo_txtAll.ReadLine()>   >>   > if 
    err=62 then exit do>   >>   > 
    Loop>   >>   > 
    lo_txt.Close>   >>   > 
    lo_txtAll.Close>   >>   > 
    %>>   >>   >   
    -----Original Message----->   >   From: 
    jnk1997 [mailto:jnk1997@xxxx]>   >   Sent: 
    Saturday, May 31, 2003 9:41 AM>   >   To: 
    amibroker@xxxxxxxxxxxxxxx>   >   Subject: 
    [amibroker] Re: TJ or Group: Question on Sharing AB>   
    Database ->   > Bob>   
    >>   >>   >   I still 
    don't get it.>   >>   >   
    Can I run that exploration on all stocks in Amibroker 
    database>   for a>   >   
    period of 2 years for example, export to one .csv file 
    named>   >   ALLStocks. Then, Import that file 
    as my database in the other>   >   
    program?>   >   Or do I have to save the data 
    stock by stock (seperate file for>   
    each>   >   stock?)and have all those 
    individual data files in a folder named>   
    >   ALLStocks?>   >>   
    >>   >   Thanks>   
    >   Jim>   >>   
    >>   >>   >>   
    >>   >>   >   --- In 
    amibroker@xxxxxxxxxxxxxxx, "Bob Jagow" <bjagow@xxxx> 
    wrote:>   >   > That's the old 
    form--like using GraphN instead of plot().>   
    >   > Easier to use>   >   
    > Filter = 1; /* all stocks and quotes accepted */>   
    >   > addcolumn(O,"open",1.4);>   
    >   > addcolumn(H,"high",1.4);>   
    >   > addcolumn(L,"low",1.4);>   
    >   > addcolumn(C,"close",1.4);>   
    >   > addcolumn(V,"volume",1.0);>   
    >   >>   >   > 
    Bob>   >   >>   
    >   >>   >   
    >>   >   >   -----Original 
    Message----->   >   >   From: 
    walt [mailto:WSCHWARZ@xxxx]>   >   
    >   Sent: Friday, May 30, 2003 5:29 PM>   
    >   >   To: 
    amibroker@xxxxxxxxxxxxxxx>   >   
    >   Subject: RE: [amibroker] Re: TJ or Group: Question on 
    Sharing>   AB>   >   
    Database>   >   >>   
    >   >>   >   >   
    Jim,>   >   >>   
    >   >   I found this code in the helpf ile; Run it 
    in the AA "explore">   >   and then use 
    the "export" button. Then "import" it into your>   
    >   > program...>   >   
    >>   >   
    >                           
    Walt>   >   >>   
    >   >>   >   
    >>   >   >   Filter = 1; /* 
    all stocks and quotes accepted */>   >   
    >>   >   >   NumColumns = 
    5;>   >   >>   
    >   >   Column0 = Open;>   
    >   >>   >   >   
    Column1 = High;>   >   
    >>   >   >   Column2 = 
    Low;>   >   >>   
    >   >   Column3 = Close;>   
    >   >>   >   >   
    Column4 = Volume;>   >   
    >>   >   >   Column0Name = 
    "open";>   >   >>   
    >   >   Column1Name = "high";>   
    >   >>   >   >   
    Column2Name = "low";>   >   
    >>   >   >   Column3Name = 
    "close";>   >   >>   
    >   >   Column4Name = 
    "volume";>   >   >>   
    >   >   Column0Format = 1.4;>   
    >   >>   >   >   
    Column1Format = 1.4;>   >   
    >>   >   >   Column2Format = 
    1.4;>   >   >>   
    >   >   Column3Format = 1.4;>   
    >   >>   >   >   
    Column4Format = 1.0;>   >   
    >>   >   >     
    -----Original Message----->   >   
    >     From: jnk1997 
    [mailto:jnk1997@xxxx]>   >   
    >     Sent: Friday, May 30, 2003 6:50 
    PM>   >   >     To: 
    amibroker@xxxxxxxxxxxxxxx>   >   
    >     Subject: [amibroker] Re: TJ or Group: Question 
    on Sharing AB>   >   
    Database>   >   >>   
    >   >>   >   
    >     Sorry, Right!>   
    >   >     I use AmiQuote to retreive eod 
    data from Yahoo.>   >   
    >     Thanks>   >   
    >     Jim>   >   
    >>   >   >>   
    >   >>   >   
    >     --- In amibroker@xxxxxxxxxxxxxxx, "Chuck 
    Rademacher">   >   
    >     <chuck_rademacher@x> 
    wrote:>   >   >     
    > Jim, you told us what kind of data Forecaster Plus 
    can>   read>   >   and 
    we>   >   >     know 
    what>   >   >     > 
    kind of data AB can read.   What we don't know (in 
    order>   to>   >   
    help>   >   >     you) 
    is>   >   >     > 
    what kind of data you already are using.>   
    >   >     >>   
    >   >     > With that long list of 
    data types that Forecast Plus is>   
    able>   >   to>   
    >   >     use, I'm>   
    >   >     > reasonbly sure you will 
    be able to share data between the>   
    two>   >   >     
    software>   >   >     
    > packages.>   >   
    >     >   -----Original 
    Message----->   >   
    >     >   From: jnk1997 
    [mailto:jnk1997@xxxx]>   >   
    >     >   Sent: Friday, May 30, 2003 
    6:17 PM>   >   >     
    >   To: amibroker@xxxxxxxxxxxxxxx>   
    >   >     >   Subject: 
    [amibroker] TJ or Group: Question on Sharing AB>   
    >   Database>   >   
    >     >>   >   
    >     >>   >   
    >     >   I received an interesting 
    software CD with my renewal to>   >   
    TASC.>   >   >     
    >   It is called Pattern Forecaster Plus by 
    Matheny>   www.ment.com>   
    >   >     >   The software 
    does not include a downloader but will>   read 
    the>   >   >     
    >   following file types:>   >   
    >     >>   >   
    >     >   How can I set up AB to share 
    my database?>   >   
    >     >>   >   
    >     >   Pattern Forecaster Reads the 
    following data files>   formats:>   
    >   >     >>   
    >   >     >   PFP/StockVue 
    File Types>   >   >     
    >   Technical Tools File Types>   
    >   >     >   FutureSource 
    File Types>   >   >     
    >   FutureLink/SuperCharts File Types>   
    >   >     >   
    MetaStock/Computrak File Types>   >   
    >     >   Megatech/Knight Ridder File 
    Types>   >   >     
    >   Telescan ASCII file Types>   
    >   >     >   DBC Signal 
    File Types>   >   >     
    >   Worden Brothers TC2000 File Types>   
    >   >     >   AIQ ASCI File 
    Types>   >   >     
    >   Apex (CandlePower) File Types>   
    >   >     >   Aspen 
    Graphics ASCII File Types>   >   
    >     >   TradeStation ASCII File 
    Types>   >   >     
    >   Live Wire ASCII File Types>   
    >   >     >   Dial Data 
    ASCII File Types>   >   
    >     >>   >   
    >     >   Thanks>   
    >   >     >   
    Jim>   >   >     
    >>   >   >     
    >>   >   >     
    >         Yahoo! Groups 
    Sponsor>   >   >     
    >>   >   >     
    >>   >   >     
    >>   >   >     
    >>   >   >     
    >>   >   >     
    >   Send BUG REPORTS to bugs@xxxx>   
    >   >     >   Send 
    SUGGESTIONS to suggest@xxxx>   >   
    >     >   
    ----------------------------------------->   
    >   >     >   Post 
    AmiQuote-related messages ONLY to:>   >   
    amiquote@xxxxxxxxxxxxxxx>   >   
    >     >   (Web page:>   
    <A 
    href="">http://groups.yahoo.com/group/amiquote/messages/)>   
    >   >     >   
    -------------------------------------------->   
    >   >     >   Check group 
    FAQ at:>   >   >     
    >>   <A 
    href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html>   
    >   >     >>   
    >   >     >   Your use of 
    Yahoo! Groups is subject to the Yahoo!>   Terms 
    of>   >   >     
    Service.>   >   >>   
    >   >>   >   
    >>   >   >     Send 
    BUG REPORTS to bugs@xxxx>   >   
    >     Send SUGGESTIONS to 
    suggest@xxxx>   >   
    >     
    ----------------------------------------->   
    >   >     Post AmiQuote-related messages 
    ONLY to:>   amiquote@xxxxxxxxxxxxxxx>   
    >   >     (Web page: <A 
    href="">http://groups.yahoo.com/group/amiquote/messages/)>   
    >   >     
    -------------------------------------------->   
    >   >     Check group FAQ 
    at:>   >   <A 
    href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html>   
    >   >>   >   
    >     Your use of Yahoo! Groups is subject to the 
    Yahoo! Terms of>   >   
    Service.>   >   >>   
    >   >>   >   
    >         Yahoo! Groups 
    Sponsor>   >   >>   
    >   >>   >   
    >>   >   >   Send BUG REPORTS 
    to bugs@xxxx>   >   >   Send 
    SUGGESTIONS to suggest@xxxx>   >   
    >   
    ----------------------------------------->   
    >   >   Post AmiQuote-related messages ONLY 
    to:>   amiquote@xxxxxxxxxxxxxxx>   
    >   >   (Web page: <A 
    href="">http://groups.yahoo.com/group/amiquote/messages/)>   
    >   >   
    -------------------------------------------->   
    >   >   Check group FAQ at:>   
    >   <A 
    href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html>   
    >   >>   >   >   
    Your use of Yahoo! Groups is subject to the Yahoo! Terms 
    of>   >   Service.>   
    >>   >>   
    >         Yahoo! Groups 
    Sponsor>   >>   
    >>   >>   >   Send BUG 
    REPORTS to bugs@xxxx>   >   Send SUGGESTIONS 
    to suggest@xxxx>   >   
    ----------------------------------------->   
    >   Post AmiQuote-related messages ONLY to: 
    amiquote@xxxxxxxxxxxxxxx>   >   (Web page: 
    <A 
    href="">http://groups.yahoo.com/group/amiquote/messages/)>   
    >   
    -------------------------------------------->   
    >   Check group FAQ at:>   > <A 
    href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html>   
    >>   >   Your use of Yahoo! Groups is 
    subject to the Yahoo! Terms of>   Service.> > 
    >         Yahoo! Groups 
    Sponsor> > > > > >   
    Send BUG REPORTS to bugs@xxxx>   Send SUGGESTIONS to 
    suggest@xxxx>   
    ----------------------------------------->   Post 
    AmiQuote-related messages ONLY to: 
    amiquote@xxxxxxxxxxxxxxx>   (Web page: <A 
    href="">http://groups.yahoo.com/group/amiquote/messages/)>   
    -------------------------------------------->   Check group 
    FAQ at:> <A 
    href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html> 
    >   Your use of Yahoo! Groups is subject to the Yahoo! 
    Terms of Service.Send BUG REPORTS to 
    bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
    suggest@xxxxxxxxxxxxx-----------------------------------------Post 
    AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: 
    <A 
    href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
    group FAQ at: <A 
    href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
    Your use of Yahoo! Groups is subject to the <A 
    href="">Yahoo! Terms of Service. 
    Send 
  BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx-----------------------------------------Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  Your use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 







Yahoo! Groups Sponsor












Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.