Algorithmic and Mechanical Forex Strategies | OneStepRemoved

  • Articles
  • Sophisticated Web Sites
  • Automated Trading
  • Testimonials
  • Contact

MetaTrader Data

March 29, 2012 by Shaun Overton Leave a Comment

It’s hard to keep track of places where you can download historical price data for MetaTrader. I decided to post a few links here on the blog to collect them all in one place.

FXDD offers historical price data for all the major currency pairs. The prices extend all the way back to 2005. This option is far and away the easiest to use. The files download in .hst format, which means that you don’t have to worry about formatting. The data resolution is at the M1 level. http://www.fxdd.com/mt/en/forex-resources/forex-trading-tools/metatrader-1-minute-data/

Alpari used to offer M1 data on its web site. They fluctuated between taking the links down and putting it back up eventually. Their download links, however, have been down for about two years now. It looks like they finally threw in the towel on offering free price histories.

FXCM offers the ability to export historical prices through their Strategy Trader platform. Obtaining the data is simple. The formatting is a little off, so you would need to write a simple program to convert this into an .hst file. http://www.fxcm.com/strategy-trader.jsp

GAIN offers free data, but they seem to make it intentionally difficult to find and work with. They split the data into one week intervals, and the price histories don’t appear to be even based on my quick glance over their csv file. I wouldn’t recommend going to all the trouble of downloading and formatting their data without a compelling reason. http://ratedata.gaincapital.com/

Dukascopy offers extensive price history down to the tick level. If you want tick prices going back quite a way back in time without paying for data, this is the only option that I know of. I have not messed around with it personally. I only know about it from internet chatter for people who seem to feel that they need tick data for their backtesting. The formatting is not designed for MetaTrader. Once again, you would have to write a conversion program to move it into the MetaTrader history center. http://www.dukascopy.com/swiss/english/data_feed/csv_data_export/

Filed Under: MetaTrader Tips Tagged With: Alpari, Dukascopy, forex, FXCM, FXDD, GAIN, history center, hst, M1, price history

Scripts in MetaTrader

January 26, 2012 by Shaun Overton Leave a Comment

Scripts are executable files in MetaTrader that only run one time. They are perfect for tasks that are routine but time consuming or unpleasant to do. The most advantageous use of scripts is that they do not rely on incoming price ticks in order to run. The script executes the moment that the trader drops it onto a chart.

An expert advisor runs continuously, but it relies on incoming ticks to know that it should update itself. The frequency that the market changes price varies with the time of day. This means that the period between updates for an expert advisor is highly unpredictable. The predictability of a script’s timing – it runs immediately – makes it more suitable for some trading tasks than an EA.

Script examples

A scalper wants to open a trade quickly. He routinely applies a 20 pip stop loss and a 3 pip take profit. His usual process would involve:

  1. Click inside of MetaTrader to open a trade
  2. Select the correct forex pair
  3. Wait for the trade to open
  4. Frantically add the take profit as quickly as possible

Alternatively, the trader could keep his chart open and the scripts window nearby. Whenever he decides to trade, he drags the script onto the chart. The steps above still occur. The critical difference is that they happen in a fraction of the time. The script runs once, then it removes itself from the chart.

Some tasks require a tiresome amount of clicking rather than speed. Scripts are also useful in that scenario. A lot of MetaTrader users like to stack multiple pending orders above and below the market in a grid pattern. An example would involve placing 10 orders above and below the market at different prices. Doing this manually would take a few minutes.

The alternative is to run a script that does it one time for you. Scripts can display input screens just like expert advisors. That way the user can control the settings.

When the trader is ready to bracket his orders, he drags and drops the script onto the chart. The orders show up on the screen at the requested prices. The total time takes a few seconds instead of several minutes.

Other script uses

The most common, though unorthodox, use of a script is to feed prices into the History Center for a custom offline chart. The script is programmed to run at a set interval such as every half second. The script samples the price, then records the information where the historical prices are kept. The offline chart then re-reads the information and updates the price.

MQL programmers elect to use a script instead of an expert advisor because they are setting an infinite loop. Although scripts technically run once, this script is never allowed to finish its first run. It keeps waiting every set interval to update the price. EAs would not work well here because new, incoming ticks would create a backlog of occasions where the EA is supposed to have run. I would expect MT4’s memory use to eventually get out of control and crash the program if someone elected to take this approach. Even though it is not an ideal solution, scripts update historical prices successfully without the tick backlog concern.

Filed Under: MetaTrader Tips Tagged With: EA, expert advisor, history center, metatrader, pending order, scalper, script

FREE trading strategies by email

Trending

Sorry. No data so far.

Archives

  • Dominari
  • How does the forex market work?
  • Indicators
  • MetaTrader Tips
  • MQL (for nerds)
  • NinjaTrader Tips
  • Pilum
  • QB Pro
  • Stop losing money
  • Test your concepts historically
  • Trading strategy ideas
  • Uncategorized
  • What's happening in the current markets?

Translation


Free Trading Strategies

Privacy PolicyRisk Disclosure

Copyright © 2023 OneStepRemoved.com, Inc. All Rights Reserved.