Importing Minute Bars from Forexite.com for MetaTrader 4
Info
The Importing Minute Bars from Forexite.com for MetaTrader 4 is a Script for MetaTrader 4 that this script facilitates the import of minute bar data from forexite. com into MetaTrader 4, addressing the limitations of historical data availability for backtesting intricate strategies.
Usage
This tool is typically used for enhancing chart analysis and decision making.
Platform
This Script works exclusively on MetaTrader 4 (both build 600+ and newer versions).
Setup
Place the downloaded file in MQL4/Scripts folder via File ? Open Data Folder in MetaTrader 4.
How to Install and Use Importing Minute Bars from Forexite.com for MetaTrader 4
1. Installation: Move your script file into the MQL/Scripts directory and restart the platform.
2. Execution: Drag the script onto a chart; it will perform a one-time action, such as closing all open orders or clearing chart objects.
3. Editing: Use MetaEditor (F4) to modify code, click "Compile," and verify no errors appear in the terminal before running.
4. Removing: Scripts stop automatically, but you can remove them manually by right-clicking the chart and choosing "Remove Script."
Frequently Asked Questions
Q: How are scripts different from EAs? A: Scripts execute a single action and then stop; EAs monitor the market and trade continuously.
Q: Can I assign a hotkey to a script? A: Yes, right-click the script in the Navigator, select "Set Hotkey," and define your preferred keyboard shortcut.
Q: Why did my script stop? A: Scripts are designed to stop immediately after finishing their programmed command; this is normal behavior.
What this tool does
This script facilitates the import of minute bar data from Forexite.
Typical Use Case
This Script excels in automated trading and technical analysis on MetaTrader 4.
Compatible Platform & Setup
This Script works on MetaTrader 4. Place the file in the MQL4/Scripts folder and restart the terminal.
Description & Settings
Related: oneminuteman - another powerful script for MetaTrader 4 traders.
This script facilitates the import of minute bar data from Forexite.com into MetaTrader 4, addressing the limitations of historical data availability for backtesting intricate strategies. The quote archive on mql4.com often lacks sufficient historical minute bar data, which is crucial for robust testing, especially for strategies sensitive to inter-dealer price variations on lower timeframes. Forexite.com provides minute bar quotes in a MetaStock format, offering historical data dating back to 2001, which has gained a reputable standing.Also recommended: sc t - the overall percent risk - mt4 - similar script with strong performance on MetaTrader 4.
The primary challenge lies in the scattered nature of this data. Forexite.com organizes minute bars into separate files for each trading day, and each file may contain data for multiple instruments. Additionally, files for weekends are often unnecessary for analysis. This script is designed to consolidate these disparate files into a single, importable file for MetaTrader 4's History Center.
To prepare the data for processing:
1. Download all daily archives for the desired years from the "minute bars" section of Forexite.com. It is recommended to create a separate project for each year, but files from different years can be stored in a single directory. Ensure only files with the *.zip extension are downloaded.
2. Batch unpack all downloaded zip files into the "\experts\files\forexite\" folder. This will result in numerous text files, each named according to the date (e.g., 250705.txt for July 25, 2005).
3. Attach the script to MetaTrader 4. Configure the three external parameters:
a. Instrument Name: The name of the instrument as it appears in the Forexite.com files (e.g., «xauusd» for Gold).
b. Import Start Date: The desired start date for import in "yyyy.mm.dd" format.
c. Import End Date: The desired end date for import in "yyyy.mm.dd" format.
The script automatically skips files corresponding to holidays. Progress is indicated by an updating line displaying the number of processed days. For instance, processing data from 2002 to 2007 to extract gold quotes took approximately 8 minutes.
After the script execution, a file named like xauusd_all.csv will be generated in the "\experts\files\" folder. This is a preliminary file ready for import into MetaTrader 4's History Center. When importing, configure the settings to omit the first column (which contains the instrument name), specify the comma as the column separator, enable volume if applicable, and set the correct hour offset if necessary.
Once all data has been successfully imported, the original downloaded zip files and the generated xauusd_all.csv file can be deleted.
It is important to note that minute bar quotes from Forexite.com typically do not contain volume data. MetaTrader 4 calculates volumes during import if they are missing or contradictory, as the tester requires volume data for analysis. This tool is suitable for strategies that do not rely on precise volume data and are robust enough to tolerate minor inter-dealer price discrepancies.
For testing purposes, a small archive containing quotes for all symbols in the MetaStock format from 01.02.2006 to 12.02.2006 is provided. Extract this archive to "\experts\files\forexite\", configure the script's external parameters (instrument and dates), and run it. Other instruments can be tested by modifying the _symbol external parameter.
You may also like: Simple Arrow Indicator - excellent alternative for script users on MetaTrader 4.
Source Code
/* forexite.com
. . */
#property copyright "robotfx"
#property show_inputs
extern string _ssymbol = "xauusd";
extern string _fromdate = "2002.01.01";
extern string _todate = "2007.06.13";
/* , */
string readallstrings( int handle, string ss )
{
.......
⚠ Limitations & Risk Warning
- This tool is provided for educational and testing purposes only.
- Past performance does not guarantee future results.
- Trading involves substantial risk of loss. Use on a demo account first.
- Results may vary depending on market conditions, broker, and settings.
- We recommend thorough backtesting and forward testing before using with real funds.