public bool SetWatchedSymbols(List <RE.Symbol> symbols) { if (isEmpty(symbols)) { Channel.closeResources(); each(threads.Values, thread => thread.Abort()); threads.Clear(); return(true); } foreach (var symbol in symbols) { var tempSymbol = symbol; var qSymbol = new Symbol(symbol); if (threads.ContainsKey(qSymbol)) { continue; } var rng = new Random(); threads[qSymbol] = new Thread(() => { var delay = 1000; var time = date(Dates.todayAt("05:00:00")); while (trueDat()) { var tick = new RE.TickData { price = rng.NextDouble() * 100, size = (ulong)rng.Next(), tickType = RE.TickType.Trade, time = time }; tickListener(tempSymbol, tick); sleep(delay); if (delay > 10) { delay -= 10; } } }); threads[qSymbol].Start(); } return(true); }
public void SaveTick(RE.Symbol symbol, RE.TickData tick) { throw new NotImplementedException(); }
public void SimTick(RightEdge.Common.Symbol symbol, RE.TickData tick) { innerBroker.SimTick(symbol, tick); }
static void logTick(RE.TickData tick) { LogC.consoleOut("" + tick.price + " " + tick.size + " " + tick.tickType + " " + tick.time); }