Tiki in real time - page 13

 
Roman:

Or maybe for real time, instead of

use

Why copy when you can immediately get the current price?
In theory, CopyTicks has in its guts extra parameter checks, thus increasing the length of code in the function body.
But SymbolInfoTick has no additional parameters, and in theory, the implementation of this function should contain less code.
Less code means faster execution.

The only bad thing is that the SymbolInfoTick function doesn't have detailed documentation similar to CopyTicks and it's not completely clear how it works.
Does it cache, or does it give back the raw data immediately.

Only the glass is immediately available, everything else is checked additionally.

No one will disclose detailed documentation - it's a secret behind the 7 seals ))))

 
Sergey Chalyshev:

Only the glass is handed over straight away, the rest is checked additionally.

No one will disclose detailed documentation - it's a secret behind seven seals ))))

SymbolInfoTick() in principle can't give back the stack, I think we meant BestBid, BestAsk.
Isn't MqlTick structure filled completely by BestBid, BestAsk?
What makes you think that other members of structure need additional checking?

struct MqlTick 
{ 
   datetime     time;          // Время последнего обновления цен 
   double       bid;           // Текущая цена Bid 
   double       ask;           // Текущая цена Ask 
   double       last;          // Текущая цена последней сделки (Last) 
   ulong        volume;        // Объем для текущей цены Last 
   long         time_msc;      // Время последнего обновления цен в миллисекундах 
   uint         flags;         // Флаги тиков 
   double       volume_real;   // Объем для текущей цены Last c повышенной точностью 
};

If you want to get the whole glass for all banks, you should use

bool  MarketBookGet( 
   string        symbol,     // символ 
   MqlBookInfo&  book[]      // ссылка на массив 
   );

Returns array of MqlBookInfo structures containing entries of the specified symbol.

 
Roman:

SymbolInfoTick() can not give the cup, maybe you mean BestBid, BestAsk.
Isn't MqlTick structure filled completely by BestBid, BestAsk ?
Why do you think the rest of structure members need additional checking?

And if you want to get the full tumblr for all gangs, you should use

Returns an array of MqlBookInfo structures, containing records of a stack of prices of a specified symbol.

I don't know what you mean.

OnBook and OnTick are different threads, if MQ synchronized them it's very bad.

Judging by the picture I gave above they are not fully synchronized.

The fxsaber test also inspires confidence:

The result is bad: in OnTick/OnBookEvent, the ticks received using different methods very often don't coincide inside one On-function. And you can't tell which method of getting the tick is relevant and which is not. Terrible vagueness.

So, who wants what:

- if you need better prices - OnBook,

- if you need a sliver of deals - CopyTick,

- and if you don't need anything - OnTick, it can skip ticks and delay information flow, because it works in one process in line with other On functions.


p.s. All that I wrote here concerns only exchange accounts, forexists don't care (no difference), forexists pass by.

fxsaber
fxsaber
  • www.mql5.com
Опубликовал пост TesterPortfolio - портфель ТС Опубликовал пост "Out-Of-Sample" - где расположить, справа или слева? Когда-то в паблике столкнулся с мнением, что OOS должен располагаться только справа. Т.е. расположение его слева от интервала Оптимизации - ошибка. Я с этим был категорически не согласен, т.к. не видел разницы. Теперь вижу...
 
Andrey Khatimlianskii:

For a moment it seemed that you have a desire to understand and it will help to tame your pride.
No, it just seemed that way.

The question is solved, and anybody can look through yours, fxsaber's, and my codes and draw conclusions.
With you I stop dialogue, nothing except loud shouting from you comes, and on reception of the information your brain does not work at all.

Good luck on the FORTS.

Andrey!

You are wrongly offended by my remarks about FOREX, they have nothing to do with you.

We have always had constructive dialogues, but if it offended you in any way, then

I apologize to you personally!

 
Sergey Chalyshev:

I don't know what you mean.

OnBook and OnTick are different threads, if MQ synchronised them it's too bad.


From my recent tests (after fixing a bug in the code),

it's very clear that OnTick() is triggered either earlier or at the same time as OnBookEvent(),

but in the printers OnTick() is always the first.

It seems that when a new batch of ticks arrives,

then function handling them first "pulls" OnTick() and then "sneaks" data

where it needs to go :)

 
Roman:

Or maybe for real time, instead of

use

Why copy when you can get the current price immediately?

What market are you interested in?

 
prostotrader:

From my recent tests (after fixing a bug in the code),

it is very clear that OnTick() is triggered either earlier or at the same time as OnBookEvent(),

but in the printers OnTick() is always the first.

It seems that when a new batch of ticks arrives,

then the function handling them first "pulls" OnTick() and then "sends" the data

where it needs to go :)

Yes, about the same.

Terminal is asynchronous single-threaded, it processes all events in turn.

For the purity of the experiment, who is faster OnBook or OnTick, we should run two terminals at one broker.

In one EA onlyOnBook withoutOnTick .

In the other one,onlyOnTick without OnBook.

And sum up the prices with local time in milliseconds into one file. Then the real difference will be seen.

Otherwise, without stock time, it is impossible to understand the difference.

 
Sergey Chalyshev:

Yeah, that's about the same thinking.

The terminal is asynchronous single-threaded, it handles all events in turn.

For the purity of the experiment, who is faster OnBook or OnTick, we should run two terminals at one broker.

In one EA onlyOnBook withoutOnTick .

In the other one,onlyOnTick without OnBook.

And sum up the prices with local time in milliseconds into one file. Then the real difference will be seen.

Otherwise, without stock time, you can't understand the difference.

No problem, I will try to run it on Monday (I have three terminals on real).

 
Sergey Chalyshev:

I don't know what you mean.

OnBook and OnTick are different threads, if MQ has synchronised them it's too bad.

Judging by the picture I gave above, they are not fully synchronized.

Also the fxsaber test inspires confidence:

So, who wants what:

- if you need better prices - OnBook,

- if you need a sliver of deals - CopyTick,

- and if you don't need anything - OnTick, it can skip ticks and delay information flow, because it works in one process in line with other On functions.


p.s. All that I wrote here concerns only exchange accounts, forex traders do not care (no difference), forex traders pass by.

I was referring toSymbolInfoTick, you wrote that " Only the cup is given immediately, everything else is checked additionally".
I gave you the structure of MqlTick to show you what it consists of, there is no cup, only best prices. And there are no additional checks.
I am therefore surprised by what you have written, perhaps incorrectly stated the idea.
The OnBook and OnTick are different sockets, because in any exchange protocols trades occur in one socket, and Level2 (market) in another.
This means that only the best bid ask last etc. are sent to the socket OnTick. Therefore the OnTick has its own handler for this socket.
For Level2 different socket and accordingly it has a different handler. In idea, they should not be synchronized forcibly on the terminal side.

All right, we use exactly what we want, the trades inSymbolInfoTick or CopyTick, glass in MarketBookGet.

 
prostotrader:

What market are you interested in?

I don't use dealing forex.
In the example you aregetting only one last element of the structure fromCopyTick, in fact, only the best prices.
So I thought, why copy data from one memory space to another,
, when there is
SymbolInfoTick that gives the best prices without copying anywhere. I might be wrong about how the functions work, that's just my guess.
Although it's possible that these two functions work the same way, the only difference is that
CopyTick can request a range of ticks.
And
it's unnecessaryto use loops to process ticks.