I've seen a bar-counting function somewhere, but I can't find it now. I need some number of bars to pass between opening a position and closing it (with or without condition). Please, send me the link if you know it. Thanks
I've seen a bar-counting function somewhere, but I can't find it now. I need some number of bars to pass between opening a position and closing it (with or without condition). If you know this, please send me the link. Thanks
static datetime time_close = время_открытия + (через_сколько_баров_закрывать * Period()); // расчитываем время когда закрывать.
if(TimeCurrent()>=time_close)Func_Закрыть(); // Проверяем не наступило ли время закрыть позицию.
The second variant: If only 3 orders are provided for, we can declare, for example, int tick_buy_1, tick_buy_2, tick_buy_3 at the level of global variables and record the tickets in these variables when opening the order. Then we can select the order by ticket, check its type, whether the order is closed or not, and only then, without the loop.
What optimisable parameter should be chosen to get the minimum number of uninterrupted losing trades ? In restrictions I myself specify the desired amount, but if you set the "Balance", then it will be more profit-oriented. If I'm using Custom, what should I add in OnTester ? I found an article on custom optimizing criteria in MQL5 but it was not of much help.
vadimvborisov: It's not working. lacking qualifications....
It goes something like this.
// это уровень глобальных переменных.
int gTicket_1, gTicket_2, gTicket_3;
intOnInit()
{
return(INIT_SUCCEEDED);
}
voidOnTick()
{
// При каком-то условии
gTicket_1 = OrderSend(соответствующие параметры);
gTicket_2 = OrderSend(соответствующие параметры);
gTicket_3 = OrderSend(соответствующие параметры);
// При каком-то условии, проверив что ордера не закрыты, не удалены и не модифицировались до тогоbool Mod = OrderModify(gTicket_1, и остальные параметры);
Mod = OrderModify(gTicket_2, и остальные параметры);
Mod = OrderModify(gTicket_3, и остальные параметры);
}
Can you give me a hint here's the thing.... why the formula only works up to a certain limit.
if (N!=0) Sortino=pow ((ProfitFactor-LastPF)-((Sortino+(ProfitFactor-LastPF))/N),2);
It works like this, but as soon as I add an accumulation, it stops counting at once.... And the main thing is that it does not give out any errors.....
But it stops working like this...
if (N!=0) Sortino=Sortino+(pow ((ProfitFactor-LastPF)-((Sortino+(ProfitFactor-LastPF))/N),2));
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.
Hello!
I've seen a bar-counting function somewhere, but I can't find it now. I need some number of bars to pass between opening a position and closing it (with or without condition). Please, send me the link if you know it. Thanks
Hello!
I've seen a bar-counting function somewhere, but I can't find it now. I need some number of bars to pass between opening a position and closing it (with or without condition). If you know this, please send me the link. Thanks
The second variant: If only 3 orders are provided for, we can declare, for example, int tick_buy_1, tick_buy_2, tick_buy_3 at the level of global variables and record the tickets in these variables when opening the order. Then we can select the order by ticket, check its type, whether the order is closed or not, and only then, without the loop.
Hello all !
What optimisable parameter should be chosen to get the minimum number of uninterrupted losing trades ? In restrictions I myself specify the desired amount, but if you set the "Balance", then it will be more profit-oriented. If I'm using Custom, what should I add in OnTester ? I found an article on custom optimizing criteria in MQL5 but it was not of much help.
It doesn't work. not enough qualifications....
And you can also mark orders in the description - and then use the description to find them ....
Good idea. It's the 'comment' parameter, if I'm not mistaken. I'll give it a try.
It's not working. lacking qualifications....
It goes something like this.
Hi all....
Can you give me a hint here's the thing.... why the formula only works up to a certain limit.
It works like this, but as soon as I add an accumulation, it stops counting at once.... And the main thing is that it does not give out any errors.....
But it stops working like this...