TickLoggerForFXT

Download script
TickLoggerForFXT

Overview

This automated script is designed to act as a high-precision recording tool for live market data. Its primary purpose is to capture every single "tick"—which represents the smallest possible price movement in the currency market—and save that information into a structured file on your computer.

How It Works

1. Automatic File Organization When you first activate the script, it automatically generates a unique filename based on the specific currency pair you are viewing and the current date. For example, if you are trading EURUSD, it will create a dedicated CSV file named with that currency and today's date. This ensures your data is organized and easy to find without manual renaming.

2. Continuous Data Tracking The script works in real-time. Every time the market price moves—even by the tiniest fraction—the script detects this change immediately. It keeps a running tally of these movements, providing you with a live counter on your screen so you can see exactly how many price updates have been recorded since the script started.

3. Precise Logging For every price movement detected, the script captures two critical pieces of information:

  • The exact timestamp (down to the second).
  • The current "Bid" price (the price at which you could sell the currency).

4. Data Storage All this captured information is systematically written into a spreadsheet-ready format (.csv). Because it records data sequentially, you can easily export these files later to analyze market behavior, study price trends, or perform historical backtesting in external software like Excel.

Summary of Behavior

  • Initial Setup: Prepares the file and waits for the first movement.
  • Active Monitoring: Watches the live feed constantly.
  • Recording: Logs every single price update to your hard drive instantly.
  • Visual Feedback: Displays a status message on your chart showing the current progress and the file being used.
Price Data Components
Series array that contains open time of each bar
Miscellaneous
Uses files from the file systemIt writes information to file
13 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