Beispiel #1
0
        private TradingBotBase[] GetTradingBots()
        {
            var tradingBotInvestor = new TradingBotInvestor(InitMoney, BrokerFee);
            var tradingBotSimple   = new TradingBotSimple(InitMoney, BrokerFee);
            //   var tradingBotClassic = new TradingBotClassic(InitMoney, BrokerFee);

            var tradingBots = new TradingBotBase[] { tradingBotInvestor, tradingBotSimple }; // , tradingBotClassic };

            return(tradingBots);
        }
Beispiel #2
0
        public void GetBestLimits()
        {
            var price = new FilePrices("intraday.generated.txt");

            List <aaa> l = new List <aaa>();

            TradingBotSimple tradingBotSimple;


            for (int b = 0; b < 20; b++)
            {
                //int s = 3;
                for (int s = 0; s < 10; s++)
                {
                    tradingBotSimple = new TradingBotSimple(InitMoney, BrokerFee);
                    tradingBotSimple.BuyLimitPercent  = (decimal)b / 10;
                    tradingBotSimple.SellLimitPercent = (decimal)s / 10;


                    Calculate(price, tradingBotSimple);
                    var a = new aaa
                    {
                        b     = b,
                        s     = s,
                        total = tradingBotSimple.Total
                    };
                    l.Add(a);
                }
            }

            foreach (var ff in l.OrderBy(x => x.total))

            {
                Console.WriteLine($"total={ff.total} b={ff.b} s={ff.s}");
            }
        }