fxDreema

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

    Just for fun - how fast is the MQL5 programming language?

    General Discussions
    2
    2
    367
    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.
    • A
      albyxx last edited by albyxx

      I’ve been wondering how fast the MQL5 programming language actually is so I made a tiny script using fxDreema to test it.
      MQL5 is based on C++ and it is known to be pretty quick.
      The script is very simple, it will run a specified amount of iterations of a “while loop” and on completion print results to the experts tab.

      Here it is:
      https://fxdreema.com/shared/tgzUPoVUb

      In the Custom MQL Code block a counter will continue to add 1 to itself until it reaches the setpoint.
      The while loop will then complete and the result will be printed to the experts tab.

      If you want to try it you can either save it as an .mq5 file and compile it or compile it directly as an .ex5 file and put it in your MT5 scripts folder.
      From there just pull it onto any chart and specify how many billions of loops you want it to run.

      If I run 100 billion loops on my PC it takes about 87 seconds to complete or in other words about 1.15 billion loops per second; that’s quite impressive!!
      I have an Intel i9 10900k.

      I ran the same test in Python and it was about 75 times slower.

      But, note that a trading EA has many blocks with a huge amount of fxDreema underlying code so any EA will obviously be many thousands of times slower than this test script.

      Always try to keep your code efficient.

      Have fun!!

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

        Very interesting info. Thank you very much for sharing. 😉

        (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
        • 1 / 1
        • First post
          Last post

        Online Users

        S
        N
        S
        E
        S
        K
        S

        22
        Online

        146.6k
        Users

        22.4k
        Topics

        122.6k
        Posts

        Powered by NodeBB Forums | Contributors