Beispiel #1
0
        /// <summary>
        /// Creates a market recommendation using a fully sequential operation
        /// </summary>
        /// <returns>A market recommendation</returns>
        public MarketRecommendation DoAnalysisSequential()
        {
            StockDataCollection nyseData =
                LoadNyseData();
            StockDataCollection nasdaqData =
                LoadNasdaqData();
            StockDataCollection mergedMarketData =
                MergeMarketData(new[] { nyseData, nasdaqData });
            StockDataCollection normalizedMarketData =
                NormalizeData(mergedMarketData);
            StockDataCollection fedHistoricalData =
                LoadFedHistoricalData();
            StockDataCollection normalizedHistoricalData =
                NormalizeData(fedHistoricalData);
            StockAnalysisCollection analyzedStockData =
                AnalyzeData(normalizedMarketData);
            MarketModel modeledMarketData =
                RunModel(analyzedStockData);
            StockAnalysisCollection analyzedHistoricalData =
                AnalyzeData(normalizedHistoricalData);
            MarketModel modeledHistoricalData =
                RunModel(analyzedHistoricalData);
            MarketRecommendation recommendation =
                CompareModels(new[] { modeledMarketData,
                                      modeledHistoricalData });

            return(recommendation);
        }
Beispiel #2
0
 StockAnalysisCollection AnalyzeData(StockDataCollection data)
 {
     if (cts.Token.IsCancellationRequested)
     {
         return(null);
     }
     return(MarketAnalyzer.Run(data));
 }
Beispiel #3
0
 /// <summary>
 /// Normalize stock data.
 /// </summary>
 StockDataCollection NormalizeData(StockDataCollection marketData)
 {
     SampleUtilities.DoCpuIntensiveOperation(2.0 * speedFactor, cts.Token);
     if (cts.Token.IsCancellationRequested)
     {
         return(null);
     }
     else
     {
         return(new StockDataCollection(marketData));
     }
 }
 public static StockAnalysisCollection Run(StockDataCollection data)
 {
     return new StockAnalysisCollection(new List<StockAnalysis>());
 }   
 StockAnalysisCollection AnalyzeData(StockDataCollection data)
 {
     if (cts.Token.IsCancellationRequested)
         return null;
     return MarketAnalyzer.Run(data);
 }
 /// <summary>
 /// Normalize stock data.
 /// </summary>
 StockDataCollection NormalizeData(StockDataCollection marketData)
 {
     SampleUtilities.DoCpuIntensiveOperation(2.0 * speedFactor, cts.Token);
     if (cts.Token.IsCancellationRequested)
         return null;
     else
         return new StockDataCollection(marketData);
 }