Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1301
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
everything needs to be fixed.
Your code searches for the first found order from the order history with the given symbol and the given magician
then count the number of unprofitable orders found and multiply to the power of 2 this number of orders
search the forum for"useful functions from CMM" and do something like this
- find the ticket of the last order for our symbol and our magik
- obtain OrderProfit() and OrderLots() from the found ticket and multiply by your martingale coefficient, if necessary
ZS: there may be a ready solution
such
If you know the starting lot, you can use the last losing order to check its lot and calculate the knee number, and if the order is in profit, you start with the starting lot again
learn to find the last closed order with your magician
if the system of lot calculation is very complex - the option of a magician + the knee number for new orders, you can also use comments, but not very reliable, better use several magicians
Your code just goes through the orders - it does not see anything, that is why I paid attention to it
like this
If you know the starting lot, then you can use the last losing order to check its lot and calculate the knee number, and if the order is in profit, you start with the starting lot again
learn to find the last closed order with your magician
If the system of lot calculation is quite complex - the option of a magician + the number of a knee for new orders, you can also use comments, but not reliably, better use several magicians
Your code just goes through the orders - it does not see anything, that's why I paid attention to it
not right
But if it suits you, then try to fix your code that way.
wrong
but if it suits you then try to correct your code like this
He will get at the third multiplication: 3*2=6, and he already needs 8, and the fourth will be 8, and he needs 16.
k = {1,2,4,8,16,......}
cn = k[c]
He will get at the third multiplication: 3*2=6, and he already needs 8, and at the fourth multiplication he will get 8, and he needs 16.
2020.11.08 11:28:09.527 tst (EURUSD,H1) i = 1, c = 2
2020.11.08 11:28:09.527 tst (EURUSD,H1) i = 2, c = 4
2020.11.08 11:28:09.527 tst (EURUSD,H1) i = 3, c = 8
2020.11.08 11:28:09.527 tst (EURUSD,H1) i = 4, c = 16
2020.11.08 11:28:09.527 tst (EURUSD,H1) i = 5, c = 32
where is 6?
or what is it?
2020.11.08 11:28:09.527 tst (EURUSD,H1) i = 1, c = 2
2020.11.08 11:28:09.527 tst (EURUSD,H1) i = 2, c = 4
2020.11.08 11:28:09.527 tst (EURUSD,H1) i = 3, c = 8
2020.11.08 11:28:09.527 tst (EURUSD,H1) i = 4, c = 16
2020.11.08 11:28:09.527 tst (EURUSD,H1) i = 5, c = 32
where is 6?
or what is it?
yeah, i got it wrong.
2020.11.08 11:28:09.527 tst (EURUSD,H1) i = 1, c = 2
2020.11.08 11:28:09.527 tst (EURUSD,H1) i = 2, c = 4
2020.11.08 11:28:09.527 tst (EURUSD,H1) i = 3, c = 8
2020.11.08 11:28:09.527 tst (EURUSD,H1) i = 4, c = 16
2020.11.08 11:28:09.527 tst (EURUSD,H1) i = 5, c = 32
where is 6?
or what is needed?
Thank you, very helpful)