Miscellaneous
0
Views
0
Downloads
0
Favorites
HighLowExtractor
//+------------------------------------------------------------------+
//| HighLowExtractor.mq4 |
//| ttitto |
//|Extracts the difference between high and low of a bar and
// writes it a file |
//+------------------------------------------------------------------+
#property copyright "ttitto"
#property link ""
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
datetime PreviousBarTime;
int HighLowDifference;
int handle;
HighLowDifference=(High[1]-Low[1])*MathPow(10,Digits);
PreviousBarTime=Time[1];
handle=FileOpen(Symbol()+"_HighLowExtractor_"+Period()+"M.csv", FILE_CSV|FILE_READ|FILE_WRITE, ';');
if(handle>0)
{
FileSeek(handle,0,SEEK_END);
FileWrite( handle,TimeToStr(PreviousBarTime), Close[1], Open[1], High[1], Low[1], HighLowDifference);
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
---