Пример #1
0
        private List <InstrumentRecommendation> GetRecommendationFromInstrument(Instrument InstrumentToProcess)
        {
            List <InstrumentRecommendation> InstrumentRecommendations = new List <InstrumentRecommendation>();

            OnSystemNotification(new IMPSystemNotificationEventArg
            {
                Message = string.Format("{0} - combining trading info about {1}", PROCESSNAME, InstrumentToProcess.Name)
            });

            m_oSA = ImperaturGlobal.Kernel.Get <ISecurityAnalysis>(new Ninject.Parameters.ConstructorArgument("Instrument", InstrumentToProcess));

            if (m_oSA.HasValue) //&& m_oSA.Instrument != null && m_oSA.QuoteFromInstrument != null)
            {
                InstrumentRecommendations.Add(
                    new InstrumentRecommendation
                {
                    InstrumentInfo         = InstrumentToProcess,
                    ExternalSearchHits     = m_oRSS.GetOccurancesOfString(SearchPlaces, new string[] { InstrumentToProcess.Name, InstrumentToProcess.Symbol }),
                    VolumeIndication       = m_oSA.GetRangeOfVolumeIndicator(DateTime.Now.AddDays(-50), DateTime.Now).Last().Item2,
                    TradingRecommendations = m_oSA.GetTradingRecommendations()
                });
            }

            return(InstrumentRecommendations);
        }