Click here to Login

How to perform a basic quantitative analysis using the S&P 500

Updated on 2011-06-10 05:14:00

Share |

The number of times the S&P 500 crossed above its moving average and the average performance during the next 10 bars. In this post, we will show you how to create and backtest this trading pattern.


- Select "Analysis" then "Rules Manager"
- Create a new list of rules then add the following rule: Cross(close, sma(close, 10))
(Close price crosses above its 10-Bar moving average)
- Click on "Analyze the list"
- Select the Start & End dates then add "^GSPC" (ticker symbol of the S&P 500) in the Symbols Panel.
- Select "Outputs" then click on "Select Outputs/Exit rules"
- Select "Performance, use N-Bar..." then add the following output: Buy then sell after 10 bars
- Click on "Ok" then "Continue" to start the simulation process

The Quantitative Analysis shows that:
- This pattern occurred 132 times
- The average output/return for the next 10 bars is 0.027%
- The percent of positive positions is 53.03%

Important Note:

Patterns that occur while a position is not yet closed are not counted. This means that if at T-10, a pattern occurs then a T-12 another pattern occurs, the second one will be ignored because the holding period of a position, as specified in the output form, is equal to 10. Only patterns that occur at or after T-20 are counted.

no reviews (Log in)

Other how-to articles

How to plot a stock using different periods in the same chart

How to get stocks for a particular index using the global script

How to debug a trading system using the money management tool

How to calculate the average of a time series using the money management tool

How to display the number of notes per stock

How to add a metric in the trading system simulation report

How to plot the number of stock tweets per day

How to draw an horizontal segment line using QS language

How to quickly select stocks based on the last value of a database field

Create an account
Affiliate Program
Contact Us
Trading Forum
How-to Lessons
About Us
Terms of Use

Copyright 2024
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
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.