Article-15684-MQL5-USDX-EUR.../USD_Index.mq5

45 lines
3 KiB
MQL5
Raw Permalink Normal View History

2026-03-23 14:01:29 +07:00
<EFBFBD><EFBFBD>//+------------------------------------------------------------------+
//| USD_Index.mq5 |
//| Copyright 2000-2024, MetaQuotes Ltd. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property service
#property copyright "Copyright 2000-2024, MetaQuotes Ltd."
#property link "https://www.mql5.com"
#property version "1.00"
#define CUSTOM_SYMBOL "USDX.synthetic"
#define CUSTOM_GROUP "Synthetics"
#define BASKET_SIZE 6
#define MAIN_COEFF 50.14348112
#include "CurrencyIndex.mqh"
SymbolWeight ExtWeights[BASKET_SIZE]=
{
{ "EURUSD",-0.576 },
{ "USDJPY", 0.136 },
{ "GBPUSD",-0.119 },
{ "USDCAD", 0.091 },
{ "USDSEK", 0.042 },
{ "USDCHF", 0.036 }
};
//+------------------------------------------------------------------+
//| Service program start function |
//+------------------------------------------------------------------+
void OnStart()
{
//--- 8=8F80;878@C5< A5@28A
if(!InitService(CUSTOM_SYMBOL,CUSTOM_GROUP))
return;
//--- @01>B05< 2 15A:>=5G=>< F8:;5 4> >B:;NG5=8O A5@28A0
while(!IsStopped())
{
ProcessTick(CUSTOM_SYMBOL);
Sleep(10);
}
//--- A5@28A >B:;NG5=
Print(CUSTOM_SYMBOL," datafeed stopped");
}
//+------------------------------------------------------------------+