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

[amibroker] How to Optimize an AddToComposite



PureBytes Links

Trading Reference Links




Dimitris, Chuck 
and Junya,
<FONT color=#000080 
size=2> 
I found a way to 
optimize an AddToComposite in another way.  Instead of using 
AddToComposite, do this:
(this is a 
modification of my code to simplify it for illustration purposes.  There 
may be coding errors)
<FONT color=#000080 
size=2> 
This counts the 
number of stocks above or below the MACD Signal line.
<FONT 
color=#000080 size=2>Per1 = 5; Per2 = 8;Per1 = Optimize("Per1", Per1, 3, 13, 
2);Per2 = Optimize("Per2", Per2, 3, 13, 2);
C = Foreign("AA", "C", Fixup = 
True);Bullish=MACD(Per1,Per2) >= 
Signal(Per1,Per2);ZL = IIf(bullish==1, <SPAN 
class=830280618-07052003>1, <SPAN 
class=830280618-07052003>-1)<SPAN 
class=830280618-07052003>MyComposite = <SPAN 
class=830280618-07052003>MyComposite + ZL;
C = Foreign("<SPAN 
class=830280618-07052003>AXP", "C", Fixup = 
True);Bullish=MACD(Per1,Per2) >= 
Signal(Per1,Per2);ZL = IIf(bullish==1, <SPAN 
class=830280618-07052003>1, <SPAN 
class=830280618-07052003>-1)<SPAN 
class=830280618-07052003>MyComposite = <SPAN 
class=830280618-07052003>MyComposite + ZL;
 
Repeat for each 
stock in the watchlist you want to scan.
One can then use 
MyComposite as if it were a real "~MyComposite" data file.
And one can 
optimize as shown in the top lines.
One would insert 
the BUY/SELL lines after this code.
<FONT color=#000080 
size=2> 
It can also be 
used in IB to plot the MyComposite results in real time without having to run a 
SCAN.
<FONT color=#000080 
size=2> 
A little awkward 
but with cut and paste, the code can be setup pretty fast.
 
 
<FONT face="Vladimir Script" color=#000080 
size=5>Rick

  <FONT face=Tahoma 
  size=2>-----Original Message-----From: Chuck Rademacher 
  [mailto:chuck_rademacher@xxxxxxxxxx]Sent: Tuesday, May 06, 2003 
  3:00 PMTo: amibroker@xxxxxxxxxxxxxxxSubject: RE: 
  [amibroker] Optimizing AddToComposite
  <FONT face=Arial color=#0000ff 
  size=2>G'day, Rick.
  <FONT face=Arial color=#0000ff 
  size=2> 
  I'm 
  not sure how you could determine the best to use, but you could do six 
  runs at once by using the O,H,L.C.V and OI fields in your composite to hold 
  the results from six different periods.   This might not be the 
  answer you are looking for, but it may give you an idea.
  <BLOCKQUOTE 
  >
    <FONT face="Times New Roman" 
    size=2>-----Original Message-----From: Rick Parsons 
    [mailto:RickParsons@xxxxxxxxxxxxxxx]Sent: Tuesday, May 06, 2003 
    2:53 PMTo: amibroker@xxxxxxxxxxxxxxxSubject: 
    [amibroker] Optimizing AddToComposite
    I have a 
    system similar to Dimitri's Trade the Market where I use AddToComposite to 
    count the number of stocks above or below the MACD Signal 
    line.
    <FONT color=#000080 
    size=2> 
    Question is, 
    what is the best MACD period to use?  It is very cumbersome to change 
    the periods, run the Scan to create an AddToComposite, then backtest 
    it.
    <FONT color=#000080 
    size=2> 
    Does anyone 
    have a creative idea on how to "optimize" the periods used to create the 
    AddToComposite?
    <FONT color=#000080 
    size=2> 
    <FONT color=#000080 
    size=2>Thanks,
    <FONT face="Vladimir Script" color=#000080 
    size=5>Rick
     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. 
    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. 







Yahoo! Groups Sponsor


  ADVERTISEMENT









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.