Handy MQL4 utility functions - Page 3
Page 3 of 615 FirstFirst 12345 LastLast
Results 21 to 30 of 41

Thread: Handy MQL4 utility functions

  1. #21
    Hanover, most, if not all your function library should work in build 600.

    I think there's a bug in the string handling in buld 600 .

    The attached test script demones the corruption you get when using your string functions.

    There is a bit of chatter on the mql4 forum about corrupt sequences but so far no-one has managed to convince them it's an issue.

    https://www.nigeriaforextrading.com/...1396146197.mq4

  2. #22
    Quote Originally Posted by ;
    Hanover, most, if not all your function library must work in build 600. I believe there's a bug in the string handling in buld 600 . The attached test script demones the corruption you get when utilizing your string functions. There is a bit of chatter on the mql4 forum about corrupt strings but far no-one has been able to convince them it is an issue. picture document
    Many thanks to the info. However, I've no immediate plans to upgrade these purposes to MQL4 build 600 compatibility. For starters, the majority of the array handling functions utilize'pass by reference', which I know is not supported by the build 600 compiler.

    Any code I write, at least in the meantime, will be strictly utilizing the build 509 compiler. However, if anybody wants to take these functions and upgrade them to build 600 compatibility, then they're welcome to do so (provided it is not for commercial profit ).

  3. #23
    Wonderful share. You are so kind man

  4. #24
    Quote Originally Posted by ;
    Hanover, most, if not all your function library should work in construct 600. I think there's a bug in the string handling in buld 600 . The attached test script demones the corruption you get when using your series functions. There is a little chatter on the mql4 forum about corrupt strings but far no-one has been able to convince them it is a problem. image document
    It requires someone to make a small test case.

    Ps we now have standard functions StringTrimLeft, StringTrimRight, StringToUpper, StringToLower so substitute these

  5. #25
    Quote Originally Posted by ;
    quote . For starters, most of the array handling functions use'pass by reference', which I understand is not supported by the construct 600 compiler.
    As long as you aren't altering the array from the function just add the function call.
    If you do happen to alter the array from the function, simply make a copy within the role and use this.

  6. #26
    Hi, you will find two things:

    1. StringSubstr is changed. EOL flag is now -1 not 0

    2. NumberToStr is calling StringSubstr(str,start_pos,span ) using a negative start_pos.

    Outstr = StringSubstr(outstr,StringLen(outstr)-9-nleft,nleft 1 nright-dotadj);
    When this happens new MQL4 missing the plot, I'm not 100% sure exactly what old MQL4 does, I'm guessing forced a zero? I would replace all calls to StringSubstr(a,b,c) with calls to StrSubstrOld(a,b,c)


    string StringSubstrOld (string x,int a,int b=-1)
    if (a lt; 0) a= 0; // Stop odd behavior
    if (blt;=0) b = -1; // new MQL4 EOL flag
    reunite StringSubstr (x,a,b);




    I would also change the following to make the most of library functions: (or even in the case of StringLeftTrim just call the library function StringLeftTrim right )

    string StringLeftTrim (string str)
    reunite StringTrimLeft (str);


    string StringTrim (string str)

    reunite StringTrimLeft (StringTrimRight (str));


    string StringUpper (string str)

    StringToUpper (str);
    return str;


    there's still a dual -ve appearing on your test. Not sure why...
    EDIT:

    PS This is really really shoddy work from MQ. How many developer hours will be wasted with matters like this. The compiler should flag or induce exactly the same behavior if is not present.
    We shouldn't be expected to trawl through debuggers and documentation to get smaller differences like this.
    MQ must :
    1. Make lack of property rigorous 100% back compatible...
    2. Add compiler warning if function has shifted
    3. Produce a comprehensive migration guide.

  7. #27
    Quote Originally Posted by ;
    quote Provided that you aren't modifying the array in the role just insert in the function call. Simply make a copy within the role Should you happen to alter the array in the function and use this.
    Many thanks for your explanations.

  8. #28
    2 Attachment(s) ATTENTION, FANS OF HANOVER'S MT4 FILES!!

    Hanover isn't doing some more MT4 programming and zero further support of his most applications because build 600 . I went ahead and made edits myself into his functions and headers documents, using construct 670, BUT IN NO WAY AM I going to measure in David's enormous shoes and keep support!!!

    The updated documents are provided here, as-is, with no expectation of further maintenance or support. Use at your own risk! Neither the author(s) or contributor(s) (me or anybody else) assume any liability whatsoever! No exceptions!

    If you find further changes are needed, please don't hesitate to upgrade the files, upload them , and explain what and why you made adjustments. Fyi, if these are combined with other MT4 documents that provided elsewhere, it might well be that this really is when the problems will surface, which will necessitate bug fixes. Whatever is required is your duty!

    Important: See the text near the peak of the functions file (reproduced below) to see what changes you're most likely to need to create to's other MT4 documents which make use of them Include documents.

    Install them into your MQL4/Include/ folder. If you don't understand where that is, click Files Open Data Folder. (If you are not using the /portable option when conducting build 600 , well, you need to be, but hunt elsewhere on how to do it. With /portable, the Data folder that I end up using is below C:/Users/myname/MT4 myBroker/MQL4/... ).

    Inserted Code /* Version Background USE ONLY AT YOUR OWN RISK!!! The user assumes all liability for everything. The author(s) contributor(s) have ZERO liability!! NO EXCEPTIONS! Updated on 2014-Aug-04 by (Kent) for gt;600 support. HOWEVER, do NOT contact me for further aid, nor David, who has made it abundantly clear he's done with MT4 programming! My changes are provided as-is. If you make upgrades, post them to David's ribbon: Functional MQL4 utility works http://www.forum.com/showthread.php?t=165557 IMPORTANT! Should you combine this document with another of David's .mt4 source documents, then ABSOLUTELY create these changes using Replace, while enabling* options whole word and match instance: 1 ). Change his use of StringReplace into stringReplaceOld. (lower-case leading s). You will likely NOT receive any compiler error or warning, but the new MT4 function does not behave the same as Davids' does!! 2. Change StringSubstr into stringSubstrOld, because new MT4 expects different 3rd arument worth (-1 instead of 0); also it MIGHT corrupt sequences if the 2nd argument is suddenly lt;0. You won't find any compiler error or warning, but make the shift! 3. Change his use of variable name char to be s_char instead. Same with every other such key phrases. The compiler will give mistakes until fixed. 4. Repair all other compiler errors and remove warnings if possible, doing whatever needs to be done, then upload your changes to David's utility ribbon above. (. . .and elsewhere should you so choose). The local-variable names below are occasionally the same as global-variable names utilized. In general, an individual can usually ignore warnings which say: declaration of'varname' hides global declaration online XX, in File AAA, Line YY, Column ZZ Original: 2014-and-earlier: Hanover of all forum.com ALL COPYRIGHTS RESERVED! Decision / https://www.nigeriaforextrading.com/...den-sl-tp.html
    https://www.nigeriaforextrading.com/...ime-users.html

  9. #29
    Quote Originally Posted by ;
    ATTENTION, FANS OF HANOVER'S MT4 FILES!! Hanover is not doing some more MT4 programming....
    Many thanks for all of your hard work.

    I expect that other developers will continue to find the functions useful.

  10. #30
    Quote Originally Posted by ;
    I expect that other programmers will continue to find the functions useful.
    They certainly are, personally I've used at least some of these thanks a lot!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.