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

Detailed Description

Record data of simulated orders (COrderData) in a file format MySQL.

Inheritance diagram for COrderSql:
COrderData

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

Public Member Functions

 COrderSql ()
 
 ~COrderSql ()
 
bool order (string symbol, ENUM_TIMEFRAMES period, int variant, bool sell, double openprice, datetime opentime, int takeprofit, int stoploss, CSqlObject *sqlobject, int maxbars=0, bool snapshot=true, int deviation=5)
 Adds a processing order. More...
 
- Public Member Functions inherited from COrderData
 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

CSqlFile sqlfile
 
- Public Attributes inherited from COrderData
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

bool firstrecord
 
- Protected Attributes inherited from COrderData
int lastday
 
MqlRates rt []
 
MqlRates rtmin []
 

Constructor & Destructor Documentation

◆ COrderSql()

COrderSql::COrderSql ( )

◆ ~COrderSql()

COrderSql::~COrderSql ( )

Member Function Documentation

◆ deleteOrder()

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

Reimplemented from COrderData.

◆ order()

bool COrderSql::order ( string  symbol,
ENUM_TIMEFRAMES  period,
int  variant,
bool  sell,
double  openprice,
datetime  opentime,
int  takeprofit,
int  stoploss,
CSqlObject sqlobject,
int  maxbars = 0,
bool  snapshot = true,
int  deviation = 5 
)

Adds a processing order.

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

Parameters
snapshotuse the CSqlObjectSnapShot to save current data

Member Data Documentation

◆ firstrecord

bool COrderSql::firstrecord
protected

◆ sqlfile

CSqlFile COrderSql::sqlfile