Test of History file

Author: Copyright � 2008, Serega Lykov
Test of History file
Price Data Components
Series array that contains open prices of each barSeries array that contains the highest prices of each barSeries array that contains the lowest prices of each barSeries array that contains close prices for each barSeries array that contains tick volumes of each bar
0 Views
0 Downloads
0 Favorites
Test of History file
//+------------------------------------------------------------------+
//|                                         Test of History file.mq4 |
//|                                   Copyright © 2008, Serega Lykov |
//|                                       http://mtexperts.narod.ru/ |
//+------------------------------------------------------------------+

#property copyright "Copyright © 2008, Serega Lykov"
#property link      "http://mtexperts.narod.ru/"

extern string   symbol = "GBPUSD";
static datetime bartime;

//+------------------------------------------------------------------+
//| Iteration function                                               |
//+------------------------------------------------------------------+
int start()
  {
   datetime time = iTime(symbol,PERIOD_M1,0);
   if(bartime == time) return(0);
   bartime = time;
   Print("--------------------------------------- ",TimeToStr(bartime), " ---------------------------------------");
   for(int i=0; i<5; i++)
     {
      double open  = NormalizeDouble(iOpen(symbol,PERIOD_M1,i),Digits);
      double high  = NormalizeDouble(iHigh(symbol,PERIOD_M1,i),Digits);
      double low   = NormalizeDouble(iLow(symbol,PERIOD_M1,i),Digits);
      double close = NormalizeDouble(iClose(symbol,PERIOD_M1,i),Digits);
      int volume = iVolume(symbol,PERIOD_M1,i);
      time = iTime(symbol,PERIOD_M1,i);
      Print("shift = ",i," : Time = ",TimeToStr(time),", Open = ",open,", High = ",high,", Low = ",low,", Close = ",close,", Volume = ",volume);
     }
   return(0);
  }

//+------------------------------------------------------------------+

Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---