Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

Mechanical trading systems have many components. The common components usually include entry signals, exit signals, trade management actions like moving stops or moving targets, scaling in, scaling out, position sizing, profit targets, bar period, market traded, trading times of day and so on.

...

Fast results, easy to execute

Part of the Another tool in a traders tool box, is not a replacement for a full backtest.Evaluating the effectiveness of the entry signal on its own

Related Reading Material

...

The approach of analyzing entry signal edge was motivated by the books below.

  • “Building Winning Algorithmic Trading Systems”, Kevin J. Davey

ESA Workflow

For each iteration

  1. Process all signals on the chart

  2. For each signal, based on the settings, simulate a trade execution and calculate the results for that trade (i.e., the PnL, MFE/MAE for that trade)

  3. Once all signals on the chart are processed, tally the results and post aggregated results to the summary table

Defining Iterations

  • “Way of the Turtle”, Curtis Faith

They both provide good insight into strategy development methodology and how entry edge analysis fits into that process.

Trade Simulation

For each signal on the chart a trade is simulated and the results summarized.

...

Which ever one of these is triggered first will end the trade.

For example, say we are you have set a target of 10 points, stop of 10 points and a the max trade duration is 10 bars.

If the trade does not hit the target or stop within 10 bars the trade ends and the results are calculated as if we had flattened after 10 bars in the trade.

If for example the trade hits the target before the 10th bar, then the trade ends at that point and the results calculated accordingly.

Calculated Results

Entry Price - the entry price of the trade

Exit Price - the exit price of the trade

PnL - the pnl of the trade. Users can set to have this presented in ticks or points.

MFE - max favorable excursion. The maximum amount that price has moved in our direction during the trade

MAE - max adverse excursion. The maximum amount that price moved against us during the trade.

Edge Score - calculated as MFE / MAE. A score greater than 1 means that the MFE is greater than the MAE, in effect, price moves more in your favor then against you and implies that there is edge to the entry. In other words, score above 1 is good, score below 1 is not so good.

R - the initial risk of the trade. This value only makes sense when the stop exit is enabled. It is the distance between the entry and the stop in ticks or points.

R multiplier - is calculated by taking the PnL and deviding by R. The ratio gives an indication of risk reward. For example, if the stop is set to 10 points, that means that R is 10 points (i.e., the initial risk on the trade is 10 points) and the resulting pnl was 20 points, R multiplier would be 2. That means that the gain on this trade was twice the risk.

Settings

  • Long/Short Subgraphs

  • Entry Price

  • Exit Price

  • Renko Uses Renko Open/Close

  • Holding time settings

  • Stop settings

  • Target settings

  • Trade window settings

Holding Time and Iterations

The ESA does X iterations where the number of iterations is determined by the “Holding Time” settings.

The holding time is the max number of bars to stay in the trade before exiting. For example, if the holding time is 10 bars, each every trade will exit after 10 bars (unless it hits the stop or target before 10 bars in which case it will exit earlier).

Users set the range of holding time values to test for. There are 3 settings that control this

  1. Holding Time Start (in Bars)

  2. Holding Time Step (in Bars)

  3. Holding Time End (in Bars)

Example1

Start is 2 bars

Step is 2 bars

End is 10 bars

This translates to running 5 iterations with 5 holding periods, namely 2,4,6,8,10

In other words, ESA will run 5 backtests, one for each holding period.

In this example, the summary table will show 5 rows, 1 row per iteration

...

Example2

Looking at another example

Start: 10

Step: 10

End: 100

This will create 10 iterations, 10, 20, 30….100

ESA Workflow

For each iteration

  1. Process all signals on the chart

  2. For each signal, based on the settings, simulate a trade execution and calculate the results for that trade (i.e., the PnL, MFE/MAE for that trade)

  3. Once all signals on the chart are processed, tally the results and post aggregated results to the summary table

Signal References

The study requires a long signal reference and a short signal reference.

...

You can reference studies and subgraphs that you create yourself or you receive from someone else.

Summary table

...

Viewing Trades For a Specific Iteration

...

Exporting Trades for a Specific Iteration

The summary table displays the results for each simulation. To export the trades of that simulation, right click the row and “Export Trades”. This will save the list of trades in csv format.

...

You can then open the csv in Excel and it should look something like this

...