Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1561
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
Don't remove
You have to change the sign like I wrote.
So I did, and it opens up to five contracts as usual.
so I changed it and it opens up to five contracts as usual
Then add up to calculate the entire profit for the period.
You misunderstand again. He said he wanted to count the profit. The function tried to calculate the loss of the last closed order, and it was not correct. So, he confused everyone in the end.
Post the OnTick() code
find the line
OPENORDER("Buy");
and replace it with.
find a line
OPENORDER("Sell");
and replace with
You misunderstood again. He said he wanted to calculate the profit. The function tried to calculate the loss of the last closed order and it was not correct. So he confused everyone in the end.
find the line
and replace it with.
find a line
and replace it with.
I put it in that way, it's still unlimited on two contracts
You said yourself the profit may be negative and he wanted to get the total profit of the trade positive or negative
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 put it in that way, but it's still unlimited on two contracts.
not there in void OnTick
Then add up to calculate the entire profit for the period.
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)