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

RE: [amibroker] Adding Buy & Hold Metric to backtest



PureBytes Links

Trading Reference Links

DM --If you want to see how your entire portfolio would perform, buy and
hold, you can use AddToComposite() function, often called ATC on this
board.  This will take a little study on your part but will be worth
every minute and then some.  BTW, you can multiply each 'Array' in ATC by
the number of shares purchased to get results in $,   If you are using
data corrected for dividends and stock splits, you will have to keep your
number of shares up to date manually.-- Keith

  -------------- Original message --------------
  From: "Paul Ho" <paultsho@xxxxxxxxxxxx>

  Just copy and paste from Tomasz's forumla on individual equity .....

  if( ParamToggle("Show Buy-and-Hold?", "No|Yes", 1) )

  {

  /* now buy and hold simulation */

  Short=Cover=0;

  Buy=Status("firstbarintest");

  Sell=Status("lastbarintest");

  SetTradeDelays(0,0,0,0); PositionSize = -100;

  ApplyStop(0,0,0,0);

  ApplyStop(1,0,0,0);

  ApplyStop(2,0,0,0);

  Plot( Equity( 0, -2 ), "Buy&Hold", -9 );

  }


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

  From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On
  Behalf Of dmcleod1981
  Sent: Saturday, 17 February 2007 3:31 AM
  To: amibroker@xxxxxxxxxxxxxxx
  Subject: [amibroker] Adding Buy & Hold Metric to backtest

  I may be using the wrong key words when I am searching but I can't
  find
  any previous samples that show how to add the buy and hold return
  during the back test period. If someone has any snippets or can
  reference a post number I would be greatful.

  Thanks
  DM

Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.441 / Virus Database: 268.18.1/690 - Release Date: 2/16/2007 2:25 PM