MakarFX, thanks! Now there is no extra non-signal first order, but now for some reason the first signal order (normal) is entering 2 candles earlier))) I attached a screenshot of the tester to my message, but even in spite of this first order - the most important thing is done, thank you very much again) With magicians got it, then I will make an external variable and when I will attach the explorer to a particular currency pair chart, I will change the number for each pair individually.
I will look at the opening.
It is not necessary to change the magik, if the symbol is controlled.
I've already forgotten... and in the beginning I did so (it's good that I locked it), but the condition method seemed unreliable, I wanted something more obvious to indicate a changed order.
Well, you still need to check the conditions on every new tick, if it didn't work on the previous tick - it will change on the new tick.
I'd already forgotten... and I did so in the beginning (it's a good thing I've committed), but the way of the condition seemed unreliable, I wanted something more obvious to indicate a changed order.
EVGENII SHELIPOV deposit currency, the whole order grid is closed
Please help me to change the code so that there would be points instead of Profit. Thank you.
//+----------------------------------------------------------------------------+//| Автор : Ким Игорь В. aka KimIV, http://www.kimiv.ru |//+----------------------------------------------------------------------------+//| Версия : 19.02.2008 |//| Описание : Возвращает суммарный профит открытых позиций в пунктах |//+----------------------------------------------------------------------------+//| Параметры: |//| sy - наименование инструмента ("" - любой символ, |//| NULL - текущий символ) |//| op - операция (-1 - любая позиция) |//| mn - MagicNumber (-1 - любой магик) |//+----------------------------------------------------------------------------+int GetProfitOpenPosInPoint(string sy="", int op=-1, int mn=-1) {
double p;
int i, k=OrdersTotal(), pr=0;
if (sy=="0") sy=Symbol();
for (i=0; i<k; i++) {
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
if ((OrderSymbol()==sy || sy=="") && (op<0 || OrderType()==op)) {
if (mn<0 || OrderMagicNumber()==mn) {
p=MarketInfo(OrderSymbol(), MODE_POINT);
if (p==0) if (StringFind(OrderSymbol(), "JPY")<0) p=0.0001; else p=0.01;
if (OrderType()==OP_BUY) {
pr+=(MarketInfo(OrderSymbol(), MODE_BID)-OrderOpenPrice())/p;
}
if (OrderType()==OP_SELL) {
pr+=(OrderOpenPrice()-MarketInfo(OrderSymbol(), MODE_ASK))/p;
}
}
}
}
}
return(pr);
}
MakarFX, thanks! Now there is no extra non-signal first order, but now for some reason the first signal order (normal) is entering 2 candles earlier))) I attached a screenshot from the tester to my message, but even in spite of this first order - the most important thing is done, thank you very much again) With magicians got it, then I will make an external variable and when I attach the espert to a particular currency pair chart, I will change the number for each pair individually.
What period was tested and what was the number of confirmations?
MakarFX #: What period did you test and what was the number of confirmations?
MakarFX, on that screenshot, which I attached, tested on EUR / USD - M 30 - all ticks - 01.08.21 to 03.09.21 - 26 orders were ( but I changed the constant from 4 to 8, I decided to look at a larger number of candles)
If we return the constant to 4 candlesticks, then for the same period - then 35 orders, but the first order also comes in 2 orders earlier
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.
MakarFX, thanks! Now there is no extra non-signal first order, but now for some reason the first signal order (normal) is entering 2 candles earlier))) I attached a screenshot of the tester to my message, but even in spite of this first order - the most important thing is done, thank you very much again) With magicians got it, then I will make an external variable and when I will attach the explorer to a particular currency pair chart, I will change the number for each pair individually.
I will look at the opening.
It is not necessary to change the magik, if the symbol is controlled.
I've already forgotten... and in the beginning I did so (it's good that I locked it), but the condition method seemed unreliable, I wanted something more obvious to indicate a changed order.
Well, you still need to check the conditions on every new tick, if it didn't work on the previous tick - it will change on the new tick.
And the error processing should be done.
I'd already forgotten... and I did so in the beginning (it's a good thing I've committed), but the way of the condition seemed unreliable, I wanted something more obvious to indicate a changed order.
Please help me to change the code so that there would be points instead of Profit. Thank you.
MakarFX, thanks! Now there is no extra non-signal first order, but now for some reason the first signal order (normal) is entering 2 candles earlier))) I attached a screenshot from the tester to my message, but even in spite of this first order - the most important thing is done, thank you very much again) With magicians got it, then I will make an external variable and when I attach the espert to a particular currency pair chart, I will change the number for each pair individually.
Makar as far as I understand it should be tried instead of the CalculiteProfit() function
Makar as far as I understand it should be tried instead of the CalculiteProfit() function
yes
and change it
What period did you test and what was the number of confirmations?
MakarFX, on that screenshot, which I attached, tested on EUR / USD - M 30 - all ticks - 01.08.21 to 03.09.21 - 26 orders were ( but I changed the constant from 4 to 8, I decided to look at a larger number of candles)
If we return the constant to 4 candlesticks, then for the same period - then 35 orders, but the first order also comes in 2 orders earlier
yes
and you change it.
Makar, can you tell me if there is only a min and max order?
Makar, can you tell me if there is only a min and max order?