I assume you did try something like that
file_write("c:\\test.log", "123", 0);
it works as soon as you take that simple string out the following section.
Also deleting works fine.
if(NumOpenLong+NumOpenShort == 0)
{
if(HH(TimePeriod) - priceClose() < Threshold)
{
printf(strf("\nDone Sell!--",m));
Sleep(3000);
if (file_length(name1)>0)
{
file_delete (name1);
}
file_write (name1, content, 0);
}
else if (priceClose() - LL(TimePeriod) < Threshold)
{
printf(strf("\nDone Buy!--",m));
Sleep(3000);
if (file_length(name1)>0)
{
file_delete (name1);
}
file_write (name1, content, 0);
}
When you realize things work once you take away all the variations, I guess maybe one issue is
name1 = "c:\\zorro\\strategy\\test1.txt";
from the manual:
file_write (string name, string content, int length)
Stores the content of a string, series, or other data array in a file.
Last edited by danatrader; 05/31/20 07:39.