コード例 #1
0
ファイル: ShortPosition.cpp プロジェクト: dailypips/hudson
double ShortPosition::factor( const boost::gregorian::date_period& dp, EODDB::PriceType pt ) const throw(PositionException)
{
  // Verify that input period is contained within position holding period
  if( ! hold_period().contains(dp) )
    throw PositionException("Requested factor period is out of Position range");

  return Price::get(_symbol, dp.begin(), pt) / Price::get(_symbol, dp.end(), pt);
}
コード例 #2
0
		string ToString() { return CombineString(Currency.ToString(), DespoitType.ToString(),
									date::to_iso_string(Period.begin()), date::to_iso_string(Period.end()),
									date::to_iso_string(LastUpdateDate));
		}