Exemplo n.º 1
0
        public void Get_Positions_From_Github()
        {
            FeedProvider googleFeed = FeedAPIFactory.GetStockFeedFactory(FeedAPIProviders.Google);
            var          symbols    = googleFeed.GetPositions();

            Assert.IsTrue(symbols.Count() > 0);
        }
Exemplo n.º 2
0
        public void Get_Symbols_List_From_Github()
        {
            FeedProvider googleFeed = FeedAPIFactory.GetStockFeedFactory(FeedAPIProviders.Google);
            var          symbols    = googleFeed.GetSymbolsFromList(Lists.Penny);

            Assert.IsTrue(symbols.Length > 0);
        }
Exemplo n.º 3
0
        public void Get_Symbols_Volume_Test()
        {
            string[]     symbols    = new string[] { "GEIG", "VGPR" };
            FeedProvider googleFeed = FeedAPIFactory.GetStockFeedFactory(FeedAPIProviders.Google);
            var          volume     = googleFeed.GetVolume(symbols);

            Assert.IsTrue(true);
        }
Exemplo n.º 4
0
        public void InitChart()
        {
            chart1.Dock = DockStyle.Fill;

            //// fake the DB data with a simple list
            //List<dbdata> k = new List<dbdata> {
            //new dbdata("1/1/2012", 10f, 8f, 9f, 9.5f),
            //new dbdata("2/1/2012", 15F, 10F, 12F, 13F),
            //new dbdata("3/1/2012", 5F, 10F, 8F, 6F),
            //new dbdata("4/1/2012", 25F, 10F, 18F, 16F)
            //};

            Series price = new Series("price"); // <<== make sure to name the series "price"

            chart1.Series.Add(price);

            // Set series chart type
            chart1.Series["price"].ChartType = SeriesChartType.Candlestick;

            // Set the style of the open-close marks
            chart1.Series["price"]["OpenCloseStyle"] = "Triangle";

            // Show both open and close marks
            chart1.Series["price"]["ShowOpenClose"] = "Both";

            // Set point width
            chart1.Series["price"]["PointWidth"] = "2.0";

            // Set colors bars
            chart1.Series["price"]["PriceUpColor"]   = "Green"; // <<== use text indexer for series
            chart1.Series["price"]["PriceDownColor"] = "Red";   // <<== use text indexer for series

            FeedProvider mainProvider = FeedAPIFactory.GetStockFeedFactory(FeedAPIProviders.Google);
            var          GooglePoints = new string[] { QuoteDataPoints.Date, QuoteDataPoints.Open, QuoteDataPoints.High, QuoteDataPoints.Low, QuoteDataPoints.Close, QuoteDataPoints.Volume };
            var          ticks        = mainProvider.GetTicks(new string[] { "TSLA" }, 121, 30, GooglePoints).First();

            int i = 0;

            foreach (var k in ticks.TickGroup.Where(d => d.Date.ToShortDateString().Equals("8/6/2014")))
            {
                // adding date and high
                chart1.Series["price"].Points.AddXY(k.Date, k.High);
                // adding low
                chart1.Series["price"].Points[i].YValues[1] = k.Low;
                //adding open
                chart1.Series["price"].Points[i].YValues[2] = k.Open;
                // adding close
                chart1.Series["price"].Points[i].YValues[3] = k.Close;
                i++;
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// FIRPy Main Starting Point
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            mainProvider = FeedAPIFactory.GetStockFeedFactory(FeedAPIProviders.Google);

            if (args.Length > 0)
            {
                //Penny Stocks
                symbols = mainProvider.GetSymbolsFromList(Lists.Penny);

                try
                {
                    switch (args[0])
                    {
                    //Morning Volume
                    case ("-movo"):
                        MorningVolume();
                        break;

                    //Intraday
                    case ("-intra"):
                        Intraday();
                        break;

                    //Morning Twitter/RSS
                    case ("-motr"):
                        TwitterRSSFeeds();
                        break;
                    }

                    log.Info(string.Format("{0} Ran Successfully", args[0]));
                }
                catch (Exception e)
                {
                    log.Error(string.Format("Error while running {0}:", e.ToString()));
                }
            }
            else
            {
                //Intraday();
                //MorningVolume();
                TwitterRSSFeeds();
                log.Info("FIRPy Ran Successfully");
            }
        }