//+------------------------------------------------------------------+
//| Script programı başlatma fonksiyonu |
//+------------------------------------------------------------------+
void OnStart()
{
//--- Almanya için ülke kodu (ISO 3166-1 Alpha-2)
string germany_code="DE";
//--- Almanya olaylarını al
MqlCalendarEvent events[];
int events_count=CalendarEventByCountry(germany_code,events);
//--- Almanya olaylarını Günlük'te görüntüle
if(events_count>0)
{
PrintFormat("Almanya olayları: %d",events_count);
ArrayPrint(events);
}
else
{
PrintFormat("Şu ülke kodu için olaylar alınamadı: %s, hata %d",
germany_code,GetLastError());
//--- komut dosyasının erken tamamlanması
return;
}
//--- events[] dizisindeki son olayın açıklamasını al
MqlCalendarEvent event;
ulong event_id=events[events_count-1].id;
if(CalendarEventById(event_id,event))
{
MqlCalendarCountry country;
CalendarCountryById(event.country_id,country);
PrintFormat("event_id=%d ile olay açıklaması alındı",event_id);
PrintFormat("Ülke: %s (ülke kodu = %d)",country.name,event.country_id);
PrintFormat("Olay adı: %s",event.name);
PrintFormat("Olay kodu: %s",event.event_code);
PrintFormat("Olayın önemi: %s",EnumToString((ENUM_CALENDAR_EVENT_IMPORTANCE)event.importance));
PrintFormat("Olay tipi: %s",EnumToString((ENUM_CALENDAR_EVENT_TYPE)event.type));
PrintFormat("Olay sektörü: %s",EnumToString((ENUM_CALENDAR_EVENT_SECTOR)event.sector));
PrintFormat("Olay sıklığı: %s",EnumToString((ENUM_CALENDAR_EVENT_FREQUENCY)event.frequency));
PrintFormat("Olayın zamanı modu: %s",EnumToString((ENUM_CALENDAR_EVENT_TIMEMODE)event.time_mode));
PrintFormat("Olay ölçü birimi: %s",EnumToString((ENUM_CALENDAR_EVENT_UNIT)event.unit));
PrintFormat("Ondalık basamak sayısı: %d",event.digits);
PrintFormat("Olay çarpanı: %s",EnumToString((ENUM_CALENDAR_EVENT_MULTIPLIER)event.multiplier));
PrintFormat("Kaynak URL: %s",event.source_url);
}
else
PrintFormat("event_d=%s için olay açıklaması alma başarısız oldu, hata %d",
event_id,GetLastError());
}
/*
Sonuç:
Almanya olayları: 50
[id] [type] [sector] [frequency] [time_mode] [country_id] [unit] [importance] [multiplier] [digits] [source_url] [event_code] [name] [reserved]
[ 0] 276010001 1 6 2 0 276 1 1 0 1 "https://www.destatis.de/EN/Homepage.html" "exports-mm" "Exports m/m" 0
[ 1] 276010002 1 6 2 0 276 1 1 0 1 "https://www.destatis.de/EN/Homepage.html" "imports-mm" "Imports m/m" 0
[ 2] 276010003 1 4 2 0 276 1 1 0 1 "https://www.destatis.de/EN/Homepage.html" "import-price-index-mm" "Import Price Index m/m" 0
[ 3] 276010004 1 4 2 0 276 1 1 0 1 "https://www.destatis.de/EN/Homepage.html" "import-price-index-yy" "Import Price Index y/y" 0
....
[47] 276500001 1 8 2 0 276 0 2 0 1 "https://www.markiteconomics.com" "markit-manufacturing-pmi" "Markit Manufacturing PMI" 0
[48] 276500002 1 8 2 0 276 0 2 0 1 "https://www.markiteconomics.com" "markit-services-pmi" "Markit Services PMI" 0
[49] 276500003 1 8 2 0 276 0 2 0 1 "https://www.markiteconomics.com" "markit-composite-pmi" "Markit Composite PMI" 0
event_id=276500003 ile olay açıklaması alındı
Ülke: Almanya (ülke kodu = 276)
Olay adı: Markit Composite PMI
Olay kodu: markit-composite-pmi
Olay önemi: CALENDAR_IMPORTANCE_MODERATE
Olay tipi: CALENDAR_TYPE_INDICATOR
Olay sektörü: CALENDAR_SECTOR_BUSINESS
Olay sıklığı: CALENDAR_FREQUENCY_MONTH
Olayın zamanı modu: CALENDAR_TIMEMODE_DATETIME
Olay ölçü birimi: CALENDAR_UNIT_NONE
Ondalık basamak sayısı: 1
Değer çarpanı: CALENDAR_MULTIPLIER_NONE
Kaynak URL: https://www.markiteconomics.com
*/
|