fxDreema

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

    Error after run Custom Block

    Questions & Answers
    2
    6
    363
    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.
    • X
      XDV last edited by

      Please ask someone who knows. This code from genius guy that create a custom block to control Algo-Trading Button in MT5 but after run have error ... please Help find this solution. Thank you in advance.

      002.png
      001.png
      ----- Upper Block ------
      bool Status = (bool) TerminalInfoInteger(TERMINAL_TRADE_ALLOWED);

      if(Status != false)
      {
      HANDLE hChart = (HANDLE) ChartGetInteger(ChartID(), CHART_WINDOW_HANDLE);
      PostMessageW(GetAncestor(hChart, GA_ROOT), WM_COMMAND, MT_WMCMD_EXPERTS, 0);
      }
      ~next~

      ----- Lower Block ------
      #ifdef MQL5
      #include <WinAPI\winapi.mqh>
      #define MT_WMCMD_EXPERTS 32851
      #else
      #define HANDLE int
      #define PVOID int
      #import "user32.dll"
      HANDLE GetAncestor( HANDLE hwnd, uint flags);
      int PostMessageW( HANDLE hwnd, uint Msg, PVOID param, PVOID param );
      #import
      #define MT_WMCMD_EXPERTS 33020
      #endif

      #define WM_COMMAND 0x0111
      #define GA_ROOT 2

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

        All to do is in this page: https://fxdreema.com/forum/topic/19004/help-custom-mql-code?_=1718300737685

        Learn fxDreema Without the Wait!

        My comprehensive book, available on Amazon, is packed with examples and invaluable insights to help you fast-track your learning journey.

        The paperback and hardback editions include MT4 & MT5 QR codes for easy access to all prebuilt projects and robots, including my latest gold trading robot!

        Don’t miss out

        Click here➡️ https://mybook.to/fxDreema to get your copy today!

        Enjoy! 😊

        1 Reply Last reply Reply Quote 0
        • X
          XDV last edited by

          Thank you so much @jstap I have read your link and many other related links. Including checking the code. But the result is the same error. Is it possible that the error occurred not from the code, but from some settings? And how can I fix it?
          So it says

          can't open "S:\www-node\Server\apps\fxdreema\components\builder\templates\export\MQL5\compiler\MQL5\Include\WinAPI\winapi.mqh" include file
          'AlgoTradingStatus' - undeclared identifier

          1 Reply Last reply Reply Quote 0
          • X
            XDV last edited by

            For your link I make it on MT4 and Complete run and working perfectly.
            But MT5 with MT5 code is not work with error >> can't open "S:\www-node\Server .... winapi.mqh

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

              I do not know, I only used it with MT4

              Learn fxDreema Without the Wait!

              My comprehensive book, available on Amazon, is packed with examples and invaluable insights to help you fast-track your learning journey.

              The paperback and hardback editions include MT4 & MT5 QR codes for easy access to all prebuilt projects and robots, including my latest gold trading robot!

              Don’t miss out

              Click here➡️ https://mybook.to/fxDreema to get your copy today!

              Enjoy! 😊

              1 Reply Last reply Reply Quote 0
              • X
                XDV last edited by

                OK Thank you so much @jstap 👍

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

                Online Users

                M
                2
                M
                M
                N
                B
                A
                B
                S
                E
                W
                M

                33
                Online

                146.6k
                Users

                22.4k
                Topics

                122.6k
                Posts

                Powered by NodeBB Forums | Contributors