Click here to Login




How to use the new Market Regimes Feature in QuantShare Trading Software

Updated on 2015-02-27





Say you have a trading system and you want to test it under different market conditions (market bullish/bearish or high/low volatility).
Recently, we make it easy to test a trading system under such market conditions by implementing a new feature called "Market Regimes".

- First, let us open the "Simulator" manager by selecting "Analysis -> Simulator".
- Select a trading system then click on "Backtest".
- In the simulation report, click on the "Regimes" tab
- Click on "Calculate" to test the simulation under different market regimes. The "Annual Return" column will display the annualized return for the strategy if it was traded only during that market regime.
- Now, click on any "Market Regime" to display the equity curve.

That equity curve is calculated by talking the current strategy and removing all trades that were entered outside the selected market regime. After that the equity is rebuilt without these trades.

This new tool allows you to quickly see how your trading system would have performed in the past under different market regimes.




How to create a new trading system with the selected Market regime

When you click on any market regime, you can see a tooltip appearing. The tooltip gives you a description of the market regime, as well as its formula and the ticker symbol used for the calculation.

If you click on "Short-Term Bullish Market" for example, you can see:

^GSPC price (S&P 500) is higher than its 50-bar moving average
Symbol: ^GSPC
Formula:
filter = close > sma(50);

In order to create a new trading system that trades only during the short-term bullish market, you will have to update your original trading system formula.

Say the original formula for your trading system is:

buy = rsi(14) > 70;

The new formula that trades only the bullish market regime would be:

sp = getseries("^GSPC", close); // ^GSPC is the S&P500 index - Yahoo compatible ticker name
filter = sp > sma(sp, 50);

buy = rsi(14) > 70 and filter;


Explanation:

The trading system formula is applied to every security referenced by your strategy ("Symbols & Dates" tab). We need to get the S&P 500 times series first. This can be accomplished using the "GetSeries" function. After that, we need to detect the short-term bullish market regime and this can be done by comparing the S&P 500 price with its 50-bar moving average. Notice how we used the "sp" variable in the "sma" function (Simple moving average).
At the end we just need to add the market regime filter rule to the original buy rule (The one used by the original trading system).


Market Regimes is a new feature and we plan to improve it over time. We will also add more market conditions and the ability to define custom market conditions.












no comments (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.