Maxim Kuznetsov: 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.
Перед тем как приступить к изучению торговых функций платформы, необходимо создать четкое представление об основных терминах: ордер, сделка и позиция. — это распоряжение брокерской компании купить или продать финансовый инструмент. Различают два основных типа ордеров: рыночный и отложенный. Помимо них существуют специальные ордера Тейк Профит...
Can I add a while loop to this function, so that I can go through the external variable one by one in the selected orders? But how can I then pull out the "return value" and use it?
Well... 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...
Hello!!! I am making an EA based on an M5 timeframe.... but the signals are triggered (for example at 9:33, 12:11) etc..... can you tell me how to open an order on a new candle if the signal was on the current one?
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.
#property copyright"Copyright 2019, MetaQuotes Software Corp."#property link"https://www.mql5.com"#property version"1.00"#property strictexterndouble Lot = 0.01;
externdouble Lot2 = 0.02;
externdouble Lot3 = 0.05;
externdouble Lot3 = 0.07;
//----------- И так далее-------//
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
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
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
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