[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: Help on automating optimization (genetic algorithms)



PureBytes Links

Trading Reference Links

Gary,
The procedure you describe does not make any sense.
In the simple example
x=Optimize("x",10,10,100,10);
b=Optimize("b",10,10,50,10);
s=Optimize("s",50,50,90,10);
Buy=Cross(StochD(x),b);
Sell=Cross(s,StochD(x));
the optimal solution is [30,20,80]
If I optimize first the x, ie
x=Optimize("x",10,10,100,10);
b=10;//Optimize("b",10,10,50,10);
s=50;//Optimize("s",50,50,90,10);
Buy=Cross(StochD(x),b);
Sell=Cross(s,StochD(x));
[optimal x=80]
then the b, ie
x=80;//Optimize("x",10,10,100,10);
b=Optimize("b",10,10,50,10);
s=50;//Optimize("s",50,50,90,10);
Buy=Cross(StochD(x),b);
Sell=Cross(s,StochD(x));
[optimal b=10]
and finally the s, ie
x=80;//Optimize("x",10,10,100,10);
b=10;//Optimize("b",10,10,50,10);
s=Optimize("s",50,50,90,10);
Buy=Cross(StochD(x),b);
Sell=Cross(s,StochD(x));
[optimal s=90]
I will have the [80,10,90] solution, which is far from the actual 
optimal [30,20,80]
Unfortunately, the optimal[x,b,s] *is not* the optimal[optimal[optimal
[x],b],s], consequently this procedure is wrong from the beginning.
There is no chain rule for composite optimizations and you will have 
very few probabilities to find the optimal.
Another basic issue: You do not even have the
optimal[optimal[x],y] equal to optimal[optimal[y],x] 
property, both will be far from the optimal[x,y] and you can not even 
interchange the priorities.

Herman,
The results of cascade optimizations will not give the optimal 
result, even if you save some time. As for this last property, I do 
not think you save any time, optimization is an internal loop, as far 
as I understand...
Dimitris Tsokakis


--- In amibroker@xxxxxxxxxxxxxxx, "Herman vandenBergen" <psytek@xxxx> 
wrote:
> You can optimize using for() loops and examples of this method have 
been
> posted on the list. This would allow you to optimize one parameter 
first in
> the first loop-optimization and then go on the the next loop-
optimization
> using the result of the first loop-optimization in your 
calculations. This
> way you will save lots of time and you can optimize an unlimited 
number of
> parameters without looking at billions of iterations.
> 
> happy tinkering,
> herman.
> 
> 
>   -----Original Message-----
>   From: Gary A. Serkhoshian [mailto:serkhoshian777@x...]
>   Sent: November 13, 2003 7:00 AM
>   To: amibroker@xxxxxxxxxxxxxxx
>   Subject: [amibroker] Help on automating optimization (genetic 
algorithms)
> 
> 
>   Hi all,
> 
>   I should preface this e-mail by saying that I'm not trying to 
create a
> Rube Goldberg as I can go through the process ourlined below 
manually.  So,
> if what I'm suggesting requires a Rube Goldberg type solution let 
me know,
> and I'll let it go.
> 
>   Essentially what I'm doing with optimizations over multiple 
variables is
> prioritizing variables on importance, and optimizing one variable 
at a time
> leaving the others static.  I just keep iterating through all the 
variables
> until things stabilize in terms of standard measures.  The cocktail 
party
> term is genetic algorithms, but between us it's necesary as 
optimizing over
> multiple variables (4+)  will either take too long or worse cause 
AmiBroker
> to crash due to memory issues.
> 
>   Here's the punchline.  Can you all give some input on ways to 
program this
> in afl so as to automate the process outlined above rather than me 
manually
> iterating through as it is labor intensive.
> 
>   Many thanks,
>   Gary
> 
> 
> --------------------------------------------------------------------
--------
> --
>   Do you Yahoo!?
>   Protect your identity with Yahoo! Mail AddressGuard
>   Send BUG REPORTS to bugs@xxxx
>   Send SUGGESTIONS to suggest@xxxx
>   -----------------------------------------
>   Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
>   (Web page: http://groups.yahoo.com/group/amiquote/messages/)
>   --------------------------------------------
>   Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> 
>   Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service.


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/