Price Data Components
Miscellaneous
0
Views
0
Downloads
0
Favorites
GraphOnGrap
//+------------------------------------------------------------------+
//| GraphOnGrap.mq4 |
//| Gryb Alexander alexandergrib@rambler.ru |
//| |
//+------------------------------------------------------------------+
#property copyright "Gryb Alexander alexandergrib@rambler.ru"
#property link ""
#property indicator_separate_window
#property indicator_buffers 1
extern string comment1 = "Âàëþòíàÿ ïàðà";
extern string symbol = "EURUSD";
extern string comment2 = "Òàéìôðåéì. 0 - òô òåêóùåãî ãðàôèêà";
extern int timeFrame = 0;
extern string comment3 = "Öåíà, ïî êîòîðîé ñòðîåòñÿ ãðàôèê ïàðû(Open, Close, Medium)";
extern string price = "Open";
extern color indicatorColor=Red;
double cot1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexBuffer(0,cot1);
SetIndexStyle(0,DRAW_LINE,NULL,NULL,indicatorColor);
IndicatorShortName("Ãðàôèê "+symbol);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
//----
for(int k = 0;k<1000;k++)
{
if(price == "Open") cot1[k]=iOpen(symbol,0,k);
if(price == "Close") cot1[k]=iClose(symbol,0,k);
if(price == "Medium") cot1[k]=((iOpen(symbol,0,k)+iClose(symbol,0,k))/2);
}
//----
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
---