设为首页 收藏本站 切换语言

MT4开发 - 市场信息

| 发表于 2023-1-5 14:36:03 | 显示全部楼层 |复制链接
  1. //+------------------------------------------------------------------+
  2. //|                                                   MarketInfo.mq4 |
  3. //|                        Copyright 2018, MetaQuotes Software Corp. |
  4. //|                                             https://www.mql5.com |
  5. //+------------------------------------------------------------------+
  6. #property copyright "Copyright 2018, MetaQuotes Software Corp."
  7. #property link      "https://www.mql5.com"
  8. #property version   "1.00"
  9. #property strict
  10. //+------------------------------------------------------------------+
  11. //| Script program start function                                    |
  12. //+------------------------------------------------------------------+
  13. void OnStart()
  14.   {
  15. //---
  16.    Print("Symbol=",Symbol());
  17.    Print("Low day price=",MarketInfo(Symbol(),MODE_LOW));
  18.    Print("High day price=",MarketInfo(Symbol(),MODE_HIGH));
  19.    Print("The last incoming tick time=",(MarketInfo(Symbol(),MODE_TIME)));
  20.    Print("Last incoming bid price=",MarketInfo(Symbol(),MODE_BID));
  21.    Print("Last incoming ask price=",MarketInfo(Symbol(),MODE_ASK));
  22.    Print("Point size in the quote currency=",MarketInfo(Symbol(),MODE_POINT));
  23.    Print("Digits after decimal point=",MarketInfo(Symbol(),MODE_DIGITS));
  24.    Print("Spread value in points=",MarketInfo(Symbol(),MODE_SPREAD));
  25.    Print("Stop level in points=",MarketInfo(Symbol(),MODE_STOPLEVEL));
  26.    Print("Lot size in the base currency=",MarketInfo(Symbol(),MODE_LOTSIZE));
  27.    Print("Tick value in the deposit currency=",MarketInfo(Symbol(),MODE_TICKVALUE));
  28.    Print("Tick size in points=",MarketInfo(Symbol(),MODE_TICKSIZE));  
  29.    Print("Swap of the buy order=",MarketInfo(Symbol(),MODE_SWAPLONG));
  30.    Print("Swap of the sell order=",MarketInfo(Symbol(),MODE_SWAPSHORT));
  31.    Print("Market starting date (for futures)=",MarketInfo(Symbol(),MODE_STARTING));
  32.    Print("Market expiration date (for futures)=",MarketInfo(Symbol(),MODE_EXPIRATION));
  33.    Print("Trade is allowed for the symbol=",MarketInfo(Symbol(),MODE_TRADEALLOWED));
  34.    Print("Minimum permitted amount of a lot=",MarketInfo(Symbol(),MODE_MINLOT));
  35.    Print("Step for changing lots=",MarketInfo(Symbol(),MODE_LOTSTEP));
  36.    Print("Maximum permitted amount of a lot=",MarketInfo(Symbol(),MODE_MAXLOT));
  37.    Print("Swap calculation method=",MarketInfo(Symbol(),MODE_SWAPTYPE));
  38.    Print("Profit calculation mode=",MarketInfo(Symbol(),MODE_PROFITCALCMODE));
  39.    Print("Margin calculation mode=",MarketInfo(Symbol(),MODE_MARGINCALCMODE));
  40.    Print("Initial margin requirements for 1 lot=",MarketInfo(Symbol(),MODE_MARGININIT));
  41.    Print("Margin to maintain open orders calculated for 1 lot=",MarketInfo(Symbol(),MODE_MARGINMAINTENANCE));
  42.    Print("Hedged margin calculated for 1 lot=",MarketInfo(Symbol(),MODE_MARGINHEDGED));
  43.    Print("Free margin required to open 1 lot for buying=",MarketInfo(Symbol(),MODE_MARGINREQUIRED));
  44.    Print("Order freeze level in points=",MarketInfo(Symbol(),MODE_FREEZELEVEL));   
  45.   }
  46. //+------------------------------------------------------------------+
复制代码
如果有帮助,就支持一下我呗
最近访问 头像模式
举报

评论 使用道具

发新帖
EA交易
您需要登录后才可以评论 登录 | 立即注册

简体中文
繁體中文
English(英语)
日本語(日语)
Deutsch(德语)
Русский язык(俄语)
بالعربية(阿拉伯语)
Türkçe(土耳其语)
Português(葡萄牙语)
ภาษาไทย(泰国语)
한어(朝鲜语/韩语)
Français(法语)