FXG_sHist2csv_symbol

Price Data Components
Series array that contains open prices of each barSeries array that contains close prices for each barSeries array that contains the highest prices of each barSeries array that contains the lowest prices of each barSeries array that contains tick volumes of each bar
Miscellaneous
Uses files from the file systemIt writes information to fileIt plays sound alerts
0 Views
0 Downloads
0 Favorites
FXG_sHist2csv_symbol

#property show_inputs
extern string ext="txt";
extern int last_bar=1;
extern int bars=610;

//+------------------------------------------------------------------+
//| script program start function                                    |
//+------------------------------------------------------------------+
int start()
  {
double o,hi,l,c,v; 

   int h=FileOpen(Symbol()+Period()+"."+ext+"",FILE_WRITE|FILE_CSV,",");
      for(int i=bars;i>=last_bar;i--)
      {
         o=iOpen(Symbol(),Period(),i);
         c=iClose(Symbol(),Period(),i);
         hi=iHigh(Symbol(),Period(),i);
         l=iLow(Symbol(),Period(),i);
         v=iVolume(Symbol(),Period(),i);
         
         FileWrite(h,TimeToStr(Time[i],TIME_DATE),TimeToStr(Time[i],TIME_MINUTES),o,hi,l,c,v);
      }
    FileClose(h);
    PlaySound("alert.wav");

//----
   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 ---