예제 #1
0
        void addRow(LiveSystem system)
        {
            var row = table.NewRow();

            systems.Add(row, system);
            insertUnknownRow(row, system);
            plans[system] = new List <Plan>();

            setHeartbeatStatus(row, system, SystemStatus.UNKNOWN);
            setTickStatus(row, system, SystemStatus.UNKNOWN);

            tickTimers[system]      = statusFades(status => setTickStatus(row, system, status));
            heartbeatTimers[system] = statusFades(status => setHeartbeatStatus(row, system, status));

            lastTickProcessed[system] = DateTime.MinValue;

            subscribeSystemHeartbeat(row, system);
            var symbols = convert(list <JMarket>(system.markets()), m => new Symbol(m));

            each(symbols, symbol => {
                try {
                    symbol.subscribe(bar => onTickPublished(row, system, bar.time));
                } catch (Exception ex) {
                    LogC.err("exception caught subscribing to tick data for " + symbol + ", " + system, ex);
                    gui.alertUser("exception caught susbcribing to data for " + symbol + ", " + system + ".\nSkipping... see log for details.");
                }
            });
        }