fxDreema

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

    Help - Custom MQL Code

    Questions & Answers
    8
    30
    4242
    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.
    • willramsey
      willramsey last edited by

      The bool can be nice to have though if you want to toggle it back on or something with other conditions. Glad you got it to work.

      1 Reply Last reply Reply Quote 0
      • J
        joemarkey6 last edited by

        Brilliant, thankyou,,

        1 Reply Last reply Reply Quote 0
        • J
          joemarkey6 @willramsey last edited by

          @willramsey Thanks for this, it works perfectly, how would you go about making it work for MT5, I tried to simply change the code where it says MT4 to MT5, grasping at straws'🤦‍♂️ it didn't work😁

          willramsey 1 Reply Last reply Reply Quote 0
          • willramsey
            willramsey @joemarkey6 last edited by

            For MQL5, this is the code. Unfortunately, there seems to be an error with FXDreema or something for the MQL5 version. You'll have to save it as a MQ5 (the source code) and delete the semicolons on the global variables (includes/defines). For whatever reason when trying to compile, it's putting semicolons which makes it returns an error when trying to compile. I did test it and it works.

            // Global Variables, includes
            
            #include <WinAPI/winapi.mqh>
            #include <WinAPI/winuser.mqh>
            #define MT_WMCMD_EXPERTS 32851
            #define WM_COMMAND 0x0111
            #define GA_ROOT 2
            
            // Main Code
            
               if (TerminalInfoInteger(TERMINAL_TRADE_ALLOWED)){
               
                  HANDLE hchart = ChartGetInteger(ChartID(), CHART_WINDOW_HANDLE);
                  HANDLE hmt = GetAncestor(hchart, GA_ROOT);
                  
                  PostMessageW(hmt, WM_COMMAND, MT_WMCMD_EXPERTS, 0);
               
               }
            
            

            When you export the MQ5 from FXDreema, you need to remove these semicolons:

            remove.png

            Sorry there isn't an easier way, not sure why it's randomly putting semicolons.

            1 Reply Last reply Reply Quote 0
            • J
              joemarkey6 last edited by

              OK, thats great, thanks again

              1 Reply Last reply Reply Quote 1
              • OntradingX
                OntradingX @willramsey last edited by

                @willramsey
                @jonatassantanacaje
                @jstap
                @sktsec

                Does anyone have a similar solution to Disable AlgoTrading on MT5 that doesn't need to use libraries?

                Sou do Brasil e utilizo o sistema Fxdreema a alguns anos, sempre que tenho tempo disponível eu tento ajudar alguém por aqui, mas se quiser uma ajuda mais próxima me contacte:
                Site: https://www.ontradingx.com.br
                Youtube: https://www.youtube.com/@ontradingx
                Boa sorte a todos nós!

                English - I'm from Brazil and I've been using the Fxdreema system for a few years, whenever I have time available I try to help someone here, but if you want more help, contact me:
                Website: https://www.ontradingx.com.br
                Youtube: https://www.youtube.com/@ontradingx
                Good luck to all of us!

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

                  ........

                  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! 😊

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

                    @jstap
                    I wanted to say in the message some solution for MT5 that does not need to use (libraries) and that is (similar) to the MT4 solution where it works to compile directly in Fxdreema without having to generate the .mq5 file and include it manually within the code.
                    But it's okay if there is no such solution and I'll check if I can make it work and post the solution here for everyone when I find it.

                    Sou do Brasil e utilizo o sistema Fxdreema a alguns anos, sempre que tenho tempo disponível eu tento ajudar alguém por aqui, mas se quiser uma ajuda mais próxima me contacte:
                    Site: https://www.ontradingx.com.br
                    Youtube: https://www.youtube.com/@ontradingx
                    Boa sorte a todos nós!

                    English - I'm from Brazil and I've been using the Fxdreema system for a few years, whenever I have time available I try to help someone here, but if you want more help, contact me:
                    Website: https://www.ontradingx.com.br
                    Youtube: https://www.youtube.com/@ontradingx
                    Good luck to all of us!

                    1 Reply Last reply Reply Quote 2
                    • N
                      Nantolin last edited by Nantolin

                      I have tried it and it works perfectly. Thank you very much!!

                      1 Reply Last reply Reply Quote 0
                      • N
                        Nantolin last edited by

                        To round off just in case the good work of the previous ones, if we want to activate it it's the same but adding the '!' to the conditional:

                        <<Global variables>>
                        #include <WinAPI/winapi.mqh>
                        #include <WinAPI/winuser.mqh>
                        #define MT_WMCMD_EXPERTS 32851
                        #define WM_COMMAND 0x0111
                        #define GA_ROOT 2

                        <<Settings>>
                        if (!TerminalInfoInteger(TERMINAL_TRADE_ALLOWED)){

                          HANDLE hchart = ChartGetInteger(ChartID(), CHART_WINDOW_HANDLE);
                          HANDLE hmt = GetAncestor(hchart, GA_ROOT);
                          
                          PostMessageW(hmt, WM_COMMAND, MT_WMCMD_EXPERTS, 0);
                        

                        }

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

                        Online Users

                        M
                        B
                        T
                        S
                        O

                        22
                        Online

                        146.7k
                        Users

                        22.4k
                        Topics

                        122.6k
                        Posts

                        Powered by NodeBB Forums | Contributors