Home

Algo School

What is Algorithmic Trading?

In manual trading, you personally decide when to enter or exit a trade, often influenced by feelings like greed, fear, revenge trading, or overconfidence. This can lead to inconsistent decisions.

By contrast, automated trading uses a set of predefined rules or data‐driven models to execute trades without emotional bias. Under the umbrella of automated trading, you’ll find:

Because computers don’t feel fear or greed, automated approaches tend to be more systematic and less prone to impulsive decisions. Still, they require good design, testing, and risk management.

Instrument (Select Instrument)

Simple Explanation

An Instrument is the asset you’re looking to trade—like stocks, forex, or crypto:

All of these are "Instruments" you can analyze or trade, but each market has its own nuances.

Timeframe (Select Timeframe)

Simple Explanation

Timeframe indicates how often price data is grouped (e.g. 30m, 1h). For example, a 1h timeframe groups all prices within one hour into a single bar.

Here’s how it ties together:
- Tick Data: The rawest form, recording every single trade or quote.
- Bid/Ask: Each tick has a bid (highest price buyers offer) and ask (lowest price sellers want).
- OHLC: Many traders condense a period’s ticks into four key prices: Open (first tick), High (highest tick), Low (lowest tick), and Close (last tick).

Academic Explanation

Academically, a timeframe is the aggregation interval for continuous market data. Each bar typically reflects aggregated bid/ask trades from underlying ticks.

Impact on the Algorithm/Model

Shorter timeframes capture rapid changes but may yield more signals (and noise). Longer timeframes smooth out fluctuations but react slower to sudden shifts.

Lookback Period (Select Lookback Period)

Simple Explanation

The Lookback Period is how many days, weeks, or months of past data you include—like 1 month or 6 months. A shorter lookback may focus on recent trends, while a longer lookback can incorporate older market behavior.

Academic Explanation

In technical analysis, ‘Lookback Period’ is the size of the historical window. Some traders prefer short windows (emphasizing recent moves), others use longer windows for broader context.

Impact on the Algorithm/Model

Short lookbacks make the model respond quickly to new conditions. Longer lookbacks provide more data but may dilute recency.

Indicator (Select Indicator)

Simple Explanation

Indicators help interpret price movements. They fall into categories:

Here’s a more detailed look:

Academic Explanation

Formulas for each:

Impact on the Algorithm/Model

Choosing an indicator focuses the model on momentum (fast moves), volatility (range of movement), or trend detection. This influences when trades are signaled and how responsive the model is to market swings.

Indicator Parameters

Simple Explanation

Traders often start with industry-standard parameters (like RSI=14, MACD=12/26/9) because over the years, these values became accepted as good baselines. They strike a balance between smoothing data and reacting quickly.

Academic Explanation

Typical defaults:

Shortening these periods increases sensitivity, lengthening them smooths out signals.

Impact on the Algorithm/Model

Parameter choices can radically alter the frequency and reliability of signals. Using standard values is a safe start; advanced traders often fine‐tune them for specific markets or timeframes.

In Sample Split (%)

Simple Explanation

This sets how much historical data is used for model building (in-sample) vs. reserved for testing (out-of-sample). For example, 70% in-sample and 30% out-of-sample.

Academic Explanation

The main idea is to confirm that a model performing well on training data also performs decently on unseen data, reducing overfitting concerns.

Impact on the Algorithm/Model

A balanced split ensures you test your model in conditions it didn’t train on. If the OOS performance collapses, it may be overfitted.

Maximum Drawdown (%)

Simple Explanation

Drawdown is the drop from the highest account value to a subsequent low. Setting a max drawdown threshold limits how much you’re willing to lose from a peak.

Academic Explanation

Drawdown is calculated as: (Peak - Trough)/Peak. A threshold ensures strategies exceeding this risk are avoided.

Impact on the Algorithm/Model

Any model that might cause a larger capital drop than your comfort zone is rejected, promoting capital preservation.

Strategy Analytics (IS & OOS Backtest Results)

Simple Explanation

The app produces analytics for both In-Sample (IS) and Out-of-Sample (OOS) data to gauge model performance. Below is an example:

Direction of Trade: GO LONG
IS Period: 21 days (0.06 years)
Profit: 10.78%
Annual Profit: 187.49%
Maximum Drawdown: 7.64%
Number of Trades: 61
Average Profit of Winning Trades: $101.1
Average Loss of Losing Trades: $-102.5
True Positives: 36
False Positives: 25
      

Interpretation:

Impact on the Algorithm/Model

If IS results are solid but OOS is poor, the model might be overfit. Consistency across both sets suggests more robust performance.

Trade Setting Overview

Simple Explanation

Here’s an example:

How long is 1 Period for this analysis: 30m
Trade Duration (Periods): 2
Max Concurrent Trades: 2
Max Leverage Used: 2X
      

Explanation & Risks:

Be cautious with leverage: while it can amplify gains, it also magnifies losses. If the market moves against you, losses can exceed what they would be without leverage.

Impact on the Algorithm/Model

Short durations (fewer periods) = quicker trades, but more churn. Allowing multiple concurrent trades can spread opportunities, but also can raise overall risk. Using leverage (2X) requires careful risk management to avoid large drawdowns in volatile markets.

Algorithm/Model Explained

Simple Explanation

Example:

(c) Entry Logic:
GO LONG IF(AND(%chgStochasticD > -19.6935 AND %chgStochasticD < -7.138))

(d) Exit Logic:
Close the trade after 30 minutes
      

Interpretation:

  1. The model goes Long if the % change of StochasticD is between those two numbers. This implies it’s detecting a specific momentum condition.
  2. After 30 minutes (1 period if that’s your setting), the trade automatically closes.
Such logic is purely rule-based and removes emotion from decision-making.

Overfitting & Identifying a Good Model

Simple Explanation

Financial data is noisy, full of random fluctuations. If you train a model too precisely on these quirks, it may do great on past data but fail on new data—this is overfitting.

For example, imagine you create rules that perfectly predict 100 trades from last year’s data. Chances are, many of those ‘perfect signals’ just fit random luck. When you apply it to this year’s market, the rules no longer hold.

A good model focuses on persistent market patterns, not random noise, and it passes out-of-sample tests with stable results.

Academic Explanation

In quantitative finance, overfitting arises when your model’s complexity or number of parameters is too high, capturing noise instead of true market structure.

Impact on the Algorithm/Model

Overfitted strategies may show spectacular backtest returns but fail quickly in live conditions. Realistic forward testing and multiple OOS checks are crucial to confirm a model’s robustness.

Risk Management

Simple Explanation

This covers ways to protect yourself from excessive losses. Commonly:

If you over-leverage and markets swing against you, losses can escalate. Good risk management helps you survive rough periods and preserve capital.

Academic Explanation

Key elements:

Combined, these limit drawdowns and ensure longevity, even amid random market noise.

Impact on the Algorithm/Model

Without robust risk controls, even profitable algorithms can face ruin if they hit a bad streak or a sudden high-volatility event. Effective risk management is essential for consistent returns.

Back to Top