Create a stock index or a trading indicator using the composite tools

Post on: 11 Июнь, 2016 No Comment

Create a stock index or a trading indicator using the composite tools

Create a stock index or a trading indicator using the composite tools

Updated on 2010-06-15

There are two tools in QuantShare that at the first glance seem to perform the same task. Although it is true that these tools have the same name and have a lot of things in common, each one can perform things that are impossible for the other to do. These tools are the composite/index plug-in and the composite function.

In this post, we will describe and introduce each tool and enumerate each one’s advantages.

The composite plug-in was developed first. Its main role is to create composites and indices using quotes and/or databases’ data. Before creating a composite, you will have to open a form, add ticker symbols, formula, calculation method and some other optional settings. Once the composite is created, its data is associated with a ticker symbol; you can later display the symbol’s data, reference it into formulas and use it to create trading rules.

The composite function doesn’t contain any forms, controls or buttons. It simply consists of a powerful vector-based function that you can use to create rules based on aggregate data of several securities (quotes, technical indicators, fundamental data. ). With a single line, you can for example instruct the trading software to create a trading system that buys stocks when the difference between their close price and moving averages is two time higher the standard deviation of the same formula for all US stocks.

Advantage of the composite plug-in:

  • It associates the index or composite data with a ticker symbol and therefore you can plot quotes data as you do with any stock, currency or futures contract. Example, you can calculate then plot the advance-decline market breadth indicator for all stocks or only for stocks that are part of the Dow Jones Index
  • It lets you create complex indices using the .Net programming language. You can for example calculate several composites within the same item and use the c# language to create an indice based on these composites
  • Advantage of the composite function:

      Create a stock index or a trading indicator using the composite tools
    • It requires only one line of code and can be easily used to create trading rules
  • It allows you to calculate the maximum, minimum, average, sum, count and standard deviation of all stocks and for each trading day
  • It lets you group data by any criteria. You can for example calculate the number of stocks within the same industry that crossed their moving average during the last 5 days. The values returned by the composite function will be different for stocks that are not in the same industry
  • You can reference an external list of symbols; the calculation will be based on this list and not on the list of symbols you are analyzing (Example: The list of stocks you are backtesting). Example: While backtesting stocks that trade in the US Stock Market, you can create a rule based on the aggregate data of FOREX or options symbols. Or you can backtest small cap stocks and use the function to create rules based on S&P 500 stocks
  • It allows you to calculate the percentile or rank of a stock for any given formula. Example: To buy stocks that are in the top 10% percentile for the relative strength index (RSI) technical indicator, you can simply type the following formula: comp(rsi(14), percentile) >= 90
  • The main disadvantage of this function is that it can be used only by some plug-ins (Rules Analyzer, Ranking System Analyzer, Screener, Simulator, and Portfolio). You cannot use it for example to display data on a chart. The watch list plug-in cannot use it either.

    To summarize, both tools allow you to create composites. While the main role of the first one is to analyze and display composites data, the second composite (function) is usually used to create trading rules. The latter let you also calculate the percentile and rank of an instrument for any given formula.


    Categories
    FOREX  
    Tags
    Here your chance to leave a comment!