Separate sum of negative and positive trades.
-
Hi friends, I would like to know if anyone can give examples of how I can get positive and negative values separately from the trading bucket.
Example:
I opened 4 deals:trading 1 earned 0.10$ profit
trading 2 I won 0.05$ and profit
trading 3 I lost 0.05$
trading 4 I lost 0.06$I want my EA to show the result on the screen:
Sum of profits: 0.15$
Sum of losses: -0.11$I'm trying different ways here on Fxdreema and I'm not succeeding.
-
@ontradingx
my project https://fxdreema.com/shared/bxxStRQye
strangely even the sum total is being done incorrectly by fxdreema.
can someone correct me if my logic is wrong? -
@ontradingx Do not use buckets of trades. Use variables instead. In this example you will store the value for winning trades:

Now simply mirror it for losers.
-
@l-andorrà Thank you very much for your help, but what I want is to see the metatrader history.
This example of yours doesn't search the history if the computer or VPs is shut down, so I was trying to use the business bucket to try to make the EA get the values already closed whenever it is put back on the screen, would you have any suggestions? -
@ontradingx Then you can substitute that 'For each trade' block for a 'For each closed trade' block instead. However, the longer the history record the slower the EA will be. You should limit the number of closed trades to search for.
-
@l-andorrà I understand, the biggest issue is that these "For each" blocks don't get data from a period, they get it by quantity and for what I need it must be a period.
For example, I want to get the sum of all winning trades for today.
I've tested it in every way and it doesn't work, I don't know if it's Fxdreema or Metatrader, it's disheartening. -
@ontradingx You can select candle time for your close trades this way:

-
@l-andorrà
https://fxdreema.com/shared/m6WUZy7pb
This is my project I'm testing, can you help me?
I only want to separate the current day trades.
But this is not happening. -
@ontradingx Time is vertical price is horizontal, you can't have left operand as time and, right operand as price level.
-
@jstap can you give me an example with a project or something? or screen prints?
-
@ontradingx I can but if you look at l-andorrà's picture it has time on left and time on right.
-
@jstap and @l-andorrà
https://fxdreema.com/shared/RrTPKY0sb
Hello friends, I got what I wanted separating the blocks, unifying them the error happened.
I also used it in the condition (Close time Unix), it was more correct in obtaining the exact negotiations and values.
Thank you very much for your help, you were very friendly.I hope this project helps someone in need.
-
@ontradingx Great work. Thanks for sharing.
