Indicators Used
Miscellaneous
0
Views
0
Downloads
0
Favorites
WriteDataSeries
//+------------------------------------------------------------------+
//| WriteDataSeries.mq4 |
//| Ibrahim Noor |
//| http://winning-solution.com/?id=baim78 |
//+------------------------------------------------------------------+
#property copyright "Ibrahim Noor"
#property link "http://winning-solution.com/?id=baim78"
extern int Fast=12;
extern int Slow=26;
extern int Signal=9;
int handle;
string report_name;
/*
Put it on metatrader 4\experts\ folder
This EA just to write data series of prices for further analysis.
Run in with Strategy Tester, select this EA, select Model Open prices only (for faster)
select symbol and set use date, start.
File data series will be in metatrader 4\tester\files\ with csv extension
You can open and edit it with Excel or other Analysis programs for further analysis.
In this original, it use MACD Main for result, you can change your own favorite signal.
*/
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
report_name= StringConcatenate(Symbol(),Period(),".csv");
handle=FileOpen(report_name,FILE_CSV|FILE_WRITE,';');
if(handle<1) {
Print("Failed to Open File: ",report_name);
return;
} else {
Print("Succes to Open File: ",report_name);
}
FileWrite(handle,"Date Time","Result","Open","Close");
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
FileClose(handle);
Print("File Closed: ",report_name);
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
double MACD_Main;
MACD_Main = NormalizeDouble(iMACD(Symbol(),0,Fast,Slow,Signal,0,0,1),5);
FileWrite(handle,TimeToStr(Time[1]),MACD_Main,Open[1],Close[1]);
//----
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
---