You have too many "Ref".  Drop the -5.

Bill
  ----- Original Message ----- 
  From: droskill 
  To: [email protected] 
  Sent: February 13, 2010 5:03 PM
  Subject: [amibroker] Re: Wall Steet Journal on System Investing


  For some bizarre reason I'm having trouble duplicating his results.  It 
looks, from his example - like his requirements are that:

  C < Ref(C,-1) AND Ref(C,-1) < Ref(C,-2) AND Ref(C,-3) < Ref(C,-4) AND 
Ref(C,-4) < Ref(C,-5);

  And yet, this does not give the entry outlined in AKAM on the date.

  For reference - here's the description (the picture shows the C < O on all 
days):

  Akamai (AKAM). Oct. 28, 2009 (on the close) to Nov. 3, 2009 (on the close)

  Akamai shares fell four days in a row - from  a close of $21.60 on Oct. 22 to 
to $20.16 on Oct. 28 close where the system enters the position. Then, on Nov. 
2 and 3 the stock was up two days in a row, closing at $22.56 on Nov. 3, 2009, 
where the system exits the position for a gain of 11.71%

  So I added a condition - a requirement that the close is lower than the open 
on all days.

  Buy = C < Ref(C,-1) AND C < O AND Ref(C,-1) < Ref(C,-2) AND Ref(C,-1) < 
Ref(O,-1) AND Ref(C,-3) < Ref(C,-4) AND Ref(C,-3) < Ref(O,-3) AND Ref(C,-4) < 
Ref(C,-5) AND Ref(C,-4) < Ref(O,-4);

  And this still did not get the right entry.

  I get an entry on 10/26/09 - but looking at the chart I can see the candles 
in that timeframe have days where C is clearly greater than the O (which should 
be ignored if I've coded this right).

  The rules, as he describes them:

  Rule of the 4×2 System:

  Buy: If a stock goes down for four days in a row, buy at the close of the 
fourth day.

  Sell: If a stock you own in the 4×2 system goes up for two days in a row, 
sell at the close of the second day.

  What am I missing?

  --- In [email protected], Bob Waits <bobwai...@...> wrote:
  >
  > Very interesting article in WSJ
  > 
  > http://bit.ly/cs0ZnU
  >




  ------------------------------------

  **** IMPORTANT PLEASE READ ****
  This group is for the discussion between users only.
  This is *NOT* technical support channel.

  TO GET TECHNICAL SUPPORT send an e-mail directly to 
  SUPPORT {at} amibroker.com

  TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
  http://www.amibroker.com/feedback/
  (submissions sent via other channels won't be considered)

  For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
  http://www.amibroker.com/devlog/

  Yahoo! Groups Links



Reply via email to