Help with Custom MQL4 code
-
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?
-
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.
-
__... (but I should add some)...[/quote:208gbq4r]
that would be perfect
-
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).
-
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.