...und den Spread eines Anbieters dokumentiere ich mit
Code:
void OnTick()
{
double SPREAD=Bid-Ask;
string symbol=Symbol();
string TextDatei;
TextDatei=StringConcatenate("SPREAD","-",symbol,".","txt");
if(TimeCurrent() == Time[0])
{
//Write log file
int handle;
handle = FileOpen(TextDatei,FILE_READ|FILE_WRITE|FILE_TXT,"/t"); // Datei wird unter \MQL4\Files abgelegt
FileSeek(handle, 0, SEEK_END);
FileWrite(handle,TimeCurrent(),symbol,"; Stunde: ;",Hour(),"; Minute: ;",Minute(),"; SPREAD: ;",SPREAD); /*nach “handle,” kommt das was in die Datei geschrieben wir mit Komma getrennt */
FileClose(handle);
if(handle<1)
{
Print("File my_data.dat not found, the last error is ", GetLastError());
}
//Print(str);
}
}