예제 #1
0
 public void TestSetup()
 {
     TradeSharpDictionary.Initialize(MoqTradeSharpDictionary.Mock);
     ExecutablePath.InitializeFake(string.Empty);
     AtomCandleStorage.Instance.LoadFromFile(ExecutablePath.ExecPath + "\\quotes", Symbol);
     candles = AtomCandleStorage.Instance.GetAllMinuteCandles(Symbol);
     quotes  = candles.Select(q => new QuoteData(q.close, DalSpot.Instance.GetAskPriceWithDefaultSpread(Symbol, q.close), q.timeOpen)).ToList();
 }
예제 #2
0
        public ModelMock()
        {
            ExecutablePath.InitializeFake(string.Empty);

            Logger.Debug("Trace Init - file : " + ExecutablePath.Combine("Files", "Instruments.txt"));

            var jsonInstruments = System.IO.File.ReadAllText(ExecutablePath.Combine("Files", "Instruments.txt"));
            var jsonContracts   = System.IO.File.ReadAllText(ExecutablePath.Combine("Files", "Contracts.txt"));
        }
예제 #3
0
        public void TestSetup()
        {
            stockSeries = new StockSeriesDebug("StockSeriesDebug");

            ExecutablePath.InitializeFake(string.Empty);
            AtomCandleStorage.Instance.LoadFromFile(ExecutablePath.ExecPath + "\\quotes", Symbol);
            candles = AtomCandleStorage.Instance.GetAllMinuteCandles(Symbol);

            Localizer.ResourceResolver = new MockResourceResolver();
        }
예제 #4
0
        public void InitContext()
        {
            TradeSharpDictionary.Initialize(MoqTradeSharpDictionary.Mock);
            context = TestRobotUtil.GetRobotContextBacktest(new DateTime(2013, 9, 30), new DateTime(2014, 1, 30), currency: "IND");

            bot = new IchimokuRobot();
            bot.Graphics.Clear();
            bot.Graphics.Add(new Cortege2 <string, BarSettings>("INDUSD", new BarSettings
            {
                StartMinute = 0,
                Intervals   = new List <int> {
                    30
                }
            }));
            bot.Initialize(context, CurrentProtectedContext.Instance);

            ExecutablePath.InitializeFake(string.Empty);
        }
예제 #5
0
        public void TestSetup()
        {
            TradeSharpDictionary.Initialize(MoqTradeSharpDictionary.Mock);
            context = TestRobotUtil.GetRobotContextBacktest(new DateTime(2013, 12, 25), new DateTime(2013, 12, 25).AddDays(30));

            bot = new VoidRobot();
            bot.Graphics.Add(new Cortege2 <string, BarSettings>("EURUSD", new BarSettings
            {
                StartMinute = 0,
                Intervals   = new List <int> {
                    30
                }
            }));
            bot.Initialize(context, CurrentProtectedContext.Instance);

            ExecutablePath.InitializeFake(string.Empty);
            context.SubscribeRobot(bot);
            context.InitiateTest();

            // Инициализация дополнительных объектом, MOCK-и
            QuoteMaker.FillQuoteStorageWithDefaultValues();
        }
예제 #6
0
        public void InitContext()
        {
            TradeSharpDictionary.Initialize(MoqTradeSharpDictionary.Mock);
            context = TestRobotUtil.GetRobotContextBacktest(new DateTime(2013, 12, 25), new DateTime(2013, 12, 25).AddDays(30));

            bot = new RobotMA
            {
                RangeFastMA           = 5,
                RangeSlowMA           = 15,
                DeriveSiteFromHistory = true
            };
            bot.Graphics.Add(new Cortege2 <string, BarSettings>("EURUSD", new BarSettings
            {
                StartMinute = 0,
                Intervals   = new List <int> {
                    30
                }
            }));
            bot.Initialize(context, CurrentProtectedContext.Instance);

            ExecutablePath.InitializeFake(string.Empty);
            context.SubscribeRobot(bot);
            context.InitiateTest();
        }
예제 #7
0
 public void Setup()
 {
     ExecutablePath.InitializeFake(string.Empty);
     quoteFolder = ExecutablePath.ExecPath + "\\quotes";
     TradeSharpDictionary.Initialize(MoqTradeSharpDictionary.Mock);
 }