fxDreema

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

    How can I set up a condition to activate/deactivate MoneyManagment?

    Questions & Answers
    2
    4
    2416
    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.
    • J
      josecortesllobat last edited by

      Hello

      Please, I need help because I don't know what I am doing wrong with one condition. I want to choose in some way if my EA have to trade with a risk % of the Equity account or using fixed lots.

      I have tried to add a condition using a boolean variable for Money Management activation or not:

      MoneyManagement bool (True = %Equity, False = Lots)
      If MoneyManagement == True -> Buy/Sell with MM
      If MoneyManagment == False -> Buy/Sell with Lots

      So, my EA looks like this

      0_1510561856732_fe73751d-c681-48d9-ac6d-b3503b7e833d-image.png

      But the EA does not open any trade on the backtesting:

      0_1510561981614_1435da29-18cf-4e7c-8abd-70967ba28bd1-image.png

      If I delete the MoneyManagement condition the EA Works as it should be with MM or Lots:

      0_1510562082520_5eece611-6dde-4fc3-b07c-4680707d91f4-image.png

      0_1510562147003_0cef9a69-304f-4e44-bf05-db51cfaad8b1-image.png

      Could anybody help me to get what I want on my EA?

      Thanks

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

        Hi josecortesllobat,

        I'm not an expert, but these are the problems I see.

        1. "MoneyManagement" should be a constant, not a variable. That's the only way you will be able to choose it manually.

        2. Once you manually choose if it is true or false, the order of blocks should be different:

        • Blocks 1, 2 and 3 remain unchanged.
        • Then blocks 13 and 14 remain as per your screenshot.
        • What is changed is that block 15 should be then connected below block 13 through the yellow connection, not the usual orange one.
        • Hold block 9 as per your screenshot.

        This way your EA will first check if moneymanagent is true. If so the trade will be open. If it is false, the new path will be chosen. Your current structure is trying to check both conditions (true and false Moneymanagement) simultaneously and things in MT4 cannot be true and false at the same time. 😉

        Hope it helps.

        1 Reply Last reply Reply Quote 0
        • J
          josecortesllobat last edited by

          Hi isp00rt

          Great job!!!

          It Works as I expected

          0_1510589228043_cad65ad6-170c-4a00-811d-b54010f0e1e3-image.png

          0_1510589239332_3ba4a10d-b5d3-47b3-9b87-23c02109be8d-image.png

          0_1510589259590_7c6ba5f6-34ac-48a6-8d6a-924463540737-image.png

          Thanks a lot for your help. I thought that the yellow connection was for the opposite signal of the condition not for checking if the consition is not true. You help makes me understand better the logic of the connections.

          🙂

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

            You're welcome. 😉

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

            Online Users

            O
            J
            B
            M

            14
            Online

            146.7k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors