Click here to Login

Synchronize Buy/Sell List of Rules in the Trading System Optimizer

Updated on 2010-11-02

Tom, one of our users (not his real name), had several list of trading rules and he wanted to use the genetic algorithm optimizer to create a profitable trading strategy.
The trading system optimizer works as follow:
It picks one rule from each list of rules in the buy list and then picks one rule from each list of rules in the sell list. By combining buy rules (AND) and sell rules (OR), the optimizer will then create a trading strategy given the settings you have defined and return the performance of the strategy to the optimizer so it can analyze it and decide whether to use the current combination/trading system to create the next generation of the population.

What Tom wanted is that the optimizer picks a pair of buy-sell rule. For example: if the optimizer selects "close > sma(20)" as a buy rule, he wanted it to automatically select "close < sma(20)" as a sell rule.

Trading System Optimizer

The trading system optimizer is very easy to use. You just need to update the strategy settings, set one or several list of buy rules and one or several list of sell rules.
As we said earlier, the optimizer will simply pick one rule from each list to create a trading system (You can also include system settings and money management variables in the optimization process).

The problem of Tom is that these rules are not linked and consequently the optimizer will simply pick random buy and sell rules. This issue could be solved if we can instruct the genetic algorithm or PBIL (Population based incremental learning algorithm) optimizer to select a particular sell rule for each buy rule. We can for example synchronize two list of rules (one buy and one sell rules) so that if for example the optimizer picks rule number 12 from buy list 1, it must automatically select rule number 12 from sell list 1 (Assuming buy list 1 and sell list 1 are synchronized).

In order for this to work, both list must have the same number of rules and for each buy rule the corresponding sell rule must have the same index in the trading rules list.

Synchronize Buy/Sell List of Rules

Few days after Tom contacted us, we have created the buy-sell rules synchronization feature.

Here is how it works:
After you create a new trading system optimizer and in the "Trading System" panel, you can select the number of buy and sell rules (Genes). For each gene, you must specify one list of rules the optimizer should use to get one single trading rule when creating one chromosome.

To synchronize two trading rules, click on "Select Rules" and associate a list to the first buy Gene, then associate the corresponding sell rules list to the first sell Gene.
Right click on the Gene 1 cell, select "Synchronize with" then choose the first buy rules list.
Next to the cell content, the optimizer tool will add the following text "[SYNC: rule name 1]" to indicate that this list of rules is synchronized with "rule name 1".

Note that you can synchronize two lists of rules only if they have the same number of trading rules.

no comments (Log in)

QuantShare Blog
Search Posts

Recent Posts

Create Graphs using the Grid Tool
Posted 1272 days ago

Profile Graphs
Posted 1377 days ago

Previous Posts

QS Trading Software: Global Script
Posted 4963 days ago

Stock Market Prediction
Posted 4991 days ago

How to search for a trading item
Posted 5012 days ago

More Posts


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.