void populateSlippageCache(Symbol symbol) { var manager = new SpudManager(); var bars = bars_[symbol]; var spud = new BarSpud(manager); var calculator = symbol.slippageCalculator(spud); each(sort(bars.Keys), date => { spud.set(bars[date]); slippageCache.get(date)[symbol] = calculator.slippage(); manager.newBar(); }); }
protected SymbolSystem(QREBridgeBase bridge, Symbol symbol) : base(bridge, symbol) { this.symbol = symbol; manager = new SpudManager(); bars = new BarSpud(manager); base.bars[symbol].pushedDown += () => { parentManagerHasPushedDown = true; }; base.bars[symbol].valueSet += newValue => { if (parentManagerHasPushedDown) { manager.newBar(); parentManagerHasPushedDown = false; } bars.set(newValue); }; base.bars[symbol].manager.onLive += () => manager.goLive(); base.bars[symbol].manager.onRecalculate += () => manager.recalculate(); base.bars[symbol].ticked += time => bars.lastTickedAt(time); }
protected void addPoint(SOURCE newInput) { manager.newBar(); values.set(newInput); }