![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
OrderType( ) and other associated order parameters.
The documentation states clearly that the Orderxx functions must be selected by and OrderSelect() call.
Note: order must be selected by OrderSelect() function.
I had erroneously assumed that and OrderSend() or OrderModify() would automatically Select the order and its associated parameters. This is NOT the case.
Valid information is contained in the parameters only if the order has been selected.
The real bug is that if you are running multiple charts, say EURUSD & GBPUSD, the information contained in EA controlling the EURUSD pair can contain Order parameter data from the other PAIR!
This is a horrendous bug as it indicates that Multiple Concurrent EAs are not totally separated in their own memory workspace and you cannot determine the OrderOpenPrice unless you process all open orders and select the appropriate order and immediately set internal variables to use. Even then you cannot guarantee that the information received may not be corrupted since the possibility exists that one or more of your other EAs may be performing the same operation at the same time. This is not as remote a chance as it may seem since several pairs are related by either their base or counter currency. It appears to me that there is only one set of Orderxx() values for each Terminal session and this set is used by all EAs.
Below is a file dump of an EA controlling GBPJPY with the OrderOpenPrice & OrderStopLoss just after the OrderOpen call that created 25505862. As you can see, the values,1556.87, are from an EA running XAUUSD. Interestingly, the Terminal Display of all orders shows #25505862 with values appropriate to GBPJPY.
OrderPlaced 7:00:05 -1 0 25505862 4 1556.87 1549.7 1549.7 0 D:X1
CalculateStopLoss 146.709 0 145.943 2 0.01 0.01 0.2 0
Hi Robert,
Just re-read this and found you missed my point.
Dim somearray[10];
Print(DoubleToString(somearray,2)); // prints as 0.00
The bug is the interpreter is not recognizing somearray as an array and flagging it as an illegal construct.DoubleToString allows array elements but not an entire array. You would need to use an index to the array like Print (DoubleToStr(somearray, 2));
Robert
Something I noticed with build 482 : when I have multiple demo accounts, sometimes, for some reason (I could not find when and why) metatrader deletes all but the active account. Not that it writes out that they are invalid or anything similar : those accounts disappear from the list of accounts for good
One more issue with build 482 : I can not download data in history center any more. It does not matter how much data I have(I have tried even deleting the 1 minute data) it always says : "There is no new data for symbol nnn" and does not download the data as it used before. Does anybody have that same issue?
One more issue with build 482 : I can not download data in history center any more. It does not matter how much data I have(I have tried even deleting the 1 minute data) it always says : "There is no new data for symbol nnn" and does not download the data as it used before. Does anybody have that same issue?
Tested it on my terminal (build 482 too) and it seems that I have that kind of a problem too. Strange
Tested it on my terminal (build 482 too) and it seems that I have that kind of a problem too. Strange
One more "present" from metaquotes
Waiting to see build 500 (since my broker still did not upgrade to build 500). It seems that there is some mix-up with data download now and that is rather unpleasant at the least for strategies back-testing
Bug considering arrays (it seems that it starts from build 482, but I am not sure)
When declaring a local array like this code :
int deinit() { return(0); }
int start()
{
double array[];
if (ArrayRange(array,0)!=50) ArrayResize(array,50);
return(0);
}On a new tick array is not reset, and the size on second tick is 50 not 0 as it should be. It is a clear error since the array is declared as local to the routine/function (it is not declared as static nor is it declared on a global level) and should be zero sized on each an every new tick. Same happens in indicators as well as in EAs. That might one of the possible reason why are there so much complaints that some code that worked before does not work starting from build 482. The only solution for now is to zero size (if necesary and in a lot of cases of dynamically using arrays it is a must) using ArrayResize(array,0).
So, if using arrays in your code, be careful since it seems that they are having a buggy builds (again, since they had similar problems with arrays a few years ago) that do not work with arrays as they should
My broker still keeps build 482. Now it already makes me wonder why (but seeing the stuff the build 500 does, I do not wonder so much, since among other things, they report that some perfectly legal code from mql code base can not be compiled any more - one nonsense following the other)
My broker still keeps build 482. Now it already makes me wonder why (but seeing the stuff the build 500 does, I do not wonder so much, since among other things, they report that some perfectly legal code from mql code base can not be compiled any more - one nonsense following the other)
Hi Techmac,
I had the same problem. Code that originally compiled on 500 ceased working several days later. My symptoms were that the edit parser went immediately to eoj and then the compiler said compile ok no errors almost instantaneously after deleting the ex4 file. I tracked it down to a few functions but did not examine the source closely to determine the problem. I suspect a non printing character is causing the problem. I then had the same problem in another EA I wrote.
My solution is converting to SciTE. It is far superior to MetaEditor in all ways. Quite similar in power and speed to Visual Studio and is adaptable to several languages and provides the ability for extensive personalization. You can get it at Forex Factory and install it once into a high level directory. It can properly handle code in multiple directories at the same time in a single edit session. No need for separate installations of MetaEditor. I like the function list in the navigator pane that allows direct jumping to the function in the code you are working on and also provides brace matching and I assume lots of other goodies I have not tried yet.
That's my two cents
Tzuman