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

[amibroker] Re: Max simultaneous open positions



PureBytes Links

Trading Reference Links

We upgrade to 4.88 and then go from there....
////////////////////////////////////////////////////////////
  // Finalize backtester up here

  // CALCULATE CUSTOM METRICS

  // simultaneous open trades
  sot = 0;
  for( trade = bo.GetFirstTrade(); trade; trade = bo.GetNextTrade() )
  {
    ted = DateTimeConvert( 0, trade.EntryDateTime );
    txd = DateTimeConvert( 0, trade.ExitDateTime );
    sot = IIf( ( ted <= dn ) AND ( txd >= dn ), sot + 1, sot );
    hsot = LastValue( Highest( sot ) );
  } // for trade


  // REPORT CUSTOM METRICS
  bo.AddCustomMetric( "Highest simultaneous open trades", hsot, 0, 0, 0 );
////////////////////////////////////////////////////////////


Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.13/632 - Release Date: 1/16/2007 4:36 PM