The rules analyzer is a great tool to conduct statistical data analysis and studies; it let you easily analyze time series behavior after specific patterns.
You define the pattern, select symbols and a start and end period and choose the output. These are all the necessary steps you need to do in order to perform your time series statistical analysis.
But these are just the basics; you can create much more advanced studies with the help of custom outputs and custom metrics.
Let us start with the basics.
First of all you need a pattern or a trading rule (or many). It could be indicators crossing or anything else. Letís take the moving average crossing for example: sma(close, 20) > sma(close, 50).
Choose the symbols to include in the analysis and set the start and end period. You can select an index, a stock, a list of stocks, a currency or any other time series.
Finally select an output. The simplest output would be the symbols return after a fixed period; that is, calculating the returns of the symbols from the bar where the pattern occurs to a fixed future bar.
You can choose between a long and a short output, where the long output will simulate a buy at open on the pattern bar+1 and a sell at open on the pattern bar + a fixed number of bars and the opposite for the short output.
A bit more advanced output, would be to set the output as the symbols return with the use of a trailing stop.
You also need to know that the output is not limited to analyzing symbols return; it can analyze everything, from future volatility to the likelihood of an event to occur in the future.
Examples of custom outputs:
Future volatility: Analyze and measure the market or securities future volatility (the time-horizon could be defined in the output) after a defined pattern.
Earning surprise: Analyze the stocks future movement after an earnings release.
Future liquidity: Study the change in liquidity that could happen in any security after a specific pattern.
Options: Simulate an option strategy (the output will be the option strategy return).
Levels: Calculate and estimate the likelihood that a security crosses one or many levels after a specific pattern.
As you can see, you can define any kind of output and the possibilities are limitless.
After running the analyzer, the software will compile a list of statistical metrics for each trading signal or pattern and displays the result in a grid.
Here is a small list of available statistical metrics:
Number of output: the number of the occurrence of the pattern in the time series.
Average output: The average output of this statistical study.
PP: The percentage of positive outputs.
SDV: The standard deviation of the output values.
In addition to these statistical metrics and some other pre-calculated ones, you can create any metric from the scripting language or you can download the ones created by other users.
Note also that when analyzing the data, you have the possibility to select more than one output.
In a future post, we will discuss how to create custom metrics and how to optimize patterns in this statistical data analysis tool.