HighLowExtractor

Author: ttitto
HighLowExtractor
Miscellaneous
Uses files from the file systemIt writes information to file
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 supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---