fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search

    Help with Custom MQL4 code

    Questions & Answers
    3
    5
    1635
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Abade69
      Abade69 last edited by

      I want to use the following code inside an EA:

      //+------------------------------------------------------------------+
      //|                                                 ChangeTF-All.mq4 |
      //|                                         Copyright © 2010, zznbrm |
      //+------------------------------------------------------------------+
      #property copyright "Copyright © 2010, zznbrm"
      #property show_inputs
      
      #import "user32.dll"
         int      PostMessageA(int hWnd,int Msg,int wParam,int lParam);
         int      GetWindow(int hWnd,int uCmd);
         int      GetParent(int hWnd);
      #import
      
      #define GW_HWNDFIRST 0
      #define GW_HWNDNEXT  2
      #define WM_COMMAND   0x0111
      
      extern int eintTF = PERIOD_W1;
                         
      int start()
      {      
         bool blnContinue = true;   
         int intParent = GetParent( WindowHandle( Symbol(), Period() ) );   
         int intChild = GetWindow( intParent, GW_HWNDFIRST );  
         int intCmd; 
         
         switch( eintTF )
         {
            case PERIOD_M1:   intCmd = 33137;  break;
            case PERIOD_M5:   intCmd = 33138;  break;
            case PERIOD_M15:  intCmd = 33139;  break;
            case PERIOD_M30:  intCmd = 33140;  break;
            case PERIOD_H1:   intCmd = 35400;  break;
            case PERIOD_H4:   intCmd = 33136;  break;
            case PERIOD_D1:   intCmd = 33134;  break;
            case PERIOD_W1:   intCmd = 33141;  break;
            case PERIOD_MN1:  intCmd = 33334;  break;
         }
         
         if ( intChild > 0 )   
         {
            if ( intChild != intParent )   PostMessageA( intChild, WM_COMMAND, intCmd, 0 );
         }
         else      blnContinue = false;   
         
         while( blnContinue )
         {
            intChild = GetWindow( intChild, GW_HWNDNEXT );   
         
            if ( intChild > 0 )   
            { 
               if ( intChild != intParent )   PostMessageA( intChild, WM_COMMAND, intCmd, 0 );
            }
            else   blnContinue = false;   
         }
         
         // Now do the current window
         PostMessageA( intParent, WM_COMMAND, intCmd, 0 );
      }
      

      But then i get this:

      https://s14.postimg.org/ncix94fst/Error.png

      What should i change to make it work?

      1 Reply Last reply Reply Quote 0
      • fxDreema
        fxDreema last edited by

        There is no particular field where you can set such information to be embedded to the output EA (but I should add some). Only if you make a custom block you can put such information under "Global variables, includes" and then when the block is used, the information is automatically embedded.

        1 Reply Last reply Reply Quote 0
        • M
          miro1360 last edited by

          __... (but I should add some)...[/quote:208gbq4r]
          that would be perfect ⚡

          Between trading and gambling is a very small gap, be careful.

          1 Reply Last reply Reply Quote 0
          • Abade69
            Abade69 last edited by

            Is there any other way to loop that code with FxDreema? (or any way to change time frames with the existent blocks). I really don't wanna use autokey macros. Also, the block builder has bugs: Everytime i try to click something it minimizes itself, it saved my first block and can use it, but not the second one (for some reason).

            1 Reply Last reply Reply Quote 0
            • fxDreema
              fxDreema last edited by

              I'm aware about this problem in the desktop version, but I stopped making desktop versions year ago. Since then I rewrote everything from PHP to NodeJS and I will update everything on the server probably after few days. In other words, PHP is history, as well as the current desktop version. I of course tried to find why this problem appears back then, without success. I used ExeOutput for PHP to make it, and this software is not only buggy, but also unsupported.

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post

              Online Users

              E
              J
              D
              M
              X
              K
              E
              D
              M
              H

              19
              Online

              146.6k
              Users

              22.4k
              Topics

              122.6k
              Posts

              Powered by NodeBB Forums | Contributors