Click here to Login




How to create market indicators using the composite function - Part 3

Updated on 2010-08-31





The "Avg" calculation method, along with the "Rank" and "Percentile", are probably the most important calculation methods for the composite function. You can read more about the first method here (Market Indicators 2), however for the two others (rank and percentile), you will have to wait a few weeks for another part of this how to create market indicators using the composite function post series. In the first post we have introduced the "Count" and "Sum" function (Market Indicators).

There are some other methods that can be also important and very useful in certain situations. These methods allow you to calculate the maximum value for each bar and given an indicator or time series applied to several securities, the minimum value and the standard deviation of the values that occurred during the same date.

Here is an example on how it works:
Given the following formula:
Comp(rsi(14), "Max")

And the following Relative Strength Index values:
GOOG
10/05/2010 – 40
11/05/2010 – 42
12/05/2010 - 50
MSFT
10/05/2010 – 30
11/05/2010 – 48
12/05/2010 - 42
C
10/05/2010 – 41
11/05/2010 – 40
12/05/2010 - 39

Our composite formula will return the following values:
Max Composite Indicator:
10/05/2010 - 41 (This is because on 10/05/2010, 41 was the highest value)
11/05/2010 – 48
12/05/2010 - 50

Example of market indicators:

Comp(perf(close, 1), "Max")
A trading indicator that calculates the maximum stock increase from previous close, among all stocks in your list of symbols.

Comp(perf(close, 1), "Min")
A market indicator that is similar to the one described above with the difference that it calculates the minimum stock increase from the previous close instead of the maximum increase.

Comp(perf(close, 1), "Sdv")
This trading indicator calculates the standard deviation of the different one-bar stock's returns that occurred on the same date. This is a measure of the volatility of these populations; the market indicator will show you how the volatility of the one-bar stock's returns evolve over time.

We can also add another composite in order to calculate the z-score or standard score of the one-bar return of each stock.
The calculation requires that we also calculate the mean of the population and this can be done using the "Avg" calculation method.

So, here is the complete formula:
pe = perf(close, 1);
zscore = pe - Comp(pe, "Avg");
zscore = zscore / Comp(pe, "Sdv");


Through this series of posts, we have already presented six calculation methods that allow you to create divers and powerful market trading indicators. Stay tuned as we will introduce you two very powerful functions, the "rank" and "percentile", in the next post.











one comment (Log in)

QuantShare Blog
QuantShare
Search Posts




QuantShare
Recent Posts

Create Graphs using the Grid Tool
Posted 1233 days ago

Profile Graphs
Posted 1338 days ago

QuantShare
Previous Posts

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.