Price Data Components
Miscellaneous
0
Views
0
Downloads
0
Favorites
TickLoggerForFXT
/*-----------------------------+
| |
| Shared by www.Aptrafx.com |
| |
+------------------------------*/
//+---------------------------------------------------------------------+
//| TickLoggerForFXT.mq4 |
//| Paul Hampton-Smith |
//| Version 2 with seconds recorded and additional comments on the chart|
//+---------------------------------------------------------------------+
int handle;
string strFilename;
int nTickCount;
int init()
{
Comment("\nWaiting for first tick");
string strMonthPad = "";
string strDayPad = "";
if (Month()<10) strMonthPad = "0";
if (Day()<10) strDayPad = "0";
strFilename = StringConcatenate(Symbol(),"_",Year(),strMonthPad,Month(),strDayPad,Day(),"_ticks.csv");
nTickCount = 0;
handle = FileOpen(strFilename, FILE_CSV|FILE_READ|FILE_WRITE, ';' );
FileSeek(handle,0,SEEK_END);
}
int deinit()
{
FileClose(handle);
}
int start()
{
nTickCount++;
Comment("\nLogging tick #",nTickCount," to ",strFilename);
FileWrite(handle,TimeToStr(CurTime(),TIME_DATE|TIME_MINUTES|TIME_SECONDS),Bid);
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
---