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

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
It feels like the original text comes from a parallel universe, was translated twice by google-translate and then retold by Alice :-)
Okay. There is a function that can be used to find the last lot. It's calledFindLastLots. But I want to make a function that doesn't just search for the last lot, but with the help of which you can change Lots. That is, if extern lots = 0.01; I want to change lots = 0.01, say, to 0.04 usingthis function. And here I need help to understand how it can be implemented in general.
...
change lots = 0.01, say to 0.04. Without using multiplication.
...
Well... if multiplication is a problem, you can get the desired result by addition.
Well... if multiplication is a problem, you can get the result you want by adding.
-:)
without sayingWell... if there are problems with multiplication, you can get the desired result by addition.
I understand your sarcasm, but that in multiplication or calculation cases, there should be as many multipliers as there are external variables Lots. That's not a way out of the situation. Although I'll be honest, I've thought about it...
I understand your sarcasm, but that in multiplication or calculation cases, there should be as many multipliers as there are external variables Lots. That's not a way out of the situation. Although I'll be honest, I've thought about it.
I can't remember the details right now, but I was ordered something complicated in calculating Lots. As a result, a formula was found by which the calculation was made.
Perhaps you would be better off stating the order in detail? Then someone can suggest this formula.
I can't remember the details now, but I was ordered to do something elaborate in calculating the lot. The result was a formula that was used to calculate it.
Perhaps you would be better off stating the order in detail? Then someone can suggest this formula.
There are several external variables of Lot. If an order is closed by Stop Loss, a new order is opened with the new lot that is specified in the external variable. (Maybe, this is how we should have originally written it). I just don't know how to write it correctly in code. And as I wrote above, no multiplication or calculation, no external multiplier will help. We need to somehow go through the data of closed orders...
There are several external variables Lot. If an order is closed by StopLoss, then a new order opens with a new lot, which is specified in the external variable. (Maybe, this should have been originally written in this way) And here is the hitch. I just don't know how to write it correctly in code. And as I wrote above, no multiplication or calculation, no external multiplier will help. We need to somehow retrieve data from closed orders ...
When opening an order, write the number of the rule/variable in the comment.
then when you check the history - fetch this number, add 1 to it and get a new rule number
There are several external variables Lot. If an order is closed by StopLoss, then a new order opens with a new lot, which is specified in the external variable. (Maybe, this should have been originally written in this way) And here is the hitch. I just don't know how to write it correctly in code. And as I wrote above, no multiplication or calculation, no external multiplier will help. We have to go through the data of closed orders somehow.
Experiment with this code, maybe this is what you need
2019.11.28 22:31:26.409 tst EURUSD,H1: 0.7 ---> 0.7
2019.11.28 22:31:26.409 tst EURUSD,H1: 0.6 ---> 0.7
2019.11.28 22:31:26.409 tst EURUSD,H1: 0.5 ---> 0.6
2019.11.28 22:31:26.409 tst EURUSD,H1: 0.4 ---> 0.5
2019.11.28 22:31:26.409 tst EURUSD,H1: 0.3 ---> 0.4
2019.11.28 22:31:26.409 tst EURUSD,H1: 0.2 ---> 0.3
2019.11.28 22:31:26.409 tst EURUSD,H1: 0.1 ---> 0.2
In my function GetNextLot() you feed the volume of the last closed order, and it will return the next value of the Lot_XX setting
the only limitation in this code is that lots settings should be in ascending order - I think the code is simple and straightforward, you can modify it to suit your needs