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

RE: [amibroker] AB 4.33 beta: AMAZING looping enhancement!



PureBytes Links

Trading Reference Links


<FONT 
size=2>[Graham] Is this the 
formula you are referring to?
<SPAN 
> 
<SPAN 
>No, it is 
a little more sphisticated: the subject was "Atc Loop Demo", posted Sat 
2003-04-26 12:30 PM. I tried to attach it but I got some kind of error - 
see afl attached. Mind you that the example posted previously just 
gives you the frame work: the sample trading system must be substituted with 
your own trading system. The attached system is far simpler and would execute 
much faster. Haven't tried that one.
<SPAN 
><FONT color=#0000ff 
size=2> 
<SPAN 
>Good 
luck,
<SPAN 
><FONT color=#0000ff 
size=2>Herman.
<SPAN 
> 

  <FONT face=Tahoma 
  size=2>-----Original Message-----From: Graham 
  [mailto:gkavanagh@xxxxxxxxxxxxx]Sent: April 28, 2003 8:48 
  AMTo: amibroker@xxxxxxxxxxxxxxxSubject: RE: [amibroker] 
  AB 4.33 beta: AMAZING looping enhancement!
  
  <SPAN 
  >Is this the formula you are 
  referring to?
  <SPAN 
  >bestequity = <FONT 
  color=fuchsia size=1><SPAN 
  >0<FONT color=black 
  size=1>;bestrange = 
  <SPAN 
  >0<FONT color=black 
  size=1>;
  <SPAN 
  >// 
  optimization loop
  <SPAN 
  >for<FONT 
  color=black size=1>( range = 
  <SPAN 
  >12<FONT color=black 
  size=1>; range < 
  <SPAN 
  >40<FONT color=black 
  size=1>; range ++ 
  ){
  <SPAN 
  >  Buy<FONT 
  color=black size=1> = 
  <SPAN 
  >Cross<FONT color=black 
  size=1>( <SPAN 
  >Close, <FONT color=blue 
  size=1>EMA<FONT 
  color=black size=1>( <SPAN 
  >Close, range ) );
  <SPAN 
  >  
  Sell<SPAN 
  > = <FONT color=blue 
  size=1>Cross<FONT 
  color=black size=1>( 
  <SPAN 
  >EMA<FONT color=black 
  size=1>( <SPAN 
  >Close, range ), <SPAN 
  >Close );
  <SPAN 
  > Le<FONT 
  color=black size=1> 
  =<SPAN 
  > 
  <SPAN 
  >LastValue<FONT 
  face="Courier New" color=black size=1><SPAN 
  >(<FONT 
  color=black size=1> 
  <SPAN 
  >Equity<FONT color=black 
  size=1>()<FONT 
  face="Courier New" color=black size=1><SPAN 
  > 
  )<SPAN 
  >;
  <SPAN 
  >  
  if<SPAN 
  >( <FONT 
  face="Courier New" color=black size=1><SPAN 
  >Le<FONT 
  color=black size=1> > 
  bestequity )  { <FONT face="Courier New" 
  color=black size=1><SPAN 
  >   
  bestequity = Le;   bestrange = 
  range; }<SPAN 
  >}
  <SPAN 
  >range = 
  bestrange;
  <SPAN 
  >Buy<FONT 
  color=black size=1> = 
  <SPAN 
  >Cross<FONT color=black 
  size=1>( <SPAN 
  >Close, <FONT color=blue 
  size=1>EMA<FONT 
  color=black size=1>( <SPAN 
  >Close, range ) );
  <SPAN 
  >Sell<FONT 
  color=black size=1> = 
  <SPAN 
  >Cross<FONT color=black 
  size=1>( <FONT 
  color=blue size=1><SPAN 
  >EMA<FONT color=black 
  size=1>( <SPAN 
  >Close, range ), <SPAN 
  >Close );
  <SPAN 
  >Filter<FONT 
  face="Courier New" color=black size=1><SPAN 
  > = 
  <SPAN 
  >BarIndex<FONT 
  face="Courier New" color=black size=1><SPAN 
  >() == 
  BarCount - <FONT 
  face="Courier New" color=fuchsia size=1><SPAN 
  >1<FONT 
  face="Courier New" color=black size=1><SPAN 
  >;
  <SPAN 
  >AddColumn<FONT 
  face="Courier New" color=black size=1><SPAN 
  >( 
  bestrange, <SPAN 
  >"Best 
  range"<SPAN 
  > 
  );
  <SPAN 
  >AddColumn<FONT 
  face="Courier New" color=black size=1><SPAN 
  >( 
  <SPAN 
  >Equity<FONT 
  face="Courier New" color=black size=1><SPAN 
  >(), 
  <SPAN 
  >"Best 
  Equity"<SPAN 
  > 
  );
  <SPAN 
  > 
  
  <FONT face="Times New Roman" color=teal 
  size=3><SPAN 
  >Cheers,Graham
  <FONT 
  face="Times New Roman" color=#339966 size=2><SPAN 
  ><A 
  href=""><SPAN 
  >http://groups.msn.com/ASXShareTrading
  <FONT 
  face="Times New Roman" color=#339966 size=2><SPAN 
  ><A 
  href=""><SPAN 
  >http://groups.msn.com/FMSAustralia
  <SPAN 
  >-----Original 
  Message-----From: Herman 
  vandenBergen [mailto:psytek@xxxxxxxx] <SPAN 
  >Sent: Monday, 28 April 2003 8:36 
  AMTo: Amibroker@xxxxxxxxxxxx 
  ComSubject: [amibroker] AB 
  4.33 beta: AMAZING looping enhancement!
  <FONT face="Times New Roman" 
  size=2> 
  
  <FONT face=Arial 
  color=blue size=2><SPAN 
  >I just have to share 
  my excitement with you. The latest AB beta release features phenomenal looping 
  improvements; the result of extremely clever memory management - as I 
  understand it. Look at the before and after 
  performance:
  
  <FONT face="Times New Roman" 
  size=2> 
  
  <FONT face=Arial 
  color=blue size=2><SPAN 
  >A before test 
  of 35 loops, at which point my computer ran into memory problems at about 
  1200 Seconds: 
  
  <P class=MsoNormal 
  ><FONT 
  face="Times New Roman" size=2><SPAN 
  ><IMG height=274 
  src="jpg00128.jpg" width=407 align=baseline 
  border=0><FONT face=Arial 
  color=blue>Below a AB 4.33 
  beta test showing system optimization utilizing loops in an 
  Exploration. The very first version of this program took hours to 
  optimize, now i can optimize entire baskets of stocks and save all optimized 
  parameters automatically in a file for recall from disk by the systems code 
  (see example code posted a few days ago on this procedure). 
  <SPAN 
  >You don't have to 
  wait for built-in Individual Optimizing of Baskets of stocks capability: 
  you have it right now.<FONT face=Arial 
  color=blue> All this shows you 
  that it is worth your while to spend a few hours reading up on 
  looping!  
  
  <SPAN 
  ><IMG height=305 
  src="jpg00129.jpg" width=450 align=baseline 
  border=0>
  
  <FONT face=Arial 
  color=blue size=2><SPAN 
  >Best 
  regards,
  
  <FONT face=Arial 
  color=blue size=2><SPAN 
  >Herman
  
  <FONT face="Times New Roman" 
  size=2> 
  <FONT face="Times New Roman" 
  size=2><SPAN 
  ><FONT 
  face="Courier New">Send BUG REPORTS to bugs@xxxxxxxxxxxxx<FONT 
  face="Courier New"><FONT 
  face="Courier New">Send SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx<FONT 
  face="Courier New">-----------------------------------------<FONT 
  face="Courier New">Post AmiQuote-related messages ONLY to: 
  amiquote@xxxxxxxxxxxxxxx (Web 
  page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)<FONT 
  face="Courier New">--------------------------------------------<FONT 
  face="Courier New">Check group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  Your use of Yahoo! Groups is subject to 
  the Yahoo! Terms of 
  Service. 
  Send 
  BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx-----------------------------------------Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  Your use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 

--- Begin Message ---
To: "Amibroker@xxxxxxxxxxxx Com" <amibroker@xxxxxxxxxxxxxxx>
Subject: [amibroker] Atc Loop Demo
From: "Herman vandenBergen" <psytek@xxxxxxxx>
Date: Sat, 26 Apr 2003 12:29:48 +0800
Importance: Normal
List-unsubscribe: <mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx>
Reply-to: <amibroker@xxxxxxxxxxxxxxx>





DT Challenged me for 
a loop demo :-) so here is one, attached.
<SPAN 
class=780001204-26042003> 
This shows how to 
optimize a system using loops, substitute your own trading system and vary the 
parameter's function and values. This was my first application for testing the 
new looping function. Here I use a Loop in an Exploration to optimize the 
system to three degrees. As i go along I save the best Equities obtained with 
the 2nd and 3rd opt parameters in a stock-specific Calibration file - using the 
AddToComposite(). I read back the data from the Composite and display the 
results in The result table.
<SPAN 
class=780001204-26042003> 
The lower part is 
repeats the trading system and shows how you can read back parameters and use 
them into your system.
<SPAN 
class=780001204-26042003> 
Throughout you will 
find some tricks, such as to display zero-based exploration data at the 
current date range in your result table.
<SPAN 
class=780001204-26042003> 
Now you ask: why do 
all this work? Some reasons:
<SPAN 
class=780001204-26042003> 
1) You can backtest 
groups of stocks and save their individual optimization values (somebody wished 
for this on the list)
2) You don't ever 
have to type in optimized values, they are read from your 
disk.
3) Opt1 in the 
Optimization part is, in this demo, assigned to a period, but it could just 
as well be the value of a trend indicator. This would allow you to create 
calibration values to perform under various trending conditions. You would 
optimize a large number of stocks and create (automatically) a calibration file 
for each stock. Then when you are using your trading system you would obtain the 
Opt1 from your trending indicator and based on it, you would select the other 
two parameters. What do you have: an adaptive trading 
system.
<SPAN 
class=780001204-26042003> 
Have fun, I hope 
some others can explain any questions that may come up. I have to get back to 
another project :-)
<SPAN 
class=780001204-26042003> 
best 
regards,
<SPAN 
class=780001204-26042003>Herman.
<SPAN 
class=780001204-26042003> 
Ps. If you click the 
Check button you'll get a Look-Ahead error, I believe this is due to the using 
the Atc. The trading system is incidental anyway - you should substitute your 
own!







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 the Yahoo! Terms of Service.



Attachment:
AtcLoopDemo.afl
Description: Binary data

Attachment: Description: "Description: Binary data"

Attachment: Description: "AtcLoopDemo.afl"

Attachment: Description: "Attachment:"

Attachment: Description: "--- End Message ---"