This structure stores information about the prices, volumes and spread.
struct MqlRates { datetimetime; // Period start time doubleopen; // Open price doublehigh; // The highest price of the period doublelow; // The lowest price of the period doubleclose; // Close price longtick_volume; // Tick volume intspread; // Spread longreal_volume; // Trade volume };
Example:
voidOnStart() { MqlRates rates[]; int copied=CopyRates(NULL,0,0,100,rates); if(copied<=0) Print("Error copying price data ",GetLastError()); elsePrint("Copied ",ArraySize(rates)," bars"); }