Jump to content
Tom Next - Daytrading Community

CSV-IMPORT


rapidfire

Recommended Posts

Hallo,

hab bei folgendem Script das Problem, dass nie die letzte Zeile aus dem csv-File ausgelesen wird, obwohl die csv-Datei sogar einen zusätzlichen Zeilenumbruch am Ende hat (der von MT4 beim export autom. erstellt wird) => siehe Datei-Anhang!

 

Hat jemand eine Idee, was ich am Script ändern muss, damit auch die letzte Zeile gelesen wird?

 

 

 

 

string File_Name=Symbol()+".csv";
  
  int Handle = FileOpen(File_Name, FILE_CSV|FILE_READ, ";");
      if(Handle<0)
         { Print(GetLastError()); }
           
      while(FileIsEnding(Handle)==false)
         { i=i+1;     
          
          string name = FileReadString(Handle);
          string price2 = FileReadString(Handle);


          if(FileIsEnding(Handle)==true)
            break; 


//--- ENDE VON FILEREAD...          
          
          double price = StrToDouble(obprice2);
        
           
      ObjectCreate(chart_ID,name,OBJ_HLINE,sub_window,0,price); 
     }
     
   FileClose(Handle);
   
   WindowRedraw();

 

 

post-3580-0-27874300-1438531174.png

Link to comment
Share on other sites

hab's inzwischen selbst gelöst:

 

 

string File_Name=Symbol()+".csv";
  
  int Handle = FileOpen(File_Name, FILE_CSV|FILE_READ, ";");
      if(Handle<0)
         { Print(GetLastError()); }
           
      while(FileIsEnding(Handle)==false)
         {      
          
          string name = FileReadString(Handle);
          string price2 = FileReadString(Handle);


//--- ENDE VON FILEREAD...          
          
          double price = StrToDouble(obprice2);
        
           
      ObjectCreate(chart_ID,name,OBJ_HLINE,sub_window,0,price); 
     }
     
   FileClose(Handle);
   
   WindowRedraw();
 

 

  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...