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
Yedelkin:
Well, because the manual says that "the NewTick event is generated when a new tick is received on the symbol to which the EA is attached to the chart", the fact of receipt of new ticks should cause generation ofNewTick events.
Judging by the question, you think that no NewTick events are generated when OnTick() is disabled? But I have not found such information in the reference manual.
That's how I see it - if there is no handler, the event is not queued. This is logical, and I don't see the point in writing about it in the help.
The Expert Advisor generates a huge number of events (trade events, from a chart, etc.), it is not necessary to handle them all.
If all events (including unhandled ones) were queued, some EAs would not work - their event would not get to the queue (for example, when working only on the timer once a day).
This is how I see it - if there is no handler, the event will not be queued. This is logical and I don't see the point in writing about it in the help.
The Expert Advisor generates a huge number of events (trade events, chart events, etc.), it is not necessary to handle them all.
If all events (including unhandled ones) were placed in the same queue, some Expert Advisors would not be able to work - their event would not get to the queue (for example, when only the timer worked once a day).
In my opinion, the two types of events (NewTick and Timer) must be processed separately from the others.
Most likely, we should also separate trade events (Trade) and events for the processing of the Depth of Market (BookEvent).
Lizar, Interesting,
I was wrong about the conclusions of the tester operation. Apparently, I mistook the demo logs for the tester logs. The design of
doesn't work for me yet. It suggests that the user eventCHARTEVENT_CUSTOM from the indicators on the alien symbols is either not received or not processed.
I believe this is the case - if there is no handler, the event is not queued.
It would be nice if this version was confirmed. But for the tester, ticks are generated anyway. Even when they are absolutely unnecessary.
This is logical and I don't see any reason to write about it in the help.
Perhaps it is logical, but not for everyone. Developers have repeatedly rebuked users for overthinking. Therefore in my conclusions I try to base them only on the information available at the moment. And at present, as stated earlier, the manual says that "the NewTick event is generated when anew tick is received for the symbol, to the chart of which the Expert Advisor is attached". I did not find any exception clause, so I came to the conclusion that the fact of new ticks receipt must cause the generation ofNewTick events.
The Expert Advisor generates a huge number of events (trade events, from the chart, etc.), it is not necessary to handle them all.
But for the tester, ticks are generated anyway. Even when they are completely unnecessary.
How does it mean? And it will check for the triggering of orders (pending, SL and TP) at what prices?
In the tester, we need ticks for all symbols, on which the EA trades. Of course, the larger the number of instruments and the higher the quality of modeling, the slower the operation will be.
Yedelkin:
And at the moment, as stated above, the manual says that "the NewTick event is generatedwhen a new tick arrives for the symbol to whose chart the Expert Advisor is attached". I did not find any exception clause to this rule and therefore I came to the conclusion that the arrival of new ticks must cause the generation ofNewTick events.
Yes, but following this logic, all other events should be queued up the same way. That would be too much.
How so? And it will check the triggering of orders (pending, SL and TP) at what prices?
Well, I repeat: the EA does not work with the symbol attached to it at all. And it does not need to track SL and TP of this symbol. I.e., the EA does not need ticks for this symbol. The EA is attached to the symbol only when necessary, because it needs to be attached at least somewhere to be triggered.
Yes, but following this logic, all the other events must be queued in exactly the same way. It would be too much.
Following this logic, all exceptions to the rules for generating ticks and/or queueing events should be listed in the reference book. So far, I've found only one exception, - for case, when (1) there is OnTick() function, (2) this function handles previous NewTick event. This exception does not suit my case.
Yedelkin:
Following this logic, all exceptions to the rules for generating ticks and/or queueing events should be listed in the handbook. So far, I've found only one exception - for the case when (1) there is a function OnTick(), (2) this function handles the previous NewTick event. This exception does not fit to my case.
It would be logical to suppose that if OnTick() is absent, there is no processing of ticks for this chart (by this chart's symbol).
Whether the events are queued or not, and in what queue it is another question. The main thing is that the ticks are not processed by the chart (Expert Advisor on it)!
If we take into account that the EA processes ticks from other charts, we will need to consider processing of EXTERNAL ticks.
Thus, in my opinion, in my Expert Advisor should be created its own processing of ticks, in which as input parameters to pass: symbol, time, price (the custom event theoretically allows to do all this).
I think it is the work with the custom event potk that needs to be studied and optimized in detail.
If to take into account that EA processes ticks from other charts, then it is necessary to work with processing of EXTERNAL ticks.
Thus, in my opinion, in Expert Advisor should be created its own processing of ticks, in which as input parameters to pass: symbol, time, price (the custom event theoretically allows to do all this).
In my opinion, just the work with custom event potk should be studied and optimized in details.
You're right, that's exactly the way I went, by handling only external ticks. No questions here yet.
It would be logical to suppose that if OnTick() is absent, the processing of ticks for this chart (according to the symbol of this chart) is not performed.
Whether the events are queued or not, and in what queue it is another question. The main thing is that the ticks are not processed by the chart (Expert Advisor on it)!
That's right, that's exactly the way I went about it - by handling external ticks exclusively. There are no questions here yet.
That's what I'm fixated on, to make sure that the general queue in my case is not clogged with events from "internal" ticks. I could be wrong, of course, but "disable" should be a lot easier than "ensure timely generation of ticks, proper event queuing, synchronization with the server, etc." ...Let the "default" for most people stay as it is at the moment, but for extreme people like me, add a disable/switch function. With cautions in the handbook if there might be any side effects.As for easier, it is a debatable question, and the variant you propose is no less debatable (in my opinion).
The whole question concerning ticks, and all events in general, is what happens to events if there is no handler in Expert Advisor.
My second question in this regard would be - are all events handled in the same queue or for certain events (OnTimer, OnTick and OnTrade) have their own queues?
Easier is debatable, and the option you propose is no less debatable (in my opinion).
I agree; it's hard to judge what you don't know about. It only remains to express wishes :) About mootness of my version I can say that the main thing here is the idea of "I don't need tics!"; how it will be implemented is up to developers.
The whole question about ticks, and all events in general, is what happens to events if there is no handler in Expert Advisor.
Exactly right. There is only one solution for me - to cut off ends (introduce switch function), and it's guaranteed not to bother with the question :) But we should also remember about the tester that wastes time creating (generating?) ticks that are unnecessary in principle. Only because the tester is forced to be attached to one of the characters.
The second question that I have in this regard is the following - are all events handled in one queue or there are separate queues for certain events (OnTimer, OnTick and OnTrade)?
Well, it is explicitly stated from the handbook that "all occurring events" are put into one common queue and processed one after the other in the order they are received. The only exception is specified for NewTick. You've somehow proved that OnTimer event isn't always handled, but it can also be deleted as a result of common queue overflow. I haven't seen any mention of separate queues for each event at all.