
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Alpari for all pairs
If I'm not mistaken, Alpari has a minimum lot size of 0.10.
But for validity and verification, as mentioned above, it is better to use
Errors when reading long lines from text files
{
string fn= "test_str.txt",sRead,sWrite="";
int cnStr=100,cnSymb=6000,i,fh;
fh=FileOpen(fn,FILE_WRITE|FILE_TXT|FILE_ANSI);
if(fh==INVALID_HANDLE) return;
for(i=0; i<cnSymb; i++)
{
sWrite+=(string)(i%10);
}
int wrLen;
for(i=0; i<cnStr; i++)
{
wrLen=FileWriteString(fh,sWrite+"\r\n")-2;
}
FileClose(fh);
fh=FileOpen(fn,FILE_READ|FILE_TXT|FILE_ANSI);
if(fh==INVALID_HANDLE) return;
int readLen,minCn,j,error1Cn=0,error2Cn=0;
for(i=0; i<cnStr; i++)
{
sRead=FileReadString(fh);
readLen=StringLen(sRead);
if(readLen!=wrLen)
{
if(error1Cn<3) Print("ERROR1 str: ",i," readLen: ",readLen,", wrLen: ",wrLen);
error1Cn++;
}
int minCn=MathMin(readLen,wrLen);
ushort chR,chW;
for(j=0; j<minCn; j++)
{
chR = StringGetCharacter(sRead, j);
chW = StringGetCharacter(sWrite, j);
if(chR!=chW) break;
}
if(j!=minCn)
{
if(error2Cn<3) Print("ERROR2 str: ",i," symbol: ",j," chR: ",chR," chW: ",chW," readLen: ",readLen,", wrLen: ",wrLen);
error2Cn++;
}
}
FileClose(fh);
Print("Str count: ",cnStr," str size: ",cnSymb," error1Cn: ",error1Cn," error2Cn: ",error2Cn);
}
//---
void OnStart(){testStr();}
I'm getting
ERROR1 str: 99 readLen: 0, wrLen: 6000
ERROR1 str: 98 readLen: 0, wrLen: 6000
ERROR2 str: 0 symbol: 5373 chR: 53 chW: 51 readLen: 5998, wrLen: 6000
ERROR1 str: 0 readLen: 5998, wrLen: 6000
Please fix it as soon as possible.
Can you tell me how to make the data window display its buffer names ?
See example under Programme Properties
Can you tell me how to make the data window display its buffer names ?
#property indicator_plots 1
#property indicator_buffers 5
...
PlotIndexSetString(0,PLOT_LABEL,"Open;High;Low;Close");
...
Errors when reading long lines from text files
Please fix as soon as possible.
Thanks for the message, corrected.
The standard CChart class is glitchy.
Run the script and voila, the chart is blown away by the wind :o)
The chart is deleted without any error messages.
The standard CChart class is glitchy.
Run the script and voila, the chart is blown away by the wind :o)
The chart is deleted without any error messages.
When the script finishes, all objects are destroyed automatically, including an instance of CChart class. But the destructors of created objects are called during the destruction process. In our case, the destructor looks like this for the CChart class
i.e. the chart on which the script is running is closed.
PS Read the article The Order of Object Creation and Destruction in MQL5.