Tradestation and SQL problem

Discussion in 'Trading Software' started by 99atlantic, Jan 3, 2006.

  1. I have my database in MySQL, and when I'm ready to use it in tradestation, i export it out as an ASCII file so TS can read it.

    I use the following command:

    select date, open, high, low, close, volume into outfile
    'c:/pf/data/cef.database/nox' fields terminated by ',' lines
    terminated by '\n' from nox order by id desc;

    Visually, the ASCIi file (nox) appears fine. It opens fine in Excel. HOWEVER, Tradestation (2000i) REFUSES to open it - it sees the \n terminator as a high ascii character and reads it as garbage, such that the result is when I try to open the file in TS: date, open, high , low, close, (high ascii garbage character), date, open, high, etc....

    So instead of seeing it as a new line and working, it sees it as a garbage character and that it's all just 1 string and refuses to open it.

    FOr anybody familiar w/ using SQL and TS, can you think of any other ways to expor tmy tables to ASCII text file that can be read by TS?
     
  2. You can't save it as an excel workbook or *.csv and then use ts2000i to open it?
     
  3. Maybe the exported data file lines are terminated with '\n' (Unix style) rather than \r\n (DOS/Widows style) and TS chokes on them. Find a unix to DOS text file converter and try that. Also check if mysql has an option to export DOS format.
     
  4. Can' t you do an" search and replace all" ?
    Search for the wrong sign and replace it with a space.
    By "replace all" he replaces them all in one move.

    Can't you put a few line of the file here? I have a few hundred extra functions in my Excel, maybe i can find out an easy way to solve the problem.
    And i have TS2000 to try it out.
     
  5. lakka

    lakka