Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1562

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
So a profit is only added up if it is positive. If it is negative, it is a loss. If we want to know the total profit, all profits, including negative ones, are summed up. And this function tries to find out the profit of the last order, it does it incorrectly and is called lastloss. Don't you get it? Oh, dear... I'm exhausted...
I'm not talking about the correctness of his function ... the man doesn't know how to use the search...
But about the swap, I'll put it another way...
It searches for the last losing trade and sums up OrderProfit, but if the swap was positive, the loss is smaller?
not there in void OnTick
right? no change there either
"And why are you adding swap and commission to profits? And when you do.
can also be negative...
And what kind of total profit are we talking about if you only process 1 or a few matching orders, but not all?"
Something really confused each other. It was all right in the remark, not about adding and subtracting negative numbers)
I don't like answers either Seek, it's there)
like this? that's also the same.
Also fix this in the OnTick at the very end
also fix it in the OnTick at the very end
changed it, no change, it's crazy, I've been working on this function for a couple of days now, nothing works.
I changed it, no change, it's crazy, I've been working on this function for a couple of days now, nothing works.
You should upload the whole code or attach a file, I'll look at it tomorrow.
i am not good at mql5 but i will try to help)
Post the whole code or attach a file, I'll look at it tomorrow.
i am not good at mql5, but i will try to help)
i would like to take a look at it. the function seems to be simple, but something prevents it from doing so.
I think there is something wrong with void TrailingOrder()
Please check this function, it seems to be simple, but something prevents it
I think there is something wrong with void TrailingOrder()
Try it in the tester.
I won't say anything about the correctness of his function...the man doesn't know how to use the search engine
But about the swap, let me put it another way...
it looks for the last losing trade and sums up OrderProfit, but if the swap was positive, the loss is smaller?
Well, of course it gets smaller and the profit gets bigger. :) Do you even hear yourself? What positive swap? Where have you seen such a thing?!
Of course, it's getting smaller and the profits are bigger. :) Do you even hear yourself? What positive swap? Where did you see that?!
I have. More than once. I even wanted to build on the changes in such swaps