Using Technical Analysis Indicators in Backtesting

This topic contains 0 replies, has 1 voice, and was last updated by Seer Seer 6 years, 7 months ago.

Viewing 1 post (of 1 total)
  • Author
  • #619

    Technical analysis indicators are at the heart of any trading system, charts and in some cases other indicators. An indicator at the rawest form is simply a mathematical formula that generates one or more columns from a source set of columns, typically the Open, Close, High, Low and Volume. For more information on columns and how they relate to Seer, see Key concepts, Event programming.


     Technical Analysis Indicators source code, ADX
    The source code of the ADX indicator
    Many of the default set of Indicators such as Lowest, Highest, EMA and others are internal to Seer itself, while others such as RSI, OBV and ADX are built using standard Seerscript. The source code for these Indicators can found under the indicators folder in the main treeview. There is no difference between how both these sets of indicators are used and called.



    Basic usage

    Using an indicator is simple, just use the name of the indicator and pass any required parameters. All indicators return one or more columns.

    For example, if you wanted to use the Exponential Moving Average on the Close column:



    Many indicators accept columns as parameters such as the EMA above, which can be the result of other indicators. For example, you could create a Simple Moving average of an Exponential Moving Average:



    Some indicators such as ADX, MACD and BB return more than one column. In the case of the ADX, it returns 3 columns the ADX line, the DI+ and the DI-. When you use the ADX in scalar context, only the first Column (ADX line) is returned, for example, if you wanted to create an EMA of the ADX line you would simply do:



    If you want to use the other columns the (DI lines) you have to use the indicator in list context:


    my ($adx,$up,$down)=ADX(14);

    In this case, the three variables contain the ADX line, the DI+ and the DI-. For example, say you wanted to calculate the EMA of the DI+ line:


    my ($adx,$up,$down)=ADX(14);


    Extracting values from Columns

    In many cases you’ll just use the Column that is returned from an indicator, but sometimes you’ll want to extract and use specific values. The most common example is extracting the value from the current bar:



    The function Now returns the value for the current bar. The Now function is a synonym of the function Today – both return the same value and can be used interchangeably.

    Two other ways of returning values from the column are Previous (a synonym of Yesterday) and Ago:


    #returns the value of the previous bar for the 9 bar EMA of the Close


    #returns the value of the 9 bar EMA of the Close 5 bars ago


    Why use Technical Analysis Indicators?

    Performance wise, using indicators is extremely efficient – Seer uses a cashing formula where it is able to detect whether it has calculated an indicator before. If Seer has calculated the indicator, it is reused rather than recalculated. You should always use an indicator if you can.

    Using Technical Analysis indicators is also a good way of encapsulating logic as stand alone units. Many complex trading systems often have components that can converted into Indicators, this reduces the complexity of the system, improves performance, encourages code reuse but most importantly it isolates components so that they can be easily tested and verified.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.