balazs321 / Publications
Forum
Performance test: MQL4 vs. MQL5
I was curious about the speed of mql4 compared to mql5, so I did a little test. I implemented a simple prime searching algorithm and ran in MT4 and MT5. Code in MQL4: int filehandle, i, d; double x; int start() { Print ( TimeLocal ()); filehandle= FileOpen ( "primes.txt" , FILE_WRITE ); for (i
Regular Expressions using PCRE
Does anyone have experience using PCRE for Windows and MetaTrader 4? The dll has the functions: pcre *pcre_compile(const char *pattern, int options, const char **errptr, int *erroffset, const unsigned char *tableptr); pcre *pcre_compile2(const char *pattern, int options, int *errorcodeptr, const
Getting the identifier of a passed array
I'm just wondering that is it possible to get an array's name (identifier) that was passed to a function ? For example: int ThisIsMyArray[ 10 ]; string MyFunction( int &array[]) { return (???); } void OnInit () { Print (MyFunction(ThisIsMyArray)); //This should output "ThisIsMyArray" } Any
Multiline label or text (ObjectSetString)
I would like to display data on the chart in several lines. How could I do it without defining a new object for every line? I tried the following: ObjectSetString ( 0 , "InfoTable" , OBJPROP_TEXT , "First line\r\nSecond line\r\nThird line" ); ...but it displays the string in one line. I've tried
Trying to place a market order, but it fails because of [Invalid stops]. What should I do?
I prepared the following simple code: int OnInit () { MqlTradeRequest request; request.action = TRADE_ACTION_DEAL ; request.symbol = Symbol (); request.volume = 0.01 ; request.type = ORDER_TYPE_BUY ; request.type_filling = ORDER_FILLING_AON ; MqlTradeResult result; OrderSend
Could you explain this? Am I doing something wrong or is it a bug?
Try the following EA in MetaTrader5: int arrayA[]; double arrayB[]; int OnInit () { ArrayResize (arrayB, 10 ); ArrayResize (arrayA, 10 ); Print ( "- Listing elements of ArrayA --" ); ArrayListElementsInteger(arrayA); Print ( "- Listing elements of ArrayB --" );