Price Data Components
Miscellaneous
0
Views
0
Downloads
0
Favorites
PrevDayHL
//+------------------------------------------------------------------+
//| PrevDayHL.mq4 |
//| Scriptong |
//| scriptong@mail.ru |
//+------------------------------------------------------------------+
#property copyright "Scriptong"
#property link "scriptong@mail.ru"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Red
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,ExtMapBuffer2);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
//----
if (counted_bars>0) counted_bars--;
int limit=Bars-counted_bars;
for (int i=0; i<limit; i++)
{
int PrevDay = iBarShift(Symbol(), PERIOD_D1, Time[i])+1;
ExtMapBuffer1[i] = iHigh(Symbol(), PERIOD_D1, PrevDay);
ExtMapBuffer2[i] = iLow(Symbol(), PERIOD_D1, PrevDay);
}
//----
return(0);
}
//+------------------------------------------------------------------+
Comments
Markdown Formatting Guide
# H1
## H2
### H3
**bold text**
*italicized text*
[title](https://www.example.com)

`code`
```
code block
```
> blockquote
- Item 1
- Item 2
1. First item
2. Second item
---