mirror of
https://github.com/softwaredevelop/mql5.git
synced 2026-07-27 20:47:44 +00:00
97 lines
6.2 KiB
Plaintext
97 lines
6.2 KiB
Plaintext
//+------------------------------------------------------------------+
|
|
//| SymbolInfoIntegerChecker.mq5 |
|
|
//| Copyright 2025, MetaQuotes Ltd. |
|
|
//| https://www.mql5.com |
|
|
//+------------------------------------------------------------------+
|
|
#property copyright "Copyright 2025, MetaQuotes Ltd."
|
|
#property link "https://www.mql5.com"
|
|
#property version "1.00"
|
|
|
|
#include <Trade\SymbolInfo.mqh>
|
|
|
|
//+------------------------------------------------------------------+
|
|
//| Script program start function |
|
|
//+------------------------------------------------------------------+
|
|
void OnStart()
|
|
{
|
|
string symbol = _Symbol;
|
|
CSymbolInfo m_symbol_info;
|
|
|
|
if(!m_symbol_info.Name(symbol))
|
|
{
|
|
PrintFormat("Error: Failed to initialize CSymbolInfo for symbol '%s'. Error: %d", symbol, GetLastError());
|
|
return;
|
|
}
|
|
|
|
Print("--- Symbol Property Checker Started ---");
|
|
PrintFormat("Checking symbol: %s", symbol);
|
|
Print("--- Integer Properties (ENUM_SYMBOL_INFO_INTEGER) ---");
|
|
|
|
ENUM_SYMBOL_INFO_INTEGER int_properties[] =
|
|
{
|
|
SYMBOL_SUBSCRIPTION_DELAY,
|
|
SYMBOL_SECTOR,
|
|
SYMBOL_INDUSTRY,
|
|
SYMBOL_CUSTOM,
|
|
SYMBOL_BACKGROUND_COLOR,
|
|
SYMBOL_CHART_MODE,
|
|
SYMBOL_EXIST,
|
|
SYMBOL_SELECT,
|
|
SYMBOL_VISIBLE,
|
|
SYMBOL_SESSION_DEALS,
|
|
SYMBOL_SESSION_BUY_ORDERS,
|
|
SYMBOL_SESSION_SELL_ORDERS,
|
|
SYMBOL_VOLUME,
|
|
SYMBOL_VOLUMEHIGH,
|
|
SYMBOL_VOLUMELOW,
|
|
SYMBOL_TIME,
|
|
SYMBOL_TIME_MSC,
|
|
SYMBOL_DIGITS,
|
|
SYMBOL_SPREAD_FLOAT,
|
|
SYMBOL_SPREAD,
|
|
SYMBOL_TICKS_BOOKDEPTH,
|
|
SYMBOL_TRADE_CALC_MODE,
|
|
SYMBOL_TRADE_MODE,
|
|
SYMBOL_START_TIME,
|
|
SYMBOL_EXPIRATION_TIME,
|
|
SYMBOL_TRADE_STOPS_LEVEL,
|
|
SYMBOL_TRADE_FREEZE_LEVEL,
|
|
SYMBOL_TRADE_EXEMODE,
|
|
SYMBOL_SWAP_MODE,
|
|
SYMBOL_SWAP_ROLLOVER3DAYS,
|
|
SYMBOL_MARGIN_HEDGED_USE_LEG,
|
|
SYMBOL_EXPIRATION_MODE,
|
|
SYMBOL_FILLING_MODE,
|
|
SYMBOL_ORDER_MODE,
|
|
SYMBOL_ORDER_GTC_MODE,
|
|
SYMBOL_OPTION_MODE,
|
|
SYMBOL_OPTION_RIGHT
|
|
};
|
|
|
|
long value;
|
|
string result_str;
|
|
|
|
for(int i = 0; i < ArraySize(int_properties); i++)
|
|
{
|
|
ResetLastError();
|
|
|
|
bool success = m_symbol_info.InfoInteger(int_properties[i], value);
|
|
int error = GetLastError();
|
|
|
|
if(success)
|
|
{
|
|
result_str = StringFormat("Property: %s, Status: SUPPORTED, Value: %d",
|
|
EnumToString(int_properties[i]), value);
|
|
Print(result_str);
|
|
}
|
|
else
|
|
{
|
|
result_str = StringFormat("Property: %s, Status: QUERY FAILED (Error: %d)",
|
|
EnumToString(int_properties[i]), error);
|
|
Print(result_str);
|
|
}
|
|
}
|
|
Print("--- Check Completed ---");
|
|
}
|
|
//+------------------------------------------------------------------+
|
|
//+------------------------------------------------------------------+ |