Miscellaneous
0
Views
0
Downloads
0
Favorites
ADATAwave59
//+__________________________________________________________________+
//| AgetData.mq4 |
//| Copyright 2005,fxpars |
//|
//+__________________________________________________________________+
#property copyright "ooo"
#property link "aaa"
#property indicator_chart_window
extern int number_bars=2000;
extern int from_year = 1978;
int start()
{
int handle;
int cnt;
string strline;
string name_file;
name_file = Symbol()+ Period()+ ".prn";
handle = FileOpen(name_file , FILE_CSV|FILE_WRITE, "\t");
if(handle<1)
{
Print("cannot open file error_",GetLastError());
return(0);
}
else
{
for (cnt=number_bars;cnt>=0;cnt--)
if (from_year<TimeYear(Time[cnt]))
{
strline = TimeToStr(Time[cnt],TIME_DATE|TIME_SECONDS);
strline = StringSubstr(strline,5,2) + StringSubstr(strline,8,2) + StringSubstr(strline,0,4) +"," + StringSubstr(strline,11,5);
strline = strline + "," + DoubleToStr(Open[cnt],4) + "," + DoubleToStr(High[cnt],4) + "," + DoubleToStr(Low[cnt],4) + "," + DoubleToStr(Close[cnt],4);// + "," + DoubleToStr(Volume[cnt],0);
FileWrite(handle, strline);
}
FileClose(handle);
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
---