You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Alternatively, to avoid concerns that Symbol() will eat up time, then let both handlers "feed" equally.
We can replace the Symbol() function with a predefined variable _Symbol
Symbol() has nothing to do with it. The time in the log is correct.
The delay is in the event queue or SymbolInfo functions.
That's what I'm talking about.
So, if you need the glass, work with OnBook. If not needed, work in OnTick (without queues and unnecessary calls).
What's left to figure out is the fastest way to get the actual tick history for both methods.
I think, if only last tick is needed, SymbolInfo is better. If we need history without gaps, then only CopyTicks.
Symbol() has nothing to do with it. The time in the log is correct.
The delay is in the event queue or SymbolInfo functions.
That's what I'm talking about.
I agree that Symbol can not chew a lot, but can make some contribution, and certainly for the purity of the test take timebefore any calls.
As for the queue - I'm curious about this point - how far OnBook can lag behind the same OnTick under ideal conditions. I.e. when only this Symbol is subscribed, the terminal is not busy with anything else, etc., and what causes it.
So far I can't agree that it's just about the queue, because if the handlers aren't doing anything, then the queue of 5-6 OnBooks shouldn't consume more than the operation of checking the Symbol.
We should remove all checks and see what fallsbetween OnTick and OnBook for the same tick.
ap: It became clear that the voracious Print does not allow to check cleanly, because the queue will be long because of the Print)
I have to put the time without the print in the array ulong, and then already once every 5 minutes to output everything to Prints, I'll later code it.
Wanted to put the code to test first
But I can't open the demo opener account for something. Time is probably not working, or there are some other problems?
Then code to dopilize to compare exactly from one event tick.
Wanted to put the code to test first
But I can't open the demo opener account for something. Time is probably out of order, or is there something else wrong with it?
Then code to dopilize to compare exactly from one event tick.
You have to open it on their website. They then send a code to the post office.
I think if only last tick is needed, SymbolInfo is better. If you need history without skips, then only CopyTicks.
The matter is that the Urgent Market (FORTS) even on "highly liquid" instruments is very weak,
It means that at the right price you can buya verylimited number of contracts, so we need not only the price,
The volume of contracts at this price is very important.
And SymbolInfo doesn't give the volume of this price.
Due to this, we need to useMarketBookGet() that provides both price and volume of the whole book.
You can useMarketBookGet() only in pair with MarketBookAdd, getting the changes of the market cup.
in OnBookEvent. You can add the market (MarketBookAdd) and useMarketBookGet() from OnTck(),
but in this case we miss some other changes of the market(pending orders not at the best price).
It's true, the market may play with this and build the market slip from incoming ticks, but is it really necessary?
Added by
And I don't agree that we can get ticks from history when OnTck() is triggered.
By remembering the last tick time, when OnTck() is triggered we can get ticks
in real time a new tick(s) came in - triggered OnTck() we read it immediately, i.e. it's not history.
It remains to find out the fastest way to get actual tick history for both methods.
My OnTick() is the same or slightly faster than OnBook (but OnBook has huge delays).
I was testing speed of functions(microseconds)
OnTick - имеется ввиду CopyTicks из OnTick
The fastest isSymbolInfoTick, but this function does not put volume in the tick!
See for help.
tick [out] Ссылка на структуру типа MqlTick, в которую будут помещены текущие цены и время последнего обновления цен.
I.e. only time and price, but no volume :(
For Exchange traded instruments (especially FORTS) it is not just the price that matters,
but also the volume of contracts at that price!
Tried taking the glass by OnTick() - huge delays clearly visible "by eye"!
You've got it all messed up.
I wrote earlier that trades and level2 are different data subscriptions, so they are different event handlers.
That's why trades should be called from OnTick, and volume gangs from OnBook.
You're trying to call trades from OnBook events and gangs from OnTick. Thinking that OnBook will be faster for trades.
It won't be faster, I think it's a delusion to compare two event handlers, each dedicated to its own data stream.
I understand that it's all experiments, but without understanding the logic that there are two data streams (trades and Level2), you will endlessly confuse these OnTick and OnBook handlers.