Click here to Login




How to turn any ordinary trading strategy into a very profitable one

Updated on 2011-05-25





The technique I am going to show you here will allow you to quickly create profitable trading systems that you can convert to portfolios to generate buy and sell signals. It allows you to convert any basic and unprofitable strategy into a profitable one. The technique can be implemented in few minutes and the backtests and optimizations that should be performed later takes from minutes to few hours.


Create a list of rules

First, let us use the List of rules tool to create some indicators and series.
- Select "Analysis" then "Rules Manager"
- Click on "Create" to create a new list of rules
- Type "Timing1" as name then click on "OK".
- Select "Timing1" list then add some series or indicators.

Here are some examples:
close
high - close
sma(close, a) where a varies from 10 to 60 (Step=20)
rsi(14)
rsi(2)
perf(close, a) where a varies from 10 to 60 (Step=20)
Ama(close, 0.4)
AroonOsc(14)
Obv(close, volume)
Bop()

You can create as many indicators as you want, but keep in mind that the more indicators you add the longer the backtests and optimizations will take and the more likely you will highly improve your basic strategy performance.


Create a basic strategy

After we have added some indicators to our "Timing1" list, let us create a basic strategy.

- Select "Analysis" then "Simulator".
- Click on "New" to create a new trading system
- Select "Long" as system type (This technique applies to long only systems) and then select the maximum number of positions in the strategy (Example: 20)
- Select "Create trading system using the formula editor" tab, and then type in the formula of your basic strategy.

Here is an example:
liquidity1 = close > 2 and close*sma(volume, 10) > 50000;
rule1 = perf(close, 10) < -10;
buy = rule1 and liquidity1;
SetSimLongRank(-close*sma(volume, 10));

The strategy consists of:
- Basic liquidity rule
- Simple rule (stock return in the previous 10 bars is lower than -10%)
- Ranking system that ranks stocks based on their 10-Bar trading volume (in dollars)
- 20-Bar Stop.

- Click on "Settings" tab then select your symbols and the start & end dates of the simulation
- Click on "Save Trading System" then click on "Simulate" to start the backtesting process
- After the report is displayed, keep note of your trading system annual return, drawdown and Sharpe ratio


Transform any ordinary strategy into a profitable one

In the simulator manager, select the previously created trading system then click on "Update".

The technique consists of adding a market-timing rule and then testing several variations of this rule. The market rule is based on the composite function "Comp" and on the "PercentRank" technical indicator (It can be downloaded here: Percentile - Percent Rank of a Trading Indicator).
The idea is to create several trading systems where in each one we get an indicator/series from the "Timing1" list of rules that was created earlier, then we apply the "PercentRank" to this indicator and calculate the market average (Average value for all stocks included in the simulation). The result is compared to a threshold value.

Here is how it works:

- We optimize a variable "a". It must vary from zero to (Number of rules in "Timing1" - 1).
Result: Optimize("a", 0, 10, 1);

- We use the "ApplyRule" function to execute a rule/indicator of a specific list of rules
Result: mrule1 = ApplyRule("", "Timing1", a);

- We calculate the "PercentRank" function (Percentage of N-previous values that are below the current value)
Result: percentrank(mrule1, 60) > 50 (Note that the values "60" and "50" can also be optimized)

- We calculate the market average using the composite function
Result: marketrule1 = comp(percentrank(mrule1, 60) > 50, "avg") > 0.5;

- We update our basic trading system and remove the N-Bar stop:

Optimize("a", 0, 10, 1);
mrule1 = ApplyRule("", "Timing1", a);
marketrule1 = comp(percentrank(mrule1, 60) > 50, "avg") > 0.5;

liquidity1 = close > 2 and close*sma(volume, 10) > 50000;
rule1 = perf(close, 10) < -10;

buy = rule1 and liquidity1 and marketrule1;
sell = !marketrule1;

SetSimLongRank(-close*sma(volume, 10));

The "Sell" rule we have added instructs the trading software to exit any position if our market rule is no longer TRUE.


Backtest and Optimization

Once your strategy is updated with the new market rule, select it then click on "Optimize".
Depending on the number of symbols included in the simulation and the number of indicators in your "Timing1" list, the optimization process can take from few minutes to few hours.

After the optimization process is done, select the best strategy based on the annual return, drawdown, Sharpe ratio or your own criteria.


Compare Backtest Results

The basic strategy I have backtested earlier gave me an annual return of 4.23%, a maximum drawdown of -47.65% and a Sharpe ratio of -0.03.

My "Timing1" list contains 11 indicators and after the optimization is completed, the best strategy shows the following results:

Annual Return: 47.2%
Maximum Drawdown: -13.09%
Sharpe Ratio: 2.93
Percent Profitable Months: 64.22%
Percent Profitable Years 100% (out of 10 years)













no comments (Log in)

QuantShare Blog
QuantShare
Search Posts




QuantShare
Recent Posts

Create Graphs using the Grid Tool
Posted 1427 days ago

Profile Graphs
Posted 1532 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.