Пример #1
0
 public Portfolio(Framework framework, string name = "")
 {
     this.framework            = framework;
     this.name                 = name;
     this.account              = new Account(framework);
     this.fills                = new FillSeries(name);
     this.positions            = new List <Position>();
     this.positionByInstrument = new IdArray <Position>(1000);
     this.pricer               = framework.portfolioManager.pricer;
     this.performance          = new PortfolioPerformance(this);
     this.statistics           = new PortfolioStatistics(this);
 }
Пример #2
0
 public Portfolio(Framework framework, string name = "")
 {
     this.framework = framework;
     this.name = name;
     this.account = new Account(framework);
     this.fills = new FillSeries(name);
     this.positions = new List<Position>();
     this.positionByInstrument = new IdArray<Position>(1000);
     this.pricer = framework.portfolioManager.pricer;
     this.performance = new PortfolioPerformance(this);
     this.statistics = new PortfolioStatistics(this);
 }
Пример #3
0
 private void WriteDataToCsv(StreamWriter sw, PortfolioPerformance portfolioPerformance)
 {
   string listSeparator = Thread.CurrentThread.CurrentCulture.TextInfo.ListSeparator;
   sw.WriteLine(string.Format("DateTime{0}Equity{0}Drowdawn", (object) listSeparator));
   for (int index = 0; index < portfolioPerformance.EquitySeries.Count; ++index)
   {
     string str = string.Format("{1}{0}{2}{0}{3}", (object) listSeparator, (object) portfolioPerformance.EquitySeries.GetDateTime(index), (object) portfolioPerformance.EquitySeries[index], (object) portfolioPerformance.DrawdownSeries[index]);
     sw.WriteLine(str);
   }
 }
Пример #4
0
 private void CopyDataToWorksheet(Worksheet sheet, PortfolioPerformance portfolioPerformance)
 {
   int num = 2;
   Range range1 = sheet.GetRange(1, 1);
   range1.Bold = true;
   range1.Value = (object) "DateTime";
   Range range2 = sheet.GetRange(1, 2);
   range2.Bold = true;
   range2.Value = (object) "Equity";
   Range range3 = sheet.GetRange(1, 3);
   range3.Bold = true;
   range3.Value = (object) "Drowdawn";
   for (int index = 0; index < portfolioPerformance.EquitySeries.Count; ++index)
   {
     sheet.GetRange(num + index, 1).Value = (object) portfolioPerformance.EquitySeries.GetDateTime(index).ToString();
     sheet.GetRange(num + index, 2).Value = (object) portfolioPerformance.EquitySeries[index];
     sheet.GetRange(num + index, 3).Value = (object) portfolioPerformance.DrawdownSeries[index];
   }
 }