Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 408
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
Is there any way to implement it correctly so that it closes starting from zero? If possible a line of code please.
Is there any way to implement it correctly so that it closes starting from zero? If possible a line of code please.
Just a quick fix:
Yes, I should have written more precisely. It's just that I've already laid out in full twice what this function is supposed to do, but no one has answered. Once again, what this function should do. Suppose I have a grid of orders. Whether they are opened with the same step or not, it does not matter. One order was opened earlier and another one later, i.e. every position has passed a different amount of points with a different lot. The grid will be closed according to certain conditions and I need to calculate the LOT needed to cover the loss incurred from that grid for TP points. In order not to write two mirror functions I introduced an otype parameter in the function.
But still there is an error somewhere. Please help me fix it.
A quick hand job:
Thank you very much, everything is working correctly, thanks to all who responded!
I would take a different route. First, I would calculate the loss from closing the grid. And then it is as simple as that. Loss = Profit from the next order. Express the profit from the order through the lot and TP and find the lot from the equation.
Is the loss at the end of the grid in money or pips?
is the loss from closing the grid in money or pips?
What about the fact that each pair has a different point price?
What about the fact that each pair has a different point price?
Here you can see how it is implemented
https://www.mql5.com/ru/code/7275
https://www.mql5.com/ru/forum/113937/page2
https://docs.mql4.com/ru/constants/marketinfo
How do I enter it so that the compiler doesn't throw an error?
?
I found a replacement in the navigator:
#include <stdlib.mqh>
.