Features of the mql5 language, subtleties and tricks - page 73

 
Kirill Belousov:

At the closing price find a candle in an independent brokerage company on the history, for which you know the GMTOffset. The difference between the candlestick times will give the difference between the DTs. Add to the difference the GMT of a known one and get the GMT difference of an unknown one.

You never know the time of trade server. You only know the time of the last quote for the instrument.

The candlesticks are most likely hourly.

Well this is not a serious way to find, go to some other terminal.

What other variants are there?

 
Vitaly Muzichenko:

Well this is not a serious way to find, go to some other terminal.

what other options7

call the broker or look at the site

You can probably unpair the charts through the Web without going to another terminal.

P.S. What exactly is the problem, where you need the time of an unknown broker?

 
Kirill Belousov:

Call a broker or look on the website.

I need to find out on a program level)

 
Vitaly Muzichenko:

I need to find out on the program level)

And what exactly the problem, where you need time of unknown broker?

 
Kirill Belousov:

What is the actual problem where you need the time of an unknown broker?

Forum on trading, automated trading systems and trading strategies testing

How to use mql5?

Vitaly Muzichenko, 2018.03.25 21:34

But so candlesticks will show server time as well.

Suppose I now run the terminal from any dealer, there are no quotes, but there is the last recorded inthe market overview at 23:58, but with what shift in GMT it works - do not know.

Or am I already dumb, and it can be found out very simply?

P.S. Suppose I got lost in time and stopped distinguishing between day/night, days of the week, time.

How to find out that there are no quotes because it's a weekend, or for example on Thursday no quotes, because the server hangs in the dealing room?

I see such a solution, but I don't see how to implement it without having a trading server at hand:

if( TimeCurrent()<TimeServer()-60 ) return( "нет котировок уже 1 минуту" );

 
Vitaly Muzichenko:

Start a timer and check how we have it with the quotes.

If they haven't changed for a long time, then either the broker has hung up or it's Thursday or the weekend)

 
Kirill Belousov:

Start a timer and check how we have it with the quotes.

If there has not been a change for a long time, it means either BC is hung up or it's Thursday or weekend ))

The timer is started and we have TimeCurrent(). What to do next, what to compare? It is possible to write in Ontics time of last tick, and with it to compare.

Isn't there another solution?

PS.TimeServer() // time of trade server would be very helpful
 
Vitaly Muzichenko:

The timer is running, TimeCurrent() is available. But what next, with what to compare? We can write the time of the last tick in Ontika, and compare it with it.

Isn't there another solution?

PS.TimeServer() // time of trade server would be very helpful

TimeCurrent() inside OnTimer() shows the time of the last tick coming from all Market Watch instruments.

Inside OnTick() shows the time of the last quote for the current symbol.

You fix the fact of change in the Global Variables.

And at each call of OnTimer() you compare it.

If the next timer is started and time of coming of quotation has not changed - you start the counting of time of no quotation.

You draw conclusions and react.

Besides, you have quotation and trading sessions for each instrument. From there you can find out if it is a trading time or not.

P.S. As far as I understood you do not need the server time. You need to set the fact of the absence of quotes.

 
Kirill Belousov:

TimeCurrent() inside OnTimer() shows the arrival time of the last tick from all Market Watch instruments.

You fix the fact of change in the Global Variables.

And at each call of OnTimer() you compare it.

If the next timer is started and the time of coming of quotation has not changed - you start the countdown for the time of no quotation.

You draw conclusions and react.

Besides, you have quotation and trading sessions for each instrument. From there you can find out if it is a trading time or not.

P.S. As far as I understood you do not need the server time. You need to set the fact of absence of quotes.

It is very expensive in terms of productivity.

There are trading sessions, but everyone dances there on his own.


 
I haven't checked it.

Forum on trading, automated trading systems and testing trading strategies

Deals History inside OnTesterPass

Anthony Garot, 2018.03.29 02:34

I dug into this a little more today.

It appears that when using Local Network Farm agents a file cannot be opened in the OnTester() event.

I know OnTester() is firing because data set in OnTester() is passed back to OnTesterPass() from the agents via frames.

So my approach of dumping data to a file from OnTester() only works for Local Agents, not Local Network Farm Agents, and presumably not for MQL5 Cloud Network Agents.