fxDreema

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

    My EA not running at all, throwing up global initialization failed, global initializtion critical error

    Questions & Answers
    2
    10
    955
    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.
    • O
      Obimbs last edited by Obimbs

      practice.mq5
      Hi, everyone, I am pretty new to EA and just concluded basic tutorials. So I decided to try out some stuffs but my EA isn't running at all.
      Throwing up global initialization failed, global initialization critical error.

      I want anyone who can help to please help spot where I am getting it wrong.

      Also, I will put the details of what I am trying to practice

                     Condition for buying  
      

      Firstly, check if there is no running trade or pending order, if this check is true, then opens 3 pending buy orders and 3 pending sell orders above and below the close price of the last 1 hour candle respectively.
      These orders should be at equal interval of 20 pips from each other.

      (For example, if the close price of the last hour candle is 100, set the first pending buy order at 20 pips above, the second buy order at 40 pips above and the third at 60 pips above the 100 price, while the first pending sell orders will be 20 pips below, second will be 40 pips below, third one will be 60 pips below the 100 price).
      No stop loss set, no take profit set

                         Condition for closing 
      

      Close all trades (both open and pending positions) at any instant the total profit of running trades is equal or greater than $20.

      Here is already EA (.mq5 file) I have come up with
      practice.mq5
      . Thanks

      Morpheus_0 1 Reply Last reply Reply Quote 0
      • Morpheus_0
        Morpheus_0 @Obimbs last edited by

        @Obimbs Can you please create a shared link like this so myself or one of the guys can take a look..>>
        Screenshot 2024-09-29 at 14-49-15 The 300 Open Only.png

        PS: I suggest having larger gaps between orders and a good stop loss strategy because of the huge moves that come quite often. I've tried your strategy in the past...just saying... :-))

        1 Reply Last reply Reply Quote 0
        • O
          Obimbs last edited by

          Thank you @Morpheus_0.
          Here is a shared copy as advice.
          https://fxdreema.com/shared/Ggp9Flf3c.
          And thank you for the suggestion on having larger gaps between orders and a good stop loss strategy. I will be expecting your help on the project

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

            Heh...Well I wouldn't go 'expecting' things my friend. No one here 'works' for FXD. We all just give freely of our time when possible*

            However, I have good news and not so good news....

            The good news is it looks like you've set everything up properly.

            The not so good news is I can't see why you'd be getting the globalization errors...But I also deal more with MT4, not MT5.....

            And so: Are you getting those error messages when using the MT5 Compiler...?

            Have you tried it without the Delay blocks...? What are those even for...?

            Regards*

            1 Reply Last reply Reply Quote 0
            • O
              Obimbs last edited by

              Yes, I got the error message with MT5 compiler
              I added the delay block to prevent overlapping of orders
              I have not tried it without delay blocks. I will remove the delay block and see if it works

              Morpheus_0 1 Reply Last reply Reply Quote 0
              • Morpheus_0
                Morpheus_0 @Obimbs last edited by Morpheus_0

                @Obimbs said:

                I added the delay block to prevent overlapping of orders

                The two blocks above them should prevent that anyway....

                Did it work....?

                Also it won't open Buys AND Sells together unless you separate those in the No Position Blocks.....

                1 Reply Last reply Reply Quote 0
                • O
                  Obimbs last edited by

                  Thank you. I have removed the delay block and it now works.
                  Like you predicted, it only open the buy orders, it did not open the sell orders.
                  You advised that i "separate those in the No position blocks", but I do not comprehend fully what you asked that I separate. Can you please throw more light on what you mean. Thanks. I appreciate

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

                    Open the No Position/Orders Blocks and make it Buys for Buys and Sells for Sells....

                    Right now you have it "Either Buys or Sells".......*

                    1 Reply Last reply Reply Quote 0
                    • O
                      Obimbs last edited by

                      The EA now works perfectly as I want it after following your recommendation.
                      Gratitudes for your time and help. I appreciate it

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

                        Well done and you're welcome*

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

                        Online Users

                        F
                        R
                        S
                        D
                        V
                        O

                        15
                        Online

                        146.7k
                        Users

                        22.4k
                        Topics

                        122.6k
                        Posts

                        Powered by NodeBB Forums | Contributors