Click here to Login




Short Index - Part 2

Updated on 2010-03-02





The Short Index or Short Ratio Index is an index that uses short selling data downloaded by Short Selling Data and built using the composite plug-in of this trading software.

This post describes all the steps you need to perform in order to create the Short Index composite. The whole process can be divided into three parts. The first part, which consists of selecting ticker symbols, was described in the first post Short Index - Part 1. The second and third parts will be described in the next paragraph.

Before continuing please read the first post, create a new composite, select ticker symbols and then go to the "formula" view.
In the "formula" control, we need to create three composite variables. The first one will contain the sum of short volume of all U.S. securities; the second will contain the sum of long and short volume of all U.S. securities and the third will get for each trading day the number of stocks that have short selling data.

Here is the formula:



"GetData" is a vector-based function that gets time-series data from a custom database.
A composite can be created by assigning a vector to the "composite" variable or by using the "AddComposite" function. In our case, there are several composites so we have to use the "AddComposite" function.

Click on the "Script" button. We can retrieve a previously created composite variable (with the vector-based language) using the "Functions.GetVariable" function.
Example:
double[] shortdata = Functions.GetVariable("short");

The above function will return a time-series that contains the total short volume for all stocks and for each date. For each array index, you can get the corresponding date by retrieving the dates array using the "Functions.GetDates()" function.

The following script needs to be added to your composite:




The function "Functions.SetCompositeData" sets the data that will be associated to the Short Index composite.
The "total" variable is calculated simply by dividing the short volume by the total volume. The calculation is performed only if, on a specific date, more than 100 stocks have short selling data.
Using the "Functions.SetCompositeDataInVolumeField" function, we assign the "count" variables to the "volume" field of the Short Ratio Index composite.

Close the script form and click on "Next". Set the composite name to "Short Index" and click again on "Next".
As soon as the composite calculation finishes, a new symbol called "_Short_Index" is created.

The composite is available for download here Short Ratio Index











no comments (Log in)

QuantShare Blog
QuantShare
Search Posts




QuantShare
Recent Posts

Create Graphs using the Grid Tool
Posted 1239 days ago

Profile Graphs
Posted 1344 days ago

QuantShare
Previous Posts

Short Index - Part 2
Posted 5168 days ago

Short Index - Part 1
Posted 5175 days ago

Historical Market Data
Posted 5196 days ago

Historical volatility estimators
Posted 5209 days ago

Short Selling Stocks
Posted 5217 days ago

Stock split & dividend
Posted 5223 days ago

Survivorship bias
Posted 5230 days ago

Transaction Costs
Posted 5238 days ago

How to simulate options strategies
Posted 5252 days ago


More Posts

Back







QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2024 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items



Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.