Hi, I studying about w/r files in AFL. I didn't find this especific information in the forum so this is why I am here.
Two questions:
How to prevent it to loop every single tick I get from the real time database? I know exrem, but I don't have any buy or sell in the following example:
Code:
// create folder for exporting purposes
fmkdir( "C:\\DataExport\\" );
// open file for writing
fh = fopen( "c:\\DataExport\\append_test.txt", "a", True );
// proceed if file handle is correct
if ( fh )
{
for (i=0; i <= 100; i++)
{
// write line
fputs( StrFormat("Formula1_%g\n", i), fh );
}
// close file handle
fclose( fh );
}
"c:\DataExport\append_test.txt" is increasing in every tick (price change).
Next question.
How Amibroker deals with locks? If a file is busy, what happens? Does it wait? Will I lose information?
To illustrate this problem, I created Formula 1 and Formula 2. They have the same code above. As result I guess it should write in the append_test.txt once Formula 1, once Formula 2. But it doen'st. Sometimes it repeat Formula1, sometimes Formula 2.
Thank you Tomasz. It worked fine. But I have one more issue for you. Please.
Is the same question of the unanswered topic below:
How to make all charts active even in normal mode window? The formulas in multiple tickers only are processed in floating windows. I understand the concern about memory allocation. But is there anyway to able formulas in different tabs?