fxDreema

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

    Error Code "NOT ENOUGH MONEY"

    Questions & Answers
    3
    5
    217
    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.
    • Y
      YOUUNMEE last edited by

      Hello support and team... an ea developed using this tool display error code "NOT ENOUGH MONEY" during validation phase on the mql5 portal. And l took a look at the reason and fixes here below is the recommendation "
      test on EURUSD,H1
      strategy tester report 67 total trades
      test on NZDUSD,H1
      2022.02.01 09:37:58 Tester: not enough money

      Recommended Fixes;
      MQL4

      bool CheckMoneyForTrade(string symb, double lots,int type)
      {
      double free_margin=AccountFreeMarginCheck(symb,type, lots);
      //-- if there is not enough money
      if(free_margin<0)
      {
      string oper=(type==OP_BUY)? "Buy":"Sell";
      Print("Not enough money for ", oper," ",lots, " ", symb, " Error code=",GetLastError());
      return(false);
      }
      //--- checking successful
      return(true);
      }

      But l don't understand what to do... Please l need help.

      A 1 Reply Last reply Reply Quote 0
      • l'andorrà
        l'andorrà last edited by

        This is an issue for a real programmer. Are you sure you are using the lot size limits as per mql5 site?

        (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

        (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

        (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

        1 Reply Last reply Reply Quote 0
        • A
          ambrogio @YOUUNMEE last edited by ambrogio

          @YOUUNMEE It happens when there is not enough margin to open a new position. A few years ago I set up this way to check the margin. This is valid on forex pairs (no indices, no metal...ecc..)
          Put these blocks just above your buy/sell market/pending orders and below your condition to trigger trades

          Immagine 2025-06-08 154708.png

          I think someone here can write a few code lines to include all instruments

          Y 1 Reply Last reply Reply Quote 0
          • Y
            YOUUNMEE @ambrogio last edited by

            @ambrogio... Wow. you the best... Thank you so much the block worked.. and am really grateful.. Thank you

            A 1 Reply Last reply Reply Quote 0
            • A
              ambrogio @YOUUNMEE last edited by

              @YOUUNMEE you're welcome!

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

              Online Users

              T
              S
              A
              S
              I
              H
              M
              D
              A
              W

              16
              Online

              146.7k
              Users

              22.4k
              Topics

              122.6k
              Posts

              Powered by NodeBB Forums | Contributors