"check profit (period of time)" modification please?
-
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 -
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.
-
ok thank you
-
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 -
maybe modify the block so that it always rounds the resault down to the nearest dollar?