Esempio n. 1
0
        public static T create <T>(string className, QREBridgeBase bridge, Symbol symbol) where T : SymbolSystem
        {
            var type = Type.GetType(className, true, false);
            var c    = type.GetConstructor(new[] { typeof(QREBridge <T>), typeof(Symbol) });

            Bomb.ifNull(c, () => "no constuctor matching qrebridge of type, symbol on class " + className);
            return((T)c.Invoke(new object[] { bridge, symbol }));
        }
Esempio n. 2
0
 public DollarTrailingStop(Position position, Spud <double> close, double stopLoss, string name, QREBridgeBase bridge)
     : base(position, name, STOP, close.manager)
 {
     this.close    = close;
     this.stopLoss = stopLoss;
     this.bridge   = bridge;
     tradePnl      = close.transform(price => position.pnlNoSlippage(price, bridge.arguments().runInNativeCurrency, bridge.fxRate(position.symbol)));
     highWaterMark = dependsOn(new Max(tradePnl));
 }
Esempio n. 3
0
        public static S create <S>(string className, bool useMultiSymbol, QREBridgeBase bridge) where S : System
        {
            var type = Type.GetType(className, true, false);

            if (useMultiSymbol && type.IsSubclassOf(typeof(SymbolSystem)))
            {
                type = typeof(IndependentSymbolSystems <>).MakeGenericType(type);
            }
            var c      = type.GetConstructor(new[] { typeof(QREBridge <S>) });
            var system = (S)c.Invoke(new object[] { bridge });

            return(system);
        }
Esempio n. 4
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);
 }
Esempio n. 5
0
 public IndependentPairSystems(QREBridgeBase bridge) : base(bridge)
 {
 }
Esempio n. 6
0
 public CustomTradeEmailer(QREBridgeBase bridge, Symbol symbol) : base(bridge, symbol)
 {
 }
Esempio n. 7
0
 public StopSystem(QREBridgeBase bridge, Symbol symbol) : base(bridge, symbol)
 {
     bars.low.prepare();
     bars.high.prepare();
 }
Esempio n. 8
0
 public IndependentSymbolSystems(QREBridgeBase bridge) : base(bridge)
 {
 }
Esempio n. 9
0
 protected PairSystem(QREBridgeBase bridge, Pair pair) : base(bridge, pair)
 {
     this.pair = pair;
 }
Esempio n. 10
0
 protected System(QREBridgeBase bridge)
 {
     this.bridge = bridge;
 }
Esempio n. 11
0
 public static S create <S>(QREBridgeBase bridge) where S : System
 {
     return(create <S>(bridge.arguments().parameters.systemClassName(), bridge));
 }
Esempio n. 12
0
 public static S create <S> (string className, QREBridgeBase bridge) where S : System
 {
     return(create <S>(className, true, bridge));
 }
Esempio n. 13
0
 protected MultiSystem(QREBridgeBase bridge) : base(bridge)
 {
 }