Fork me on GitHub
Library for MQL5 (MetaTrader) with support for Spark
COrderData Class Reference

Detailed Description

Simulation of orders with attached data for research.

Inheritance diagram for COrderData:
COrderSql

The documentation for this class was generated from the following file:

Public Member Functions

 COrderData ()
 
 ~COrderData ()
 
bool order (string symbol, ENUM_TIMEFRAMES period, int variant, bool sell, double openprice, datetime opentime, int takeprofit, int stoploss, int maxbars=0, int deviation=5, COrderDataObject *order=NULL)
 Adds a processing order. More...
 
void tick (bool now=false)
 Processes the added orders at the beginning of each day. More...
 
int findBar (COrderDataObject *order, double &profit, ENUM_TIMEFRAMES period, MqlRates &rates[], const int bars)
 

Public Attributes

bool enable
 
bool visual
 
COrderDataObjectorders_first
 
COrderDataObjectorders_last
 
CStatistic statistic
 

Protected Member Functions

virtual bool deleteOrder (COrderDataObject *order, const bool show, const bool stats)
 

Protected Attributes

int lastday
 
MqlRates rt []
 
MqlRates rtmin []
 

Constructor & Destructor Documentation

◆ COrderData()

COrderData::COrderData ( )

◆ ~COrderData()

COrderData::~COrderData ( )

Member Function Documentation

◆ deleteOrder()

virtual bool COrderData::deleteOrder ( COrderDataObject order,
const bool  show,
const bool  stats 
)
protectedvirtual

Reimplemented in COrderSql.

◆ findBar()

int COrderData::findBar ( COrderDataObject order,
double &  profit,
ENUM_TIMEFRAMES  period,
MqlRates &  rates[],
const int  bars 
)
Parameters
[in]order
[out]profit+take or -stop points
[in]period
[in]rates
[in]bars
Returns
-1 or number of bar in the rates[]

◆ order()

bool COrderData::order ( string  symbol,
ENUM_TIMEFRAMES  period,
int  variant,
bool  sell,
double  openprice,
datetime  opentime,
int  takeprofit,
int  stoploss,
int  maxbars = 0,
int  deviation = 5,
COrderDataObject order = NULL 
)

Adds a processing order.

For best performance, you need to use one copy of the class for one pair (Symbol + Period).

◆ tick()

void COrderData::tick ( bool  now = false)

Processes the added orders at the beginning of each day.

Parameters
nowstart processing immediately

BUG: не учитываются разные символы, периоды

Member Data Documentation

◆ enable

bool COrderData::enable

◆ lastday

int COrderData::lastday
protected

◆ orders_first

COrderDataObject* COrderData::orders_first

◆ orders_last

COrderDataObject * COrderData::orders_last

◆ rt

MqlRates COrderData::rt[]
protected

◆ rtmin

MqlRates COrderData::rtmin[]
protected

◆ statistic

CStatistic COrderData::statistic

◆ visual

bool COrderData::visual