Click here to Login





                                                   Buy and Sell rules combination in Optimizer.

  0

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
0




Reply:

No html code. URLs turn into links automatically.

Type in the trading objects you want to include: - Add Objects
To add a trading object in your message, type in the object name, select it and then click on "Add Objects"










QuantShare

Trading Items
LSS Pivotal Buy and Sell Numbers - Trend Reaction
Buy Sell Simulation Indicator
Simple pattern detection rules using close and open prices
Buy Low Sell High Screen
Buy low, Sell High

How-to Lessons
How to create trading rules based on Put and Call volume data
Difference between the watchlist and the screener tools
How to download and use U.S. stocks earnings data
How to save and restore charts
How to backup your databases (EOD, Intraday, Tick and Custom) and...

Related Forum Threads
Plot Up/Down Arrows corresponding to buy and sell signals
Setsimtiming -- Buy signal day open and sell signal day close
backtesting, I want to buy and sell only 1 stock for every 5 days...
Using Drawdown in sell rules
Continues Buy / Sell

Blog Posts
How to create buy and sell trading rules based on News Data
Trading System: Moving average crossover and few others buy and s...
How to get buy and sell orders for a portfolio based on a trading...
Forecast volatility using trading rules and neural networks
How to create and backtest thousands of trading rules in less tha...









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.