fxDreema

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

    need help creating Equity condition

    Questions & Answers
    2
    5
    760
    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.
    • D
      danzadrummer last edited by

      trying to create an EA that will close all open trades when Equity has increased or decreased by a certain percentage of the balance. i can find Equity under the account section but no way to adjust it by percentage. appreciate any tips. thanks

      Q 1 Reply Last reply Reply Quote 0
      • Q
        q8carpenter @danzadrummer last edited by q8carpenter

        @danzadrummer

        Use this only as a guideline to understand how to approach this problem.

        1. The formula block calculates part of the percentage equation. is its a loss then it will give a negative value.
        2. the condition block left side will have the equity variable and at the bottom it is adjusted to (*100) multiply by 100 to give you a percentage. still the value will be negative is it's a loss,,,
        3. that's why in the condition block i had it set to equity variable (less than) -10 due to the negative value of a loss.

        if you want a positive value, then you may need to create another formula that multiplies by -1

        This is how I do things. maybe someone has a simpler idea.

        0_1588995467099_equity not done.jpg

        D 2 Replies Last reply Reply Quote 0
        • D
          danzadrummer @q8carpenter last edited by

          @q8carpenter

          Thanks q8, your reply reminds me of why people like me pay people like you to make indi's and EA's. 🙂
          i definitely appreciate the advice though and will dig into it and see what i can come up with. Have a good'n.

          1 Reply Last reply Reply Quote 0
          • D
            danzadrummer @q8carpenter last edited by

            @q8carpenter

            HA! i actually found something that works. probably not the most efficient method and will probably fail when i need it most but it's working for now. i was trying to find the "pass" tab that was in your pic and stumbled on these so i owe you one thanks again.!0_1588999179444_equity.PNG

            Q 1 Reply Last reply Reply Quote 0
            • Q
              q8carpenter @danzadrummer last edited by

              @danzadrummer

              You're welcome. It seems your way is way simpler than mine. as you can see there are many approaches to every situation. It seems I over complicate things 🙂

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

              Online Users

              N
              S
              T
              A
              Y

              21
              Online

              146.7k
              Users

              22.4k
              Topics

              122.6k
              Posts

              Powered by NodeBB Forums | Contributors