Hallo,
ich habe in einer Datei nur einen einzigen Wert stehen und den möchte ich auslesen und als Comment anzeigen... Geht aber nicht ....
Habt Ihr ne Idee wo der Fehler liegt? DANKE
Code:
#property strict
double WERT01[];
int ind=0;
int size=0;
datetime time_buff[];
void OnTick()
{
if(Seconds()==0||Seconds()==10||Seconds()==20||Seconds()==30||Seconds()==40||Seconds()==50)AusDatei();
Comment(WERT01[0]);
}
//+------------------------------------------------------------------+
void AusDatei()
{
string symbol=Symbol();
string TextDatei;
TextDatei=StringConcatenate("MaxiMini","-",symbol,".","txt");
//###################################################################################################################################
if(Seconds()==5)
{
int handle;
handle = FileOpen(TextDatei,FILE_READ|FILE_WRITE|FILE_TXT,"/t"); // Datei wird unter \MQL4\Files abgelegt
FileSeek(handle, 0, SEEK_END);
// if(FileSize(handle)>0)WERT01=FileReadDouble(handle,DOUBLE_VALUE);
for(int i=0;i<size;i++)
{
time_buff[i]=(datetime)FileReadDouble(handle,DOUBLE_VALUE);
WERT01[i]=FileReadDouble(handle,DOUBLE_VALUE);
}
FileClose(handle);
if(handle<1)
{
Print("File my_data.dat not found, the last error is ", GetLastError());
}
}
}