Daily Open Line Indicator For MT5
Table Of Contents:
- Daily Open Line Indicator For MT5
- Installing the Daily Open Line Indicator For MT5
- Parameters of the Daily Open Line Indicator For MT5
- Buffers of the Daily Open Line Indicator For MT5
- Main Parts Of The Code
The Daily Open Line Indicator For MT5 draws a horizontal line which starts at the beginning of the day. The price level of the line is identical to the open price of the day. You should use the indicator on H1 and lower.
Installing the Daily Open Line Indicator For MT5
After you downloaded the indicator via the form above you need to unzip the zip-file. Then you need to copy the file Daily open line.mq5 into the folder MQL5\Indicators of your MT5 installation. After that please restart MT5 and then you will be able to see the indicator in the list of indicators.
Parameters of the Daily Open Line Indicator For MT5
The Daily Open Line Indicator For MT5 has 1 parameters to configure.
input int TimeShift = 0; // Time shift (in hours)
Buffers of the Daily Open Line Indicator For MT5
The Daily Open Line Indicator For MT5 provides 1 buffers.
int OnInit() { SetIndexBuffer(0,openLine,INDICATOR_DATA); return(0); }
Main Parts Of The Code
int OnCalculate(const int rates_total, const int prev_calculated, const datetime& time[], const double& open[], const double& high[], const double& low[], const double& close[], const long& tick_volume[], const long& volume[], const int& spread[]) { if (Bars(_Symbol,_Period) lt rates_total) return(-1); for (int i=(int)MathMax(prev_calculated-1,0); i lt rates_total && !IsStopped(); i++) { string stime = TimeToString(time[i]+TimeShift*3600,TIME_DATE); openLine[i] = (i gt 0) ? (TimeToString(time[i-1]+TimeShift*3600,TIME_DATE)==stime) ? openLine[i-1] : open[i] : open[i]; } return(rates_total); }