This is a trading item or a component that was created using QuantShare by one of our members.
This item can be downloaded and used by QuantShare Trading Software.
Trading items are of different types. There are data downloaders, trading indicators, trading systems, watchlists, composites/indices...
You can use this item and hundreds of others for free by downloading QuantShare.
Top Reasons Why You Should Use QuantShare:
Works with US and international markets (stock, forex, options, futures, ETF...)
Offers you the tools that will help you become a profitable trader
Allows you to implement any trading ideas
Exchange items and ideas with other QuantShare users
Our support team is very responsive and will answer any of your questions
We will implement any features you suggest
Very low price and much more features than the majority of other trading software
The current algorithm calculates the mathematical combination element given the lexicographical index. The function gets several string values separated by a semi-colon, a value to test, the number of values per combination and the combination index (or what is called lexicographical index).
To understand the usefulness of this function, here is an example that lets you test several stock combinations. The function returns 1 or TRUE if a specific stock or ETF symbol is found in a combination element, otherwise it returns 0 or FALSE.
- The values to be passed to the function are A;AA;B;C;GOOG;MSFT;AAPL (Stock symbols separated by a comma)
- The value to be test is the current stock symbol (The stock that is currently tested in the analyzer, simulator or screener). To get the current stock symbol, we use the function: Name()
- The number of values per combinations (K) is set to 3
Given a K value of 3 and an N value of 7 (7 stock symbols passed in the first argument of our function), the total number of combinations is: 35
By passing a lexicographical index of 34, the function calculates the combination string (GOOG;MSFT;AAPL) and tests whether the stock symbol provided in the second argument of our function is included in this string. In case we are analyzing Citigroup Inc. (C), the response is no and the trading function returns 0.
If we vary the lexicographical index from 0 to 34, we can test all stock names combinations. In a trading system, the formula may look like this:
An example of using this function is to test a strategy that combines different ETF or Stock symbols to check which combination of assets perform best.
Note: You can get the total number of combinations by setting the lexicographical index to -1.