#twitter-follow { border: 0;position: fixed; top: 240px; left:0;} #live-support { border: 0;position: fixed; top: 370px; left:0;} #knowledge-base { border: 0;position: fixed; top: 170px; left:0;}

 Buy and Sell rules combination in Optimizer. Back to threads - Tags: Optimizer 0

 antoni 2012-05-24 10:25:04 Hi, I have a question. In Optimizer/GA, I try to optimize a list buy ruless and a list of sell rules. I want see the relation between rules and the result of diferent combination of rules. (buy= rule1 and rule2...; buy =rule1 or rule2....; etc) The problem is that the optimizer only analize the combination of buy rules with the operator AND, but in the sell rules allways use the operator OR. How to see all possible combinations?, ie using AND and OR in both types of rules (rules of buying and selling)
 QuantShare 2012-05-24 13:33:18   1 Hi Antoni, Buy rules always use the AND operator and sell rules uses the OR operator. Currently, it is not possible to change that. It is however possible to use the OR operator with buy rules and AND operator with sell rules by using the "ApplyRule" function. - You have to optimize a trading system ("using optimize variables in a formula") - Set up your formula like the following: c1 = ApplyRule("", "List of rules 1", -1); // Get number of rules c2 = ApplyRule("", "List of rules 2", -1); // Get number of rules c3 = ApplyRule("", "List of rules 3", -1); // Get number of rules Optimize("a1", 0, c1- 1, 1); // Create optimizable variable Optimize("a2", 0, c2- 1, 1); Optimize("a3", 0, c3- 1, 1); rule1 = ApplyRule("", "List of rules 1", a1); // Apply a rule rule2 = ApplyRule("", "List of rules 2", a2); rule3 = ApplyRule("", "List of rules 3", a3); buy = rule1 or rule2 or rule3; More info can be found here: http://www.quantshare.com/sa-352-how-to-choose-which-technical-indicators-to-use-in-your-trading-system
 antoni 2012-05-25 04:10:09   0 Thanks, I can`t use "optimize variables in a formula" because the system crash (the system is frozen). I think that I have too many variables or optimizations.
 QuantShare 2012-05-25 07:35:48   0 Try reducing the number of rules in your list of rules. If this doesn't work, please send your optimize item file to support@quantshare.com. We will check it. Select "Help -> Trading Object Paths" to get the file location Also, send the last trace files (You can find them in "Trace" directory)
 antoni 2012-05-26 05:47:09   0 In the example, C1 = ApplyRule("", "List of rules 1", -1); // Get number of rules c2 = ApplyRule("", "List of rules 2", -1); // Get number of rules c3 = ApplyRule("", "List of rules 3", -1); // Get number of rules Optimize("a1", 0, c1- 1, 1); // Create optimizable variable Optimize("a2", 0, c2- 1, 1); Optimize("a3", 0, c3- 1, 1); rule1 = ApplyRule("", "List of rules 1", a1); // Apply a rule rule2 = ApplyRule("", "List of rules 2", a2); rule3 = ApplyRule("", "List of rules 3", a3); buy = rule1 or rule2 or rule3; Are There a maximum in the number of the "optimize (,,,)" that can you use?
 QuantShare 2012-05-26 08:28:13   0 No, you can call the "optimize" method as many times as you want. However, optimizations will add up quickly and you may run out of memory.
 antoni 2012-05-30 05:53:10   0 Hello QuantShare, Are there any other compiler or systems editor? When I call the optimize method more the seven-nine times the system can`t compile and the system crash. Besides, when I use applyrule method using a list of rules with optimizable variables the system also crash.
 QuantShare 2012-05-30 06:38:50   0 The system crashes certainly because you are creating +millions of optimizations. Please send us your formula and list of rules at support at quantshare.com so that we can check it. Select "Help -> Trading Object Paths -> List of Rules" to get the location of your list of rules.
 antoni 2012-05-30 09:06:06   0 However, In the AI>optimizer>Tranding system>Using buy and sell rules (GA) I canīt using ilimitades optimizations. However, in this way can not be used to cover short rules.Besides, the rules always use the operator Buy and sell rules and using the OR operator. I suggest removing these limitations. This would be a very powerful tool. Thanks and forgive me for my English.
 antoni 2012-05-30 09:06:55   0 Best Answer Set as the best answer However, In the AI>optimizer>Tranding system>Using buy and sell rules (GA) I can use ilimitades optimizations. However, in this way can not be used to cover short rules.Besides, the rules always use the operator Buy and sell rules and using the OR operator. I suggest removing these limitations. This would be a very powerful tool. Thanks and forgive me for my English.
 QuantShare 2012-05-30 10:01:24   1 Thank you for the suggestion. I will add this to the todo list.
 QuantShare 2012-07-17 18:53:01   1 This feature was implemented in the last version.
No more messages