Ejemplo n.º 1
0
        protected override void engine_Complete(RunWorkerCompletedEventArgs e)
        {
            //_resultsModel.Clear();
            var newResults = TradeResult.ResultsFromTradeList(_tradeList);

            _tradeList.Clear();
            var results          = Results.FetchResults(newResults, _rfr, _comm, engine_MessageUpdate);
            var darkLightResults = new DarkLightResults(results);

            _optimizationResults.Add(new PlottableValue <DarkLightResults> {
                X = xValue, Value = darkLightResults
            });

            _updatePlots();

            if (e.Error != null)
            {
                engine_MessageUpdate(e.Error.Message + e.Error.StackTrace);
                engine_StatusUpdate("Terminated because of an Exception.  See messages.");
            }
            else if (e.Cancelled)
            {
                engine_StatusUpdate("Canceled play.");
            }
            else
            {
                string playToString = _engineInfo.PlayToString;
                engine_StatusUpdate("Reached next " + playToString + " at time " + KadTime);
            }
        }
Ejemplo n.º 2
0
        public static Results GetResults(string name, List <Trade> trades, DebugDelegate gotDebug, decimal riskFreeRate = .01m, decimal commissionPerShare = .01m)
        {
            name = Path.GetFileNameWithoutExtension(name);
            List <TradeResult> newResults;

            if (trades.Count == 0)
            {
                gotDebug("No results found for: " + name);
                newResults = new List <TradeResult>();
            }
            else
            {
                newResults = TradeResult.ResultsFromTradeList(trades);
            }
            return(FetchResults(newResults, riskFreeRate, commissionPerShare, gotDebug));
        }
Ejemplo n.º 3
0
        public DataTable RunResults(string name, List <Trade> trades)
        {
            name = System.IO.Path.GetFileNameWithoutExtension(name);
            List <TradeResult> newResults;

            if (trades.Count == 0)
            {
                debug("No results found for: " + name);
                newResults = new List <TradeResult>();
            }
            else
            {
                newResults = TradeResult.ResultsFromTradeList(trades);
            }
            FillDataTableWithResults(Results.FetchResults(newResults, _rfr, _comm, debug));
            return(_resultsTable);
        }
        void PlayComplete(object sender, RunWorkerCompletedEventArgs e)
        {
            //_resultsModel.Clear();
            var newResults = TradeResult.ResultsFromTradeList(_tradeList);
            var results    = Results.FetchResults(newResults, _rfr, _comm, debug);

            _onCompleted(results);

            if (e.Error != null)
            {
                debug(e.Error.Message + e.Error.StackTrace);
                status("Terminated because of an Exception.  See messages.");
            }
            else if (e.Cancelled)
            {
                status("Canceled play.");
            }
            else
            {
                status("Reached next " + _playTo.ToString() + " at time " + KadTime);
            }
        }