Multicurrency - multitime advisor - page 7

 
Fast528:

I do not understand what prevents you from getting indicator data on the zero bar and what does it have to do with a new bar?

Because the signal has to wait constantly, during any tick, and not a new bar + in addition to that on all periods and several currency pairs

 
Tango_X:

Because you have to wait for the signal all the time, during every tick and not during a new bar, and on all time frames and several currency pairs.

You get the signal on a timer in 1 second. You save it all in the [symbol][period] array. Then constantly monitor the new signal in the timer, and if there is a signal, then compare its value with the previously saved value - if the value does not match, the signal is new, and you can trade, if the value matches, it is an old signal - skip it

 
Tango_X:

Because the signal has to wait constantly, during any tick, not a new bar + to that also on all periods and several currency pairs

Therefore:

  1. Transfer the code of the indicator to the Expert Advisor.
  2. Start the signal search mechanism from the timer (at least every 16 ms).
As long as you depend on the indicator, there will be a probability of missing the signal. If the code is in the EA, you will not miss it.

 
Реter Konow:

Therefore:

  1. Transfer the indicator code to the EA.
  2. Run the signal search mechanism from the timer (at least every 16ms).
As long as you are dependent on the indicator, there will be a chance of missing the signal. If the code is in the Expert Advisor, you will not miss it.

How then to call the indicator from the EA in the timer with different periods and pairs - can you give a simple example?

 
Tango_X:

How do you then call the indicator from the EA in the timer with different periods and pairs - can you give a simple example?

Move the code completely and get rid of the indicator. If possible.

If you need the indicator for visual support of trading, run it separately.

You only need the calculation part of the indicator.


One last thing:

If you request the indicator for a moment after the signal has passed - then you have missed it and will not even recognise it.

If you have the indicator code in your EA, you will be able to compare the before and after values and determine that the signal was momentary. That is, you will be able to react to the signal that was missed, because you will know about the fact of missing by comparing the values written in the array.

This can be much more difficult and less efficient when communicating through an indicator.

 
Thank you all for the tips! I will try each and every one of them and I think I will find something for myself
 
The Expert Advisor can miss tick signals, this is done specially by the developers. That is why you should then work on ticks already in the history, there will be delays, but the signal will not be missed. But I think OHLC of a minute bar is enough to recover almost any missed signal.
 
Aleksey Vyazmikin:
The Expert Advisor may skip tick signals, it was specifically designed by the developers. Therefore, you should work with already existing ticks in the history. There will be delays, but the signal will not be missed. But I think OHLC of a minute bar is enough to recover almost any missed signal.

How do you skip ticks??? What developers do this on purpose? What are you talking about?

 
ElenaVVT:

How do you skip ticks??? What developers do this on purpose? What do you mean?

Renat wrote earlier that the Expert Advisor performs calculations at appearance of a new tick and waits until a new tick appears. If there were more ticks during the data processing, they are not put in the queue, but are simply skipped, otherwise the terminal would freeze.

Events of the client terminal

NewTick

The NewTickevent is generated when new quotes come in and is handled by the OnTick() function in attached Expert Advisors. If the OnTick function running on the previous quote is executed when a new one arrives, the incoming quote will be ignored by the Expert Advisor, because the corresponding event is not placed in the EA event queue.

All new quotes that come during the execution of the program are ignored by the program until the next execution of the OnTick() function is finished. After that, the function is started only when a new quote comes.

The NewTick event is generated regardless of whether auto-trading is enabled or disabled (the "Enable/Disable Auto-Trading" button). The prohibition of automatic trading only prohibits sending of trade requests from the Expert Advisor, the Expert Advisor's operation is not stopped.

Prohibition of automatic trading by pressing the specified button does not interrupt current execution of the OnTick() function.

 
Aleksey Vyazmikin:

Renat wrote earlier that when a new tick appears, the Expert Advisor performs calculations and waits for a new tick. If there were more ticks during the data processing period, they are not put in the queue, but are simply skipped, otherwise the terminal would just freeze.

Client terminal events

NewTick

The NewTickevent is generated when new quotes come in and is handled by the OnTick() function in attached Expert Advisors. If the OnTick function running on the previous quote is executed when a new one arrives, the incoming quote will be ignored by the Expert Advisor, because the corresponding event is not placed in the EA event queue.

All new quotes that come during the execution of the program are ignored by the program until the next execution of the OnTick() function is finished. After that, the function is started only when a new quote comes.

The NewTick event is generated regardless of whether automatic trading is enabled or disabled (the "Enable/Disable Auto-Trading" button). The prohibition of automatic trading only prohibits sending of trade requests from the Expert Advisor, the Expert Advisor's operation is not stopped.

Prohibition of automatic trading by pressing the specified button does not interrupt execution of the OnTick() function.

This has always been the case, if OnTick has not returned, the incoming ticks are skipped. The EA tracks them only in tick waiting mode. But you seem to be talking about deliberately missing ticks? It's a bug for me.