Libraries: Calendar - page 3

 
fxsaber:

No custom object can check itself without a corresponding call. I.e. it must be written by the user in his code. If he has written it, then he does the processing himself.

The change_id mechanism is very simple: you run the Refresh method. After that you get the data, what and where was updated in the list of events you have created.

Your implementation is almost very similar to Observer, just you use all-in-one.

The only key difference I see is that now you have to check all events separately outside the Calendar class after Refresh, depending on the Calendar class.

If you unify the exchange format (in the example, the simplest CArrayObj) and stuff filtering inside the library to get a list of only current events.

MyClass.Subscribe(&Calendar);
OnTimer()
{
        Calendar.Refresh();
        CArrayObj *ListEvent= new CArrayObj();
        Calendar.GetNewEvent(ListEvent) ;
        if(ListEvent.Total()>0)
                MyClass.CheckNewEvent(ListEvent); // 
}

and in general it is already quite a working tool for working with news.

 
Aleksey Mavrin:

The only key difference I see is that now it is necessary to write the check of all events separately outside the Calendar class after Refresh, while depending on the Calendar class.

At the output you will get an object with only refreshed events. You won't need to search for the updated ones.

 
fxsaber:

On the output you will get an object with only updated events. You will not need to search for updated events.

I see, I just didn't see the Refresh method there.

then in general it is simple and concise, about refreshing Revised at any time - catching that is also solved I understand?

 
Aleksey Mavrin:

I see, I just didn't see a Refresh method in there.

It's not implemented yet. I'll do it when I'm free.

then in general it is simple and concise, about refreshing Revised at any time - catching that is also solved I understand?

Catching any changes should be, according to the Documentation.

 
Such a lag in the arrival of news.
2020.12.23 17:00 USD 2 Индекс ожиданий потребителей от Мичиганского университета(michigan-consumer-expectations), Соединенные Штаты(US) | 74.6 | 74.7 | 74.7 | , time elapse +00:00:23
2020.12.23 17:00 USD 1 Индекс текущих настроений потребителей от Мичиганского университета(michigan-current-conditions), Соединенные Штаты(US) | 90 | 91.8 | 91.8 | , time elapse +00:00:23
2020.12.23 17:00 USD 3 Продажи нового жилья(new-home-sales), Соединенные Штаты(US) | 0.841 M | 0.922 M | 0.999 M | 0.945 M, time elapse +00:00:23
2020.12.23 17:00 USD 2 Продажи нового жилья м/м(new-home-sales-mm), Соединенные Штаты(US) | -11.0% | 1.0% | -0.3% | -2.1%, time elapse +00:00:23
2020.12.23 17:00 USD 1 Индекс инфляционных ожиданий от Мичиганского университета(michigan-inflation-expectations), Соединенные Штаты(US) | 2.5% | 2.3% | 2.3% | , time elapse +00:00:23
2020.12.23 17:00 USD 1 Индекс инфляционных ожиданий на 5 лет вперед от Мичиганского университета(michigan-5-year-inflation-expectations), Соединенные Штаты(US) | 2.5% | 2.5% | 2.5% | , time elapse +00:00:23
2020.12.23 17:30 USD 1 Изменение импорта сырой нефти от EIA(eia-crude-oil-imports-change), Соединенные Штаты(US) | -0.332 M | -0.267 M | -1.848 M | , time elapse -00:00:15
2020.12.23 17:30 USD 1 Изменение производства бензина от EIA(eia-gasoline-production-change), Соединенные Штаты(US) | 0.307 M | 0.001 M | 0.182 M | , time elapse -00:01:55
2020.12.23 17:30 USD 1 Изменение запасов дистиллятов от EIA(eia-distillates-stocks-change), Соединенные Штаты(US) | -2.325 M | 2.444 M | 0.167 M | , time elapse -00:01:55
2020.12.23 17:30 USD 1 Изменение запасов бензина от EIA(eia-gasoline-stocks-change), Соединенные Штаты(US) | -1.125 M | -0.132 M | 1.020 M | , time elapse -00:01:55
2020.12.23 17:30 USD 1 Изменение объема ежедневной поставки сырой нефти на переработку от EIA(eia-refinery-crude-oil-daily-inputs-change), Соединенные Штаты(US) | -0.169 M |  | -0.253 M | , time elapse -00:01:55
2020.12.23 17:30 USD 1 Изменение коэффициента использования мощностей нефтеперерабатывающей отрасли от EIA(eia-refinery-utilization-rate-change), Соединенные Штаты(US) | -1.1% |  | -0.8% | , time elapse -00:01:55
2020.12.23 17:30 USD 3 Изменение запасов сырой нефти от EIA(eia-crude-oil-stocks-change), Соединенные Штаты(US) | -0.562 M | 6.038 M | -3.135 M | , time elapse -00:01:55
2020.12.23 17:30 USD 2 Изменение запасов сырой нефти в Кушинге от EIA(eia-cushing-crude-oil-stocks-change), Соединенные Штаты(US) | -0.026 M | -0.653 M | 0.198 M | , time elapse -00:01:55
2020.12.23 17:30 USD 1 Изменение запасов мазута от EIA(eia-heating-oil-stocks-change), Соединенные Штаты(US) | -0.031 M | 0.084 M | -0.706 M | , time elapse -00:01:55
2020.12.23 18:40 USD 1 Уровень инфляции по средним усеченным расходам на личное потребление от ФРБ Далласа(dallas-fed-trimmed-mean-pce-inflation-rate), Соединенные Штаты(US) | 0.5% | 1.6% | 0.6% | 1.0%, time elapse -00:01:55
2020.12.23 19:00 USD 1 Изменение запасов природного газа от EIA(eia-natural-gas-storage-change), Соединенные Штаты(US) | -152 B | -81 B | -122 B | , time elapse -00:00:15
2020.12.23 19:30 BRL 1 Валютные потоки(foreign-exchange-flows), Бразилия(BR) | $-4.094 B | $-1.096 B | $0.128 B | , time elapse -00:01:55
2020.12.23 20:00 USD 2 Число нефтяных буровых установок от Baker Hughes(baker-hughes-us-oil-rig-count), Соединенные Штаты(US) | 264 |  | 263 | , time elapse -00:00:15
2020.12.23 20:00 USD 2 Общее число буровых установок в США от Baker Hughes(baker-hughes-us-total-rig-count), Соединенные Штаты(US) | 348 |  | 346 | , time elapse -00:01:55

A news item can arrive 23 seconds ahead of its time or 115 seconds behind.

This 115 seconds seems to be artificial, as the news on BRL and USD at different times has the same lag.


ZY There are few stats. But it seems that in the Tester we can confidently count on a two-minute lag.

 
The calendar is updated even on a weekend.
2020.12.25 13:34:42.018 2020.12.25 13:30 INR 1 Валютные резервы(foreign-exchange-reserves), Индия(IN) | $581.131 B | $581.072 B | $578.568 B | , time elapse -00:04:42
2020.12.25 13:34:42.018 2021.01.0113:30 INR 1 Валютные резервы(foreign-exchange-reserves), Индия(IN) |  | $582.352 B | $581.131 B | , time elapse +6 d 23:55:18
 

Hi fxsaber.

Its possible to use this library with a reverse logic? Instead of backtest based on news time, make the Calendar Example.mq5 to allow orders only at days without high impact events.

Example: Buy USDJPY when RSI is below 30, only if there are no high impact news on the current day for the currencies USD and JPY.

If so, can you please modify it and attach the file here? That's all I need, let me know if you got it. Thank you.

 
Drake:

Hi fxsaber.

Its possible to use this library with a reverse logic? Instead of backtest based on news time, make the Calendar Example.mq5 to allow orders only at days without high impact events.

Example: Buy USDJPY when RSI is below 30, only if there are no high impact news on the current day for the currencies USD and JPY.

If so, can you please modify it and attach the file here? That's all I need, let me know if you got it. Thank you.

You can do different logic. But I don't do it. Contact a specialist.

 
sabre :

Você pode fazer uma lógica diferente. Mas eu não faço isso. Entre em contato com um especialista.

The entry condition doesn't matter..... could you at least post a snippet of code showing how to identify if the current day has no high impact news? Thanks anyhow.
 
Drake:
The entry condition doesn't matter.... could you at least post a snippet of code showing how to identify if the current day has no high impact news? Thanks anyhow.

This is not done. Contact a specialist.