Services , new functionality in the MT5 architech, the funeral of MT4 is just around the corner. - page 5

 
Petros Shatakhtsyan:


Interestingly, yesterday I wanted to use the features of MarketBookAdd and OnBookEvent to make a multi-currency EA.

But for some reason MarketBookAdd on the tester doesn't work. It gives an error 4901-Theprice stackcannot be added.

But it only works in realtime...
 
Alexey Kozitsyn:
It only works in real time.


And I don't need to get a price stack, but to have such simple features:

1. clear the contents of Market Watch.

2. Add the desired characters there (this is available)

3. Use function or event to receive all ticks that are displayed in Market Watch from each symbol, or make OptiScope together with Multi-tick function.

 
Petros Shatakhtsyan:


And I don't need to get the stack of prices, but to have such simple possibilities:

1. clear the contents of Market Watch.

2. Add the desired characters there (this is available)

3. Use function or event to receive all ticks that are displayed in Market Watch from each symbol, or make Optiсk together with MultiTick function.

It's not quite clear why you decided to go through the Depth of Market if you want to work with Market Watch and ticks?
 
Alexey Kozitsyn:
It is not quite clear why you decided to go through the price stack if you want to work with market overview and ticks?

And where are you going to get the data from all the quotes that are visible or added to the market overview.
 
Petros Shatakhtsyan:

And where are you going to get the data from all the quotes that are visible or added to the market overview.
Um... OnTimer(), OnTick(), OnCalculate()...
 
Petros Shatakhtsyan:

And where are you going to get the data from all the quotes that are visible or added to the market overview.

MqlTick tickEUR;
MqlTick tickGBP;
MqlTick tickEURGBP;

GetSymbolByName(string symbol)   {    string symbol_name="";   // Имя символа на сервере //--- Если передали пустую строку, вернем пустую строку    if(symbol=="")       return(""); //--- Пройтись по списку всех символов на сервере    for(int s=0; s<SymbolsTotal(false); s++)      {       //--- Получим имя символа       symbol_name=SymbolName(s,false);       //--- Если искомый символ есть на сервере       if(symbol==symbol_name)         {          //--- Выберем его в окне "Обзор рынка"          SymbolSelect(symbol,true);          //--- Вернем имя символа          return(symbol);         }      } //--- Если искомого символа нет, вернем пустую строку    Print("Символ "+symbol+" не найден на сервере!");    return("");   } int OnInit()   { //---    GetSymbolByName("EURUSD"+SymbolSuffix);    GetSymbolByName("GBPUSD"+SymbolSuffix);    GetSymbolByName("EURGBP"+SymbolSuffix); }

void OnTimer() // или OnTick   {       if(!SymbolInfoTick("EURUSD"+SymbolSuffix,tickEUR)) {Print("EURUSD price has not been received"); return;}    if(!SymbolInfoTick("GBPUSD"+SymbolSuffix,tickGBP)) {Print("GBPUSD price has not been received"); return;}    if(!SymbolInfoTick("EURGBP"+SymbolSuffix,tickEURGBP)) {Print("EURGBP price has not been received"); return;} if(tickEUR.ask!=0 && tickEUR.bid!=0) {} // ну и все в этом духе }

 
Maxim Dmitrievsky:

How can you be so ungodly obtuse for so many posts?
You can recognise people who offer something useful by the arrows sticking out of their backs. Anything new is always met with a hostile response. Especially those who make money selling arbitrage advisors copied from hrenfx since their direct use in the market is impossible because of the opposition of this brokerage company.
 
Maxim Dmitrievsky:


It would be inefficient if EA handles every tick, even if milliseconds are used in timer.

Need an easier way to get all ticks directly from the market overview.

A through OpTisk is not possible, because it only works when the next tick comes where the EA is standing.

 
Petros Shatakhtsyan:

You will still have to do this via a timer. The timer simply needs an algorithm so that it doesn't make a request if the last tick is the same as the previous tick.

BookEvent will not help you here.

 
Alexey Kozitsyn:

You will still have to do this via a timer. The timer simply needs an algorithm so that it doesn't make a request if the last tick is the same as the previous tick.

BookEvent will not help you here.


Yes, but you should also take into account that there's only one timer here, not so, so VC++, and if you have a lot of timer checks, you just might lose many ticks and everything will turn to mush.