fxDreema

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

    Terminate EA when Equity is above a certain number

    Questions & Answers
    2
    4
    1198
    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.
    • B
      BlueMoon last edited by

      I am trying to terminate my EA when my equity reached a certain number that I provide in the input of starting the EA. I also want to close all trades at this point.

      Something went terribly wrong with this code. I am not sure what happened. But I noticed the following:

      1. My equity has not reached the number that I had input.
      2. It still terminated my EA.
      3. It did not close any trades.
      4. I did get the Alert message so seems like the condition did pass.

      How is all this possible? Any ideas?

      0_1504788326348_upload-c303a411-23a5-4ee6-9036-e63bdf8d2a33

      0_1504788350111_upload-30738d84-d880-407f-adba-be9c49f79f58

      0_1504788558377_upload-012ea4bc-0622-4517-a19f-0665151e0ce8

      1 Reply Last reply Reply Quote 0
      • M
        miro1360 last edited by miro1360

        your equity has not reached it? are you sure about?
        because maybe it has reached, trade closing was rejected by broker 😄 these broker tricks happened often to me ... be little smarter against these tricks, take inspiration from this mine:

        https://fxdreema.com/shared/UuczqhM4
        0_1504812723216_upload-f99e647f-0b6e-4229-bd92-0ece2968abce

        Between trading and gambling is a very small gap, be careful.

        1 Reply Last reply Reply Quote 0
        • B
          BlueMoon last edited by

          Yes I am 100% sure my equity didn't reach.

          Any idea what could have happened? Why did my EA terminate? Obviously my equity at some point even for 1 second might have reached due to whatever reason. What could be such reasons? Also even if that happened why my trades didn't close?

          I checked your blocks and code, how is it different than what I am doing?

          1 Reply Last reply Reply Quote 0
          • M
            miro1360 last edited by

            it is different in more robust logic, when equity reach point, variable terminatingActive become "true" and at this point Close trades block is repeating itself up to situation where no trade exist and EA is terminated only in situation when no trade exist ...

            I dont know another reason why it happened to you, only broker reasons/issues 😄

            Between trading and gambling is a very small gap, be careful.

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

            Online Users

            H
            E
            J
            S
            W

            15
            Online

            146.7k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors