Artyom Trishkin: OnInitDoEasy() is not intended to work inside it. This function is needed to properly initialise the library. Work in onTick
I inserted it into onTick() nothing changed:
//| Expert tick function|//+------------------------------------------------------------------+voidOnTick()
{
//--- NewTick event handling in the library
engine.OnTick(rates_data);
//--- If working in the testerif(MQLInfoInteger(MQL_TESTER))
{
engine.OnTimer(rates_data); // Timer operation
engine.EventsHandling(); // Working with events
}
//--- If the trailing flag is setif(trailing_on)
{
//TrailingPositions(); // Trailing Positions// TrailingOrders(); // Trailing pending orders
}
CArrayObj* list_positions=engine.GetListHistoryOrders();
// list_positions=CSelect::ByOrderProperty(list_positions,ORDER_PROP_SYMBOL,Symbol(),EQUAL);
list_positions=CSelect::ByOrderProperty(list_positions,ORDER_PROP_TIME_CLOSE,D'2020.12.10 10:00',MORE);
//--- Select positions with profit greater than zero
list_positions=CSelect::ByOrderProperty(list_positions,ORDER_PROP_PROFIT,0,MORE);
if(list_positions!=NULL)
{Print("OK1");
//--- Sort the list by profit //list_positions.Sort(SORT_BY_ORDER_PROFIT);
list_positions.Total();
Print(list_positions.Total());
//--- Obtain the index of the position with the highest profitint index=CSelect::FindOrderMax(list_positions,ORDER_PROP_PROFIT);
if(index>WRONG_VALUE)
{Print("index= ",index);
COrder* position=list_positions.At(index);
if(position!=NULL)
{
//--- Get the ticket of the position with the highest profit and close the position by the ticketPrint("OK");
Print(engine.GetListDeals());
}
}
}
}
In each EA in the examples there is a code block for selecting and closing positions with the highest profit. You can do it by analogy. I can't even look at it - from my mobile.
It's a pity, but there is no strong side of MT5 programming community as mutual improvement of code and creation of help for public works. Those who write help, for example, always improve their understanding of the code.
Maybe it is for the best! I think I will still read all the articles from the DoEasy cycle. I've reached article 34, I'll tell you that it's still a witty coboeuvre)). Pohodu reading think that it's bad that there is no diagram of construction, this software art, but I think maybe for the best that you need to think a little.
Conclusions from the articles are very much, especially for amateur programmers, which most traders novadais. Thank you! I hope there will be more.
Скальперские автоматические системы по праву считаются вершиной алгоритмического трейдинга, но при этом они же являются и самыми сложными для написания кода. В этой статье мы покажем, как с помощью встроенных средств отладки и визуального тестирования строить стратегии, основанные на анализе поступающих тиков. Для выработки правил входа и...
Shit, why does everyone keep asking for this certificate? There is a help for SB, so what? I use it only if I forget the specific name of a method, a little faster than opening the class description).
In SB in timeseries there is a method that changes the buffer size. Without it the work with time series is limited, and there is no word about it in the help, about default values too.
So why such a flawed help if there is a code.
In any case, to start serious use you should go through the code, starting with interfaces and further on.
So don't distract Artyom with the help, let him do what he can).
Shit, why does everyone keep asking for this certificate? There is a help for SB, so what? I use it only if I forget the specific name of a method, a little faster than opening the class description).
In SB in timeseries there is a method that changes the buffer size. Without it the work with time series is limited, and there is no word about it in the help, and about default values too.
So why such a flawed help, if there is a code.
In any case, to start serious use you should go through the code, starting with interfaces and further on.
So don't distract Artyom with the help, let him do what he can do)
The work is still large and it is necessary to have a certificate and registration on gitHub.
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.
In TestDoEasyPart56 in the void OnInitDoEasy() function at the very end of the function, I have inserted this code so that
get a collection of historical orders from the date D'2020.12.11 10:00' to the current one. And I got none of them
order was not given by this code.
In the place where I Print(list_positions.Total()); I get "0".
OnInitDoEasy() is not intended to work inside it. This function is needed to properly initialise the library. Work in onTick
I inserted it into onTick() nothing changed:
Inserted it into onTick() nothing changed:
What's stopping you from writing in and picking up this medal yourself?
I have no claim. Let you have it. You deserve it ;)
I have no claim. Let you have it. You deserve it ;)
Thank you. I don't want it. We'll leave it to others.
It's a pity, but there is no strong side of MT5 programming community as mutual improvement of code and creation of help for public works. Those who write help, for example, always improve their understanding of the code.
Maybe it is for the best! I think I will still read all the articles from the DoEasy cycle. I've reached article 34, I'll tell you that it's still a witty coboeuvre)). Pohodu reading think that it's bad that there is no diagram of construction, this software art, but I think maybe for the best that you need to think a little.
Conclusions from the articles are very much, especially for amateur programmers, which most traders novadais. Thank you! I hope there will be more.
Shit, why does everyone keep asking for this certificate? There is a help for SB, so what? I use it only if I forget the specific name of a method, a little faster than opening the class description).
In SB in timeseries there is a method that changes the buffer size. Without it the work with time series is limited, and there is no word about it in the help, about default values too.
So why such a flawed help if there is a code.
In any case, to start serious use you should go through the code, starting with interfaces and further on.
So don't distract Artyom with the help, let him do what he can).
Shit, why does everyone keep asking for this certificate? There is a help for SB, so what? I use it only if I forget the specific name of a method, a little faster than opening the class description).
In SB in timeseries there is a method that changes the buffer size. Without it the work with time series is limited, and there is no word about it in the help, and about default values too.
So why such a flawed help, if there is a code.
In any case, to start serious use you should go through the code, starting with interfaces and further on.
So don't distract Artyom with the help, let him do what he can do)
The work is still large and it is necessary to have a certificate and registration on gitHub.