私募

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz

期货量化软件:赫兹量化系统品种即时报价序列集合

[复制链接]
发表于 2023-10-13 08:26:04 | 显示全部楼层 |阅读模式
即时报价数据类的集合在 \MQL5\Include\DoEasy\Collections\ 中,创建一个名为 TickSeriesCollection.mqh 的新即时报价数据集合类文件。该类是函数库所有对象的基准对象类的衍生类。我们看一下类主体,并分析其变量和方法://+------------------------------------------------------------------+//|                                         TickSeriesCollection.mqh |//|                        Copyright 2021, MetaQuotes Software Corp. |//|                             https://mql5.com/en/users/artmedia70 |//+------------------------------------------------------------------+#property copyright "Copyright 2021, MetaQuotes Software Corp."#property link      "https://mql5.com/en/users/artmedia70"#property version   "1.00"//+------------------------------------------------------------------+//| Include files                                                    |//+------------------------------------------------------------------+#include "ListObj.mqh"#include "..\Objects\Ticks\TickSeries.mqh"#include "..\Objects\Symbols\Symbol.mqh"//+------------------------------------------------------------------+//| Collection of symbol tick series                                 |//+------------------------------------------------------------------+class CTickSeriesCollection : public CBaseObj  {private:   CListObj                m_list;                                   // List of used symbol tick series//--- Return the tick series index by symbol name   int                     IndexTickSeries(const string symbol);public://--- Return (1) itself and (2) tick series collection list and (3) the number of tick series in the list   CTickSeriesCollection  *GetObject(void)                              { return &this;               }   CArrayObj              *GetList(void)                                { return &this.m_list;        }   int                     DataTotal(void)                        const { return this.m_list.Total(); }//--- Return the pointer to the tick series object (1) by symbol and (2) by index in the list   CTickSeries            *GetTickseries(const string symbol);   CTickSeries            *GetTickseries(const int index);//--- Create a collection list of symbol tick series   bool                    CreateCollection(const CArrayObj *list_symbols,const uint required=0);//--- Set the flag of using the tick series of (1) a specified symbol and (2) all symbols   void                    SetAvailableTickSeries(const string symbol,const bool flag=true);   void                    SetAvailableTickSeries(const bool flag=true);//--- Return the flag of using the tick series of (1) a specified symbol and (2) all symbols   bool                    IsAvailableTickSeries(const string symbol);   bool                    IsAvailableTickSeries(void);//--- Set the number of days of the tick history of (1) a specified symbol and (2) all symbols   bool                    SetRequiredUsedDays(const string symbol,const uint required=0);   bool                    SetRequiredUsedDays(const uint required=0);//--- Return the last tick object of a specified symbol (1) by index, (2) by time and (4) by time in milliseconds   CDataTick              *GetTick(const string symbol,const int index);   CDataTick              *GetTick(const string symbol,const datetime tick_time);   CDataTick              *GetTick(const string symbol,const long tick_time_msc);//--- Return the new tick flag of a specified symbol   bool                    IsNewTick(const string symbol);//--- Create a tick series of (1) a specified symbol and (2) all symbols   bool                    CreateTickSeries(const string symbol,const uint required=0);   bool                    CreateTickSeriesAll(const uint required=0);//--- Update (1) a tick series of a specified symbol and (2) all symbols   void                    Refresh(const string symbol);   void                    Refresh(void);//--- Display (1) the complete and (2) short collection description in the journal   void                    Print(void);   void                    PrintShort(void);   //--- Constructor                           CTickSeriesCollection();  };//+------------------------------------------------------------------+类的成员变量 m_list 属于 CListObj 类型 — 它是标准库 CArrayObj 类的衍生类,就像在函数库中创建的许多其他列表一样。 CListObj 类的唯一目的是实现标准库对象基类 CObject 类的 Type() 虚拟方法操作。 该方法应返回类的类型 ID。 在这种情况下,它是数组类型 ID。
http://www.simu001.cn/x282416x1x1.html
最好的私募社区 | 第一私募论坛 | http://www.simu001.cn

精彩推荐

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Archiver| ( 桂ICP备12001440号-3 )|网站地图

GMT+8, 2024-4-29 07:05 , Processed in 0.402885 second(s), 25 queries .

Powered by www.simu001.cn X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表