@q8carpenter
https://fxdreema.com/shared/PO7lWT8ye
Thanks for helping.
I've been trying this way and what happened is it doesn't show on the screen what I need. See the image above.
What I need is for the block to search for information on trades already closed, each one of the trades has to be computed in the gains or losses.
I'm trying different ways and I don't see anything being written to the variable.
What I want is that when the EA is put on the chart it checks all closed trades and separates them by day, week, month and year.
With this, each new closed trade will keep these balances updated.
If I graphed the EA now, then it should get these values:
Daily gain - When placing the EA on the chart, it should check if there was any trade on the same day, if there was it shows its total value, if not it will show the value 0, if I open and close the trade it should show the value from this negotiation and only reset the next day and every day repeat this same routine.
Weekly gain - When placing the EA on the chart, get the values we already have of gain for the week, from Sunday (when the market starts) and sum up the profits and losses for the entire week until Friday (when the market closes).
Every Sunday this balance must be reset.
Monthly gain - When placing the EA on the chart it must obtain the sum of all gains and losses from the first day of the month to the last day of the month, this value must always be reset to zero on the first day of the following month.
Annual gain - When placing the EA on the chart it should get and update the sum value of all gains or losses from the first day of the year to the last day of the year.
Always reset the information on the first day of the following year.
This is the project I'm testing.
https://fxdreema.com/shared/PO7lWT8ye