T29 Entry Signal Analyzer
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.
Designing a trading strategy entails putting these components together into a system.
The ESA is intended to be an entry signal analyzer. Meaning it's intended as a tool to test the edge of the entry signal component of the trading systems on its own in isolation as much as possible. Isolation meaning that you remove any trade management, signal based exits, etc.
Its intended for answering the questions - how strong is the signal (how much does it go in my favor vs against me) and, how long does it last? Once you start adding exit criteria you start adding an exit component to that which important and useful but was it takes the tool in a different direction and closer to a backtest territory.
Fast results, easy to execute
Another tool in a traders tool box, is not a replacement for a full backtest.
Related Reading Material
The approach of analyzing entry signal edge was motivated by the books below.
“Building Winning Algorithmic Trading Systems”, Kevin J. Davey
“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.
This section focuses on explaining how trades are simulated.
The objective of simulating a trade is to determine two things:
The entry point (bar and price)
The exit point (bar and price)
I.e., we want to know the bar and price at which we entered and the bar and price at which we exited. With those at hand, we can then proceed to calculate the trade result such as PnL, MFE/MAE, duration, etc.
How is the entry determined?
The entry is assumed to be the signal bar.
Price wise, users can simulate an entry at the Close of the signal bar or the open of the signal
Close of the signal - simulate as if we entered at the close of the signal price
Open of the next bar - simulate as if we entered at the open of the next bar
How is the exit determined?
Each trade can exit in 3 possible ways
Time based, exit after X bars
Profit target hit
Stop loss hit
Which ever one of these is triggered first will end the trade.
For example, say you have set a target of 10 points, stop of 10 points and 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
Holding Time Start (in Bars)
Holding Time Step (in Bars)
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
Process all signals on the chart
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)
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.
The signal reference are simply subgraphs that signal an entry signal.
Sierra Chart provides multiple methods to create these signals, for example:
Spreadsheet formulas
Color Bar Based Alert studies
ACSIL based custom studies
You can reference studies and subgraphs that you create yourself or you receive from someone else.
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