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 })); }
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)); }
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); }
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); }
public IndependentPairSystems(QREBridgeBase bridge) : base(bridge) { }
public CustomTradeEmailer(QREBridgeBase bridge, Symbol symbol) : base(bridge, symbol) { }
public StopSystem(QREBridgeBase bridge, Symbol symbol) : base(bridge, symbol) { bars.low.prepare(); bars.high.prepare(); }
public IndependentSymbolSystems(QREBridgeBase bridge) : base(bridge) { }
protected PairSystem(QREBridgeBase bridge, Pair pair) : base(bridge, pair) { this.pair = pair; }
protected System(QREBridgeBase bridge) { this.bridge = bridge; }
public static S create <S>(QREBridgeBase bridge) where S : System { return(create <S>(bridge.arguments().parameters.systemClassName(), bridge)); }
public static S create <S> (string className, QREBridgeBase bridge) where S : System { return(create <S>(className, true, bridge)); }
protected MultiSystem(QREBridgeBase bridge) : base(bridge) { }