Ejemplo n.º 1
0
 public BarSpud(SpudManager manager) : base(manager)
 {
     open_   = new Lazy <ComparableSpud <double> >(() => comparableTransform(OPEN));
     high_   = new Lazy <ComparableSpud <double> >(() => comparableTransform(HIGH));
     low_    = new Lazy <ComparableSpud <double> >(() => comparableTransform(LOW));
     close_  = new Lazy <ComparableSpud <double> >(() => comparableTransform(CLOSE));
     volume_ = new Lazy <ComparableSpud <double> >(() => comparableTransform(VOLUME));
     times_  = new Lazy <ComparableSpud <DateTime> >(() => comparableTransform(TIME));
     ticked += doNothing;
 }
Ejemplo n.º 2
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();
            });
        }
Ejemplo n.º 3
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);
 }
Ejemplo n.º 4
0
 public void setUp()
 {
     manager = new SpudManager();
     values  = new RootSpud <SOURCE>(manager);
 }
Ejemplo n.º 5
0
 internal void setSpudManager(SpudManager newManager)
 {
     manager_ = newManager;
 }
Ejemplo n.º 6
0
 protected DynamicExit(Position position, string name, Converter <double, OrderDetails> createDetails, SpudManager manager) : base(manager)
 {
     this.position = position;
     Bomb.when(position.isClosed(), () => "cannot put exit on a closed position");
     this.name          = name;
     this.createDetails = createDetails;
 }