Click here to Login




Optimizing the Strategy Equity Curve

Updated on 2016-05-09





In the previous article (Trading the strategy equity curve), we explained how you can combine different trading systems to create a meta-strategy then trade each system's equity curve using the QuantShare programming language.

In this article, we will show you how you can optimize your meta-strategy and backtest multiple combinations.


Optimize Variables

We already saw in the previous article how to create a meta-strategy formula that exists any strategy/equity curve whose drawdown drops below -15%.

Let us see now how we can optimize that drawdown threshold and see if we can improve our meta-strategy overall performance by varying the drawdown threshold.

The original formula was:

d = drawdown() * 100;
buy = d > -15;
sell = d <= -15;


We should now update it to:

Optimize("dt", 5, 50, 5);
d = drawdown() * 100;
buy = d > -dt;
sell = d <= -dt;


The first line creates an optimizable variable that starts from 5 and increases by 5 until it reaches 50.
The third and fourth lines uses the optimizable "dt" variable instead of the fixed value 15.

After you save your meta-strategy, click on the "Optimize -> Exhaustive Optimization" button at the top to generate 10 different backtests, each one with a different drawdown threshold.


Optimize Strategies Selection

We are referring here to the ability to combine different systems together and see which combination works best.

This type of combination is very easy to implement:

- Click on the "Add/Remove Trading Systems" (after you create or update a meta-strategy)
- Check the trading systems you want to include in the meta-strategy
- Click on "Load Checked Item(s)"
- Check the "Optimize Strategies Selection" checkbox at the bottom
- Type the number of (unchecked) strategies to invest it

If you type, let us say three, then QuantShare will create all combinations that consist of investing in three different trading systems among all the systems you previously added.
If you check any of the strategies, then that strategy will be always included in the meta-strategy backtest and will not be included in the optimization.


Optimize Trading Systems' Weights

You can also optimize each trading system's weight.

When you create or update a trading system, you can define the relative weight of each system by typing the appropriate value under the "Relative Weight" column.
If for one or several strategies, you want to test different weights then simply type different values separated by semi-colons. Example: 5;10;20


Optimize Money Management Variables

As you probably know, you can also create custom money management scripts for your meta-strategies. Just keep in mind that instead of trading securities, you are trading strategies (equity curve) here.
In the money management script, you can also define optimizable variables and optimize them as you would do with a single trading system.

For more information on how to optimize money management scripts, please check the following blog posts:
Money Management: Optimize the scale-in strategy
Money Management: Scale-in Trading Strategy


It is important to note that all these different optimizations will be combined. This means that if you create optimizable variables that would generate 100 combinations, enable strategies selection (50 combinations as an example) then create three different weights for two of your strategies (3*3 = 9 combinations) then the total number of meta-strategy backtest QuantShare will perform is (100 * 50 * 9 = 45,000 backtests).

      











no comments (Log in)

QuantShare Blog
QuantShare
Search Posts




QuantShare
Recent Posts

Create Graphs using the Grid Tool
Posted 1479 days ago

Profile Graphs
Posted 1584 days ago

QuantShare
Previous Posts

Trading the Strategy Equity Curve
Posted 3179 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.