fxDreema

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

    "check profit (period of time)" modification please?

    Questions & Answers
    2
    5
    1205
    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
      Jnmr1 last edited by

      my EA bases lot size from account balance, and as such I need a way to check profit over a period of time that scales with the account size. measuring in account percentage would be ideal. pips would work, but would be crude. compounded percentage would work best.

      thanks
      James

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

        In "Check profit (period of time)" you enter "money" type of value, which is your account currency, for example dollars. You can always use more complex value there, for example AccountBalance()*0.01 (or AccountEquity()*0.01). Of course, AccountBalance() is a MQL function that gives you the current balance, but I think it's easy enough to be used. AccountBalance()*0.01 gives you 1% of the balance, so if the balance is 1000 dollars, the value would be 10.

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

          ok thank you

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

            Ok I have been testing. The problem I see is that I need to be able to get a time shifted balance (1 hour ago, 1 day ago, 1 month ago, etc) otherwise it is always short of the goal. $1000 gained 2% today which is $1020, 1020*0.02=20.4 which is $0.40 short of the goal. I don't know of any way to overcome this other then to get the AccountBalance() from yesterday.

            Thanks
            James

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

              maybe modify the block so that it always rounds the resault down to the nearest dollar?

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

              Online Users

              F
              C
              A
              E

              10
              Online

              146.7k
              Users

              22.4k
              Topics

              122.6k
              Posts

              Powered by NodeBB Forums | Contributors