public void Should_Create_speech_trade()
        {
            var time = DateTime.Now;

            var evtList = new List <EconomicEvent>
            {
                new EconomicEvent {
                    Currency = "USD", DateTime = time.AddMinutes(20)
                },
                new EconomicEvent {
                    Currency = "CHF", DateTime = time.AddMinutes(30)
                }
            };

            var creator = new OrderCreator();
            var lst     = creator.CreateOrdersFromEvents(evtList);

            Assert.IsTrue(evtList.First().IsSpeechOrMeeting);

            var config = lst.First().Config;

            Assert.AreEqual(-1, config.MinutePendingExecution);
            Assert.AreEqual(30, config.MinuteExpiracy);
            Assert.AreEqual(250, config.Range);
            Assert.AreEqual(200, config.StopLoss);
            Assert.AreEqual(150, config.TakeProfit);
        }
        public void Should_create_different_order()
        {
            var time = DateTime.Now;

            var evtList = new List <EconomicEvent>
            {
                new EconomicEvent {
                    Currency = "USD", DateTime = time.AddMinutes(20), Previous = "123"
                },
                new EconomicEvent {
                    Currency = "CHF", DateTime = time.AddMinutes(30), Previous = "123"
                }
            };

            var creator = new OrderCreator();
            var lst     = creator.CreateOrdersFromEvents(evtList);

            Assert.AreEqual(2, lst.Count);

            var config = lst.First().Config;

            Assert.AreEqual(-1, config.MinutePendingExecution);
            Assert.AreEqual(10, config.MinuteExpiracy);
            Assert.AreEqual(50, config.Range);
            Assert.AreEqual(200, config.StopLoss);
            Assert.AreEqual(150, config.TakeProfit);
        }
        public void PrepareEconomicEvents()
        {
            var time = DateTime.Now;

            var evtList = new List<EconomicEvent>
            {
                new EconomicEvent { Currency = "USD", DateTime = time.AddMinutes(20), Previous = "33" },
                new EconomicEvent { Currency = "CHF", DateTime = time.AddMinutes(30), Previous = "33" },
                new EconomicEvent { Currency = "USD", DateTime = time.AddMinutes(40), Previous = "33" },
                new EconomicEvent { Currency = "USD", DateTime = time.AddMinutes(40), Previous = "33" }
            };

            var creator = new OrderCreator();
            mboxList = creator.CreateOrdersFromEvents(evtList);
        }
        public void Should_Create_speech_trade()
        {
            DateTime time = DateTime.Now;

            var evtList = new List<EconomicEvent>
                {
                    new EconomicEvent {Currency = "USD", DateTime = time.AddMinutes(20)},
                    new EconomicEvent {Currency = "CHF", DateTime = time.AddMinutes(30)}
                };

            var creator = new OrderCreator();
            IList<MagicBoxOrder> lst = creator.CreateOrdersFromEvents(evtList);

            Assert.IsTrue(evtList.First().IsSpeechOrMeeting);

            MagicBoxConfig config = lst.First().Config;

            Assert.AreEqual(-1, config.MinutePendingExecution);
            Assert.AreEqual(30, config.MinuteExpiracy);
            Assert.AreEqual(250, config.Range);
            Assert.AreEqual(200, config.StopLoss);
            Assert.AreEqual(150, config.TakeProfit);
        }
        public void Should_create_different_order()
        {
            DateTime time = DateTime.Now;

            var evtList = new List<EconomicEvent>
                {
                    new EconomicEvent {Currency = "USD", DateTime = time.AddMinutes(20), Previous = "123"},
                    new EconomicEvent {Currency = "CHF", DateTime = time.AddMinutes(30), Previous = "123"}
                };

            var creator = new OrderCreator();
            IList<MagicBoxOrder> lst = creator.CreateOrdersFromEvents(evtList);

            Assert.AreEqual(2, lst.Count);

            MagicBoxConfig config = lst.First().Config;

            Assert.AreEqual(-1, config.MinutePendingExecution);
            Assert.AreEqual(10, config.MinuteExpiracy);
            Assert.AreEqual(50, config.Range);
            Assert.AreEqual(200, config.StopLoss);
            Assert.AreEqual(150, config.TakeProfit);
        }
        public void PrepareEconomicEvents()
        {
            var time = DateTime.Now;

            var evtList = new List <EconomicEvent>
            {
                new EconomicEvent {
                    Currency = "USD", DateTime = time.AddMinutes(20), Previous = "33"
                },
                new EconomicEvent {
                    Currency = "CHF", DateTime = time.AddMinutes(30), Previous = "33"
                },
                new EconomicEvent {
                    Currency = "USD", DateTime = time.AddMinutes(40), Previous = "33"
                },
                new EconomicEvent {
                    Currency = "USD", DateTime = time.AddMinutes(40), Previous = "33"
                }
            };

            var creator = new OrderCreator();

            mboxList = creator.CreateOrdersFromEvents(evtList);
        }