示例#1
0
        /// <summary>
        /// Add strategy target allocation to plotter. This method should
        /// be called exactly once after the simulation loop finished.
        /// </summary>
        /// <param name="plotter"></param>
        /// <param name="alloc"></param>
        public static void AddTargetAllocation(this Plotter plotter, AllocationTracker alloc)
        {
            plotter.SelectChart(string.Format("{0} as of {1:MM/dd/yyyy}",
                Plotter.SheetNames.HOLDINGS, alloc.LastUpdate), "Name");

            foreach (Instrument i in alloc.Allocation.Keys.OrderByDescending(k => alloc.Allocation[k]))
            {
                plotter.SetX(i.Name);
                plotter.Plot("Symbol", i.Symbol);
                plotter.Plot("Allocation", string.Format("{0:P2}", alloc.Allocation[i]));
            }
        }
示例#2
0
 /// <summary>
 /// Add new row with strategy target allocation to plotter. This
 /// method should be called once for every time the strategy submits 
 /// orders to adjust the target allocation.
 /// </summary>
 /// <param name="plotter"></param>
 /// <param name="alloc"></param>
 public static void AddTargetAllocationRow(this Plotter plotter, AllocationTracker alloc)
 {
     // TODO: write historical allocations here
 }