fxDreema

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

    Hello friends, how can I make my EA have a license that allows the EA to only work on a default broker and thus cannot work on any other broker?

    Questions & Answers
    4
    7
    452
    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.
    • VHV-Profit-Masters
      VHV-Profit-Masters last edited by

      Greetings everyone, please help me friends on this topic that I explain below: how can I guarantee that my Expert Advisor (EA) has a license that enables it to operate exclusively on a default broker and, therefore, cannot be used in any other broker?

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

        in account you can get the broker name, and check if this matches what you specify, otherwise terminate

        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
        • L
          lazyfxceo last edited by lazyfxceo

          In short something like this

          #define DEFAULT_BROKER_IDENTIFIER "YOUR_BROKER_IDENTIFIER"
          bool VerifyLicense(){
          string brokerIdentifier = TerminalInfoString(TERMINAL_COMPANY);
          if(brokerIdentifier != DEFAULT_BROKER_IDENTIFIER) {
          Print("ERROR: Invalid broker.");
          return false; // License verification failed
          ExpertRemove();
          }
          return true; // License verification succeeded
          }

          int OnInit(){
          if(!VerifyLicense()) {
          Print("ERROR: Invalid license. This EA is not authorized to run on this broker.");
          return INIT_FAILED; // Exit initialization process
          ExpertRemove();
          }
          // Continue with EA initialization
          return INIT_SUCCEEDED;
          }

          jstap L 2 Replies Last reply Reply Quote 0
          • jstap
            jstap @lazyfxceo last edited by

            @lazyfxceo That code will not work in FX without modification, and it is all in FX meaning minimal code is be needed

            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
            • L
              lazyfxceo @lazyfxceo last edited by

              @lazyfxceo said in Hello friends, how can I make my EA have a license that allows the EA to only work on a default broker and thus cannot work on any other broker?:

              return true; // License verification succeeded

              Yes you have to open the .Mq5 file In the metaQuotes Editor and you can then manually add the code to the EA, and rebuild

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

                OnInit

                Block: Modify Variable

                Account - Name:Broker (Store as Variable: BrokerName, store your broker in Input setting of the EA)

                Block: Condition

                Account - Name:Broker = BrokerName (Your variable storing your sepcific Broker) = True

                Block: Terminate

                Life is FUN - when you have control over it. Take control over FX & Have FUN all the Time! :-)

                1 Reply Last reply Reply Quote 0
                • VHV-Profit-Masters
                  VHV-Profit-Masters last edited by

                  Muchas gracias por sus comentarios, estoy probando con las sugerencias que no requieran de conocimiento de codificacion en mql.

                  Thank you very much for your comments, I am trying the suggestions that do not require MQL coding knowledge.

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

                  Online Users

                  A
                  G
                  Q
                  C
                  T
                  S
                  A
                  M

                  16
                  Online

                  146.7k
                  Users

                  22.4k
                  Topics

                  122.6k
                  Posts

                  Powered by NodeBB Forums | Contributors