Download MetaTrader 5
To add comments, please log in or register
Write articles, help other developers and make money
tadeinweilburg
5
tadeinweilburg 2012.03.08 10:33 

How could I get access to the actual bars data. What ist the idea behind this.


In MQL4 i can get these informations with High[i], Low[i], ... In the doc i have seen a lot of copy commands. In OOP normally i have to create an object, then access with a method or a variable of this object.

Thank you.

onewithzachy
2274
onewithzachy 2012.03.08 12:11  

Open MQL5 help files. Click on MQL5 Reference > Language Basic > Event Handling Function then scroll down to OnCalculate () function like this one :

int OnCalculate (const int rates_total,      // size of input timeseries
                 const int prev_calculated,  // bars handled in previous call
                 const datetime& time[],     // Time
                 const double& open[],       // Open
                 const double& high[],       // High
                 const double& low[],        // Low
                 const double& close[],      // Close
                 const long& tick_volume[],  // Tick Volume
                 const long& volume[],       // Real Volume
                 const int& spread[]         // Spread
   );
 

 Quote

" Parameters of open[], high[], low[] and close[] contain arrays with open prices, high and low prices and close prices of the current timeframe.The time[] parameter contains an array with open time values, the spread[] parameter has an array containing the history of spreads (if any spread is provided for the traded security). The parameters of volume[] and tick_volume[] contain the history of trade and tick volume, respectively."

End Quote

Documentation on MQL5: Standard Constants, Enumerations and Structures / Indicator Constants / Price Constants
  • www.mql5.com
Standard Constants, Enumerations and Structures / Indicator Constants / Price Constants - Documentation on MQL5
/
To add comments, please log in or register