View earnings for today, last week, last month, last year
-
Hello, how could I calculate the earnings of the EA?
today's earnings
current week earnings
earnings of the month in current
current year's earnings. -
i need this one too and can't figure it out so far
-

I think this block should be configured.
with some formula that tells you that we want operations closed today.
we repeat the block for the current month, current week, current year.
but this must surely be an expression in mql4 or mql5. -
@cesardefez Someone could say what expression could be used, and if it works.
thanks -
@cesardefez You will need as many variables as periods to check.and then search for the closed trades on your MT4's history tab. Obviously the history tab should include all close trades.
-
Hi. I pass a photo of what I want to achieve in my panel.

As you can see at the bottom, I want you to report the profit for the year, the month, the week and today.
for this I have used the following block.
I have two problems:
the annual profit miscalculates it for me. it doesn't match the real thing. In the photo you can see how the box is configured.and for the week calculation I don't know how to do it. I would have to calculate the profit from Monday to Sunday of each week.
and finally a doubt.
What is the shift in time option for?thanks
-
@cesardefez I havent tried calculating profits, but this I would try first:

-
@roarIt
The configuration that you recommend does not work for me.
I use the code for mt5.
from my logic, I have used the following configuration.
year ... 0, or empty to indicate the current year (2021).
month ... 1. No and if so. I have placed 1, thinking it is January.
day 1 . -. , from day 1.January 1, 2021.
shift in time ..... no shift. (I don't know what it's for)
Please can you help me to calculate the week.
from Mondays to Sundays .?
7 / 5000
Resultados de traducción
Thank you -
@cesardefez Then you will need to create as many variables as periods and then calculate them separatedly via 'for each closed position' and a close date filter. Its s bit more comples but effective.