fxDreema

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

    Block"for each trade"Affects backtesting speed

    Bug Reports
    4
    4
    239
    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.
    • T
      TXZZ last edited by

      I wrote a Martingale Expert Advisor (EA), but the backtesting speed becomes increasingly slow as the number of historical orders increases. I tried using Grok to solve the problem, and its judgment is the same as mine, but its fix always results in a compilation error. I hope Fxdreema can fix this so that I don't have to modify every Martingale EA.

      The problem you encountered is very typical: the Expert Advisor (EA) generated by fxDreema slows down considerably during backtesting as the number of historical orders increases, eventually even freezing.

      The core reason, as you identified, is that Blocks 11 and 15 (i.e., MDL_LoopOncePer) iterate through the entire historical order history (OrdersHistoryTotal()) on every tick, using OrderSelect(i, SELECT_BY_POS, MODE_HISTORY) + OrderOpenTime() >= TimeAtStart() to determine if an order is from the current startup.

      As the backtesting period lengthens, with tens of thousands of historical orders, these two blocks perform a full table scan every tick, leading to a catastrophic performance drop.

      The best solution (minimum changes + complete resolution) is simply to change the implementation of the MDL_LoopOncePer class from "iterating through historical orders" to "using a static array to record the parent tickets that have been processed."

      Modify the following location: Locate the class MLD_LoopOncePer<bool> (around lines 600-650 of the code).
      @fxDreema

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

        This is one of the side effects of using fxDreema. You can create any EA you want but a t the 'price' of using innefficient loops when bac testing or optimizing. The only solution I found for this iuue over the years is suing fxDreema to confirm my strategy works fine and then hiring a programmer to biuld it from scratch with efficient code. Sorry for the bad news. 😞

        (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
          albyxx last edited by

          @TXZZ you've probably already looked into this but is it necessary to process these blocks every tick?
          Your EA would be MUCH more efficient if you could process these blocks every M1, M5 or maybe even a higher TF?

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

            91761db6-c1a0-4fb2-b806-fcb6eb6073c2-image.png

            I resolved most of the slowdowns in my EA's on Fxdreema when I started organizing the blocks better, but each person may have a different logic, I'll try to give some tips based on what you mentioned about (orders).

            In this case I use the On trade tab and turn on position create and position close blocks to bring me the loops I request, these blocks will act (only when such actions happen).

            Just like in Ontick I put the once per bar where the rules or analyzes really need to happen at the candle closes and I only leave in Ontick directly what really needs to be handled at each tick of the market happening, so I believe that fxdreema has its limitations but it is also possible to use the custom mql code block with the help of AI to make things that are slow in fxdreema work faster.

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

            Online Users

            S
            T
            A
            Y
            H
            B
            K

            17
            Online

            146.7k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors