Algorithmic or Mechanical Trading

Submitted by currenciesfx on Tue, 04/26/2022 - 09:37
Introduction to Algorithmic or Mechanical Trading

Introduction to Algorithmic or Mechanical Trading

What is Algorithmic/Mechanical Trading?

Algorithmic, Algo, Mechanical, Systematic, or Rule-Based trading, refers to a trading method where order execution is based exclusively on a pre-defined set of rules and instructions.

• Mechanical trading rules and instructions include variables such as price, time, and volume

• Mechanical trading usually refers to a software code (automated trading), but it can be also based on manual execution


Who Applies Algorithmic Strategies?

Several different market participants apply algorithmic strategies, such as investment firms, hedge funds, high-frequency trading firms, large individual traders, and small retail traders.

At the top of the chain, there are several large hedge funds and investment firms using state-of-the-art technology and hiring a wide team of programmers, mathematicians, and professional traders. They use proprietary systems, programmed to trade tiny inefficiencies between the dynamics of demand and supply. These strategies can focus on a single financial market, or multiple asset classes. The asset classes involved include shares, ETFs, currencies, and government bonds.

Can Retail Traders Compete?

In the short-term, retail traders are unable to compete against institutional traders holding superior technology and unlimited resources. Retail traders can only develop and apply mechanical systems aiming to trade price swings lasting from a few hours to several days.

Algorithmic trading vs High-Frequency trading

As mentioned before, algorithmic trading refers to any trading activity based on computer algorithms. It can involve automated or manual execution. Algorithmic trading does not limit traders to a specific time horizon. Computer algorithms can trade any time horizon (intra-day, to a weekly or monthly basis).

High-Frequency Trading (HFT)

High-Frequency traders use also computer algorithms to analyze multiple market data at the same time. HFT involves executing a large number of orders simultaneously triggered by changing market conditions. HFT is a 100% fully automated process that trades in tiny time fragments by aiming to exploit tiny market inefficiencies.


The Seven Steps for a Successful Mechanical System

(1) Create a Full Plan (based on available capital, available time, desired risk exposure, trading goals)

(2) Select a Trade Strategy (automated/manual trade strategy that can meet the qualifications and goals set before)

(3) Create Setups (creating entry/exit conditions including variables such as price, time, and volume)

(4) Build a Money Management System (creating a set of rules and instructions that will determine the stops and the ideal position sizing for each setup)

(5) Test your System and Optimize your Setups (back-testing your system using historical data by optimizing your setups)

(6) Execute Your Strategy (Starting on a Mini Lot Account and then moving on to a Standard Lot Account)

(7) Monitor your Results and Make any Necessary Adjustments (keeping a clean record of the top winning and losing trades)

Note: The implementation of an automated trade strategy will not require the creation of any setups (step-3), as automated strategies include built-in setups.


Creating Online your Own Customized Mechanical-Trading System

Complex algorithmic strategies require programming skills and the use of a powerful computer language, such as the cAlgo. An easy way to start your own mechanical-trade strategy without any programming skills is by using the EA builder.

» EA Builder website

This web app is free for creating a manual system but requires a one-time fee for building automated mechanical systems.

  • Creating Online your Own Customized Mechanical-Trading System
    Creating your Own Customized Mechanical-Trading System with EA Builder Web App

    Design a full set of rules and conditions

  • Enter time intervals and other filters

  • Apply full money management rules

  • Trade Forex Currencies, Indices, Commodities, Shares, ETFs

  • Trade your strategy on MT4, MT5, or Tradestation

» EA Builder for MT4, MT5, and Tradestation


Evaluating an Algorithmic-Trading Strategy

The evaluation of an algorithmic strategy involves the use of historical data, a process which is known as back-testing. There are a lot of parameters that forecast the efficiency of an algorithmic strategy.

The most important parameters include:

  • Average Annual Profitability

  • Overall Profitability (whole period)

  • Maximum Drawdown (%)

  • Number of Consecutive winners in a row

  • Number of Consecutive losers in a row

  • Overall winning percentage

For more information, check the terminology section at the bottom of this article.


Algorithmic Trading Basic Terms

These are some basic terms for those entering the world of mechanical trading.

  • Annual Return (%)

The annual return measures the percentage gain or loss of a trading system, over 12 months.

■ Annual Return = {(Total Profits – Total Losses) / Starting Capital} %

Be careful when evaluating an external system provider because there is a catch here. Some system providers report their losing trades based only on their closed trades. While their open trades may have accumulated huge losses. Therefore, make sure the numbers you have available include both open and closed trades.

  • Alpha

Alpha measures the return of a system compared to a suitable market index, over a selected period.

For example, an alpha of +1% means the system’s return on investment was 1% better than the suitable market index. An alpha of -1% means the system underperformed the suitable market index by one percent.

  • Calmar Ratio

Calmar Ratio is the ratio of annual returns to maximum drawdown, over the past 3 years. The world-known trader Paul Tudor Jones suggests that a system with a Calmar Ratio between 2.0 and 3.0 is a good system.

■ Calmar Ratio = Annual returns (36 months) / Maximum drawdown (36 months)

For example, if a system achieved a 100% annual return, with a 50% maximum drawdown, the Calmar ratio will be 2.0.

  • Cross-Asset Trading

Cross-asset trading means trading more than one asset class, under the same strategy. The key is to hedge your risk by taking advantage of potential anomalies between two highly correlated financial markets. For example, buying Crude Oil, and at the same time going short on an oil-exporting currency, such as NOK, CAD, and RUB. Mechanical trading can prove an ideal method to do that job.

  • Dark Pools

Dark pools are off-exchange marketplaces, where large traders execute anonymously their vast orders.

  • Drawdown (%)

Drawdown (%) measures the difference between the peak equity amount and the current equity amount.

■ Drawdown = (Peak Equity - Current Equity) / Peak Equity Amount

For example, if the peak balance of an account was $100,000, and now holds $75,000, the drawdown is 25%.

  • Expectancy

Expectancy measures the average dollar amount you can expect to win/lose per dollar at risk.

■ Expectancy = (Probability of Win * Average Win) – (Probability of Loss * Average Loss)


-Probability of Win (%) = winning percentage

-Average Win($) = dollar value of the average winning trade

-Probability of Loss (%) = losing percentage

-Average Loss($) = dollar value of the average loser trade (must be less than zero)

  • Standard Technical Risk Calculations

To forecast the Technical Risk of a trading system, you can use five (5) risk calculations: Alpha, Beta, Standard Deviation, R-squared, and Sharpe ratio.

  • Win/Loss Ratio

The win/loss ratio calculates the total number of winning trades to the number of losing trades.

■ Win/Loss Ratio = Total number of winning trades / Total number of losing trades

The win/loss ratio does not take into account how much was won and how much was lost. It takes into account only if the trades were winners or losers.


The StrategyQuant

Select, research, or develop algorithic trading strategies with a click of a button.

StrategyQuant is a complete algorithmic system that generates, backtests, and optimizes strategies automatically:

  • Does not require programming skills
  • Build an unlimited number of algorithmic strategies
  • Export your Algo strategies to MetaTrader-4, MetaTrader-5, NinjaTrader or Tradestation (with full source code)
  • Develop strategies for any market or timeframe, even multi-market and multi-TF
  • Includes a very advanced historical backtesting module
  • Run automated robustness tests to reduce the risk of curve-fitting
  • Optimize your strategies with the Walk-Forward optimizer
  • 1,290 USD for the basic license & 14-day Free Trial

StrategyQuant -Build Complex Algorithmic Systems


Algorithmic or Mechanical Trading (c)