fxDreema

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

    How to keep a fixed reference balance per trade in FxDreema (multi-EA issue)

    Questions & Answers
    2
    2
    24
    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.
    • Q
      Quanty last edited by

      Hi everyone again,

      I’m trying to solve a specific issue in FxDreema related to running multiple EAs on the same account.

      Goal:
      I want to close partial positions when the profit reaches +1%, but that 1% must be calculated based on the account balance at the moment the trade was opened (not the current balance).

      Current setup:

      • I use "check profit → % of balance = 1"
      • Then I close partial

      Context:
      The EA (called Momentun) works perfectly when running alone on a single account.

      However, I run a portfolio of multiple EAs simultaneously. As a result, the account balance changes due to other EAs running at the same time and managing their own trades (opening and closing positions).

      Because of this, the percentage-based calculation (based on account balance) becomes distorted for this specific EA (Momentun), since the balance is no longer constant.

      Also, since I am running multiple EAs, I do not want to manually assign a fixed value to each EA. I need the EA to automatically take the account balance at the moment the trade is opened as its reference, and then use that fixed value for its logic (such as partial closes), regardless of how the balance changes later.

      Problem:
      Trades can remain open for extended periods (2 to 4 weeks), and during that time:

      • The account balance changes due to other EAs
      • Both balance and equity can increase or decrease significantly due to other EAs
      • So the 1% value also changes, therefore the calculation is altered and no longer reflects the real profit or loss generated by this specific EA (Momentun), since the balance or equity has changed due to other EAs
      • This makes the logic inconsistent and distorts the behavior of this specific EA (Momentun)

      What I need:
      I need each trade to have its own fixed reference balance (the balance at the moment it was opened).

      Questions:

      1. What would be the best way in FxDreema to store the account balance at the moment a trade is opened and link it to that specific trade?
      2. How can this be handled per trade instead of using a global variable?

      Here is my EA structure:
      https://fxdreema.com/shared/xQbDDNRL

      Thanks in advance 🙏

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

        This should do it, there is code on two tabs: https://fxdreema.com/shared/UPExIp7D

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

        Online Users

        E
        M
        F
        A
        M
        E

        18
        Online

        146.6k
        Users

        22.4k
        Topics

        122.6k
        Posts

        Powered by NodeBB Forums | Contributors