Errors, bugs, questions - page 2590

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
Can you tell me what could be the reason for [Too many trade requests] error on the second call of the OrderSend routine (after starting the terminal) ?
Looked through logs from Monday to Thursday. I have seen the same thing in every log: First limit order is sent successfully and all next orders will have error [Too many trade requests]. Then they start to pass. The only criminal action is frequent call of CopyTickRange in OnInit().
BCS Broker MetaTrader 5 Terminal x64 build 2170 started
@Ilyas
From dll, pointer to string const wchar_t* copies an even string, with these parameters
wcsncpy( out, data, wcslen(data) * 2 );
With these parameters, of course, it leaks.
But the string turns out even, not a single extra character slips through.
And after terminating the program, the Expert Advisor log displays a message
And there is such a test.
It shows the following
The char character ' ' returns two bytes instead of one. Probably because it's in Unicode.
And the string returns twelve bytes each instead of two bytes when compared to wchar_t.
As a possible way, maybe upper-type alignment distorts the string's size somewhere?
@Ilyas
From dll, pointer to string const wchar_t* copies an even string, with these parameters
With these parameters, of course, it leaks.
But the string turns out even, not a single extra character slips through.
And after terminating the program, the Expert Advisor log displays a message
And there is such a test.
It shows the following
The char character ' ' returns two bytes instead of one. Probably because it's in Unicode.
And the string returns twelve bytes each instead of two bytes when compared to wchar_t.
As a possible way, maybe upper-type alignment distorts the string's size somewhere?
@Ilyas
From the dll, the const wchar_t* string pointer copies a plain string, with these parameters
With these parameters, of course, it leaks.
But the string turns out to be an even one, with no extra character missing.
And after terminating the program, the Expert Advisor log displays a message
And such a test
It shows the following
The char character ' ' returns two bytes instead of one. Probably because it's in Unicode.
And the string returns twelve bytes each instead of two bytes when compared to wchar_t.
As a possible way, maybe upper-type alignment distorts the string's size somewhere?
1. in MQL only Unicode, that's why the character size is 2 bytes
2. string is a structure (4 bytes buffer size and 8 bytes pointer size)
The copy to string should be
If this does not work, the error must be found elsewhere
Hello all! It seems that ResourceReadImage() function doesn't work correctly when getting data from BMP files! I made a script to draw a picture as a background on canvas. If we take out a picture from file located on a hard drive and just fill it on canvas, everything works fine, but if we take out pixels from BMP resource which is located in ex5 file itself using ResourceReadImage() function, the resulting image will look like a tiny and greatly enlarged slice of source picture. What is the reason?
The copy point cycle is wrong, replace it with
And this question - how to get a list of input variables, the same as comes inFrameInputs() function, but only in one pass, without optimization ?
Yes, quite recently such a question had come up, I've somehow lost sight of it, and now I've got such a task myself (I want to make set-files automatically).
In what direction to dig ? And if anyone remembers that discussion - where is it (I can't find it) ?
Of course, in each Expert Advisor I could write a function, which would create such a list, but it would be better to have a universal library function.You could, of course, write a single function in each EA that would create such a list, but a universal library function would be better.
Take a look here.
Have a look here.
That's right, that's it !
Thank you very much.
1. in MQL only Unicode, that's why the character size is 2 bytes
2. string is a structure (4 bytes buffer size and 8 bytes pointer size)
The copy to string should be
If this doesn't work, the error must be looked for elsewhere
And what happens if the size of the string to be copied is larger or smaller than the size of the allocated buffer?