Example #1
0
        public override void Initialize(BacktestServerProxy.RobotContext grobotContext,
                                        Contract.Util.BL.CurrentProtectedContext protectedContextx)
        {
            base.Initialize(grobotContext, protectedContextx);
            if (Graphics.Count == 0)
            {
                Logger.DebugFormat("CounterNettoRobot: настройки графиков не заданы");
                return;
            }

            packers = Graphics.ToDictionary(g => g.a, g => new CandlePacker(g.b));

            if (!File.Exists(NettoFilePath))
            {
                Logger.DebugFormat("CounterNettoRobot: файл не найден");
                return;
            }
            nettoReader = new StreamReader(NettoFilePath, Encoding.ASCII);
            NettoRecord.ReadHeader(nettoReader);
            cur  = NettoRecord.ReadNext(nettoReader);
            next = NettoRecord.ReadNext(nettoReader);
        }