コード例 #1
0
        static void Main(string[] args)
        {
            TradingBotContext ctx = new TradingBotContext();

            Console.WriteLine(string.Format("Trading bot started at {0}", DateTime.Now));

            //check cash status, if first time loaded give us 1000
            var cashman = new CashManager(ctx);

            //get today's top movers
            var topmovers = new TopMovers(ctx);

            //buy what we can from the top movers.
            var stockAgent      = new StockAgent(ctx);
            var ownedstockAgent = new OwnedStockAgent(ctx);


            //Sell any left over stocks. - recalc to ensure we don't sell any false stock numbers
            ownedstockAgent.BuildPortfolioFromTransactions();
            stockAgent.SellOldStocks();

            stockAgent.PurchaseNewMovers(cashman.AvailableBalanace());
        }
コード例 #2
0
ファイル: CashManager.cs プロジェクト: w1r2p1/TradingBot
 public CashManager(TradingBotContext ctx)
 {
     _ctx = ctx;
     CheckStatus();
 }
コード例 #3
0
 public TopMovers(TradingBotContext ctx)
 {
     _ctx = ctx;
     _url = "https://finance.yahoo.com//screener/predefined/";
     FetchMovers();
 }