コード例 #1
0
        public static decimal GetPortfolioPlot(string title, decimal start, int startdate, int starttime, int enddate, int endtime, List <Trade> trades, ref ChartControl c)
        {
            var cureq = start;

            if (trades.Count == 0)
            {
                return(GetPortfolioPlot(title, start, startdate, starttime, enddate, endtime, ref c));
            }
            c.NewBarList(new BarListImpl(title));
            var tradessorted = SortTrades(trades);

            c.newPoint(title, cureq, 0, tradessorted[0].xdate, 100);
            // plot money made
            PositionTracker pt = new PositionTracker();

            foreach (var t in tradessorted)
            {
                var pl = pt.Adjust(t);
                cureq += pl;
                c.newPoint(title, cureq, t.xtime, t.xdate, 100);
            }
            c.redraw();
            // set final equity
            return(cureq);
        }
コード例 #2
0
        private static decimal GetPortfolioPlot(string title, decimal staticequity, int startdate, int starttime, int enddate, int endtime, ref ChartControl c)
        {
            var cureq = staticequity;

            c.NewBarList(new BarListImpl(title));
            // plot static line
            c.newPoint(title, cureq, starttime, startdate, 100);
            c.newPoint(title, cureq, endtime, enddate, 100);
            c.redraw();
            // set final equity
            return(cureq);
        }
コード例 #3
0
ファイル: TradeResults.cs プロジェクト: bluejack2000/core
 private static decimal GetPortfolioPlot(string title, decimal staticequity, int startdate, int starttime, int enddate, int endtime, ref ChartControl c)
 {
     var cureq = staticequity;
     c.NewBarList(new BarListImpl(title));
     // plot static line
     c.newPoint(title, cureq, starttime, startdate, 100);
     c.newPoint(title, cureq, endtime, enddate, 100);
     c.redraw();
     // set final equity
     return cureq;
 }
コード例 #4
0
ファイル: TradeResults.cs プロジェクト: bluejack2000/core
 public static decimal GetPortfolioPlot(string title,decimal start, int startdate, int starttime, int enddate, int endtime, List<Trade> trades, ref ChartControl c, decimal compershare)
 {
     var cureq = start;
     if (trades.Count == 0)
         return GetPortfolioPlot(title,start, startdate, starttime, enddate, endtime, ref c);
     c.NewBarList(new BarListImpl(title));
     var tradessorted = SortTrades(trades);
     c.newPoint(title, cureq, 0, tradessorted[0].xdate, 100);
     // plot money made
     PositionTracker pt = new PositionTracker();
     foreach (var t in tradessorted)
     {
         var grosspl = pt.Adjust(t);
         var netpl = grosspl - (compershare * Math.Abs(t.xsize));
         cureq += netpl;
         c.newPoint(title, cureq, t.xtime, t.xdate, 100);
     }
     c.redraw();
     // set final equity
     return cureq;
 }