示例#1
0
        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();
            });
        }
示例#2
0
 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);
 }
示例#3
0
 protected void addPoint(SOURCE newInput)
 {
     manager.newBar();
     values.set(newInput);
 }