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

[amibroker] Alter PointValue() in AFL - not working



PureBytes Links

Trading Reference Links

Hi,

I'm using the Custom Backtester Code to alter PointValue for each 
trade. I intend to alter the PointValue for each trade according to 
Equity and a few other calculations.

I tried the code below and it isn't working. I'm setting PointValue 
to an arbitary number (300) just to test the code, and plotting the 
PointValue to see the output.

Can anyone suggest - thanks.


SetCustomBacktestProc(""); 

if( Status("action") == actionPortfolio )
{
  bo = GetBacktesterObject();
  bo.PreProcess();
  for( bar = 0; bar < BarCount; bar++ )
  {
   CurrentPortfolioEquity = bo.Equity;
   for( sig = bo.GetFirstSignal( bar ); sig; sig = bo.GetNextSignal( 
bar ) )
    {
    sig.PointValue = 300;
    }
   bo.ProcessTradeSignals( bar );
  }
  bo.PostProcess();
}

Plot(PointValue,"PV",colorGreen,styleDots|styleOwnScale);



Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.441 / Virus Database: 268.17.37/682 - Release Date: 2/12/2007 1:23 PM