示例#1
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));
 }
示例#2
0
 protected override double exitLevel()
 {
     return(position.priceAtPnlNoSlippage(Math.Max(0, highWaterMark) - stopLoss, bridge.arguments().runInNativeCurrency, bridge.fxRate(position.symbol)));
 }
示例#3
0
文件: System.cs 项目: TzarIvan/ratel
 public SystemArguments arguments()
 {
     return(bridge.arguments());
 }
示例#4
0
文件: System.cs 项目: TzarIvan/ratel
 public static S create <S>(QREBridgeBase bridge) where S : System
 {
     return(create <S>(bridge.arguments().parameters.systemClassName(), bridge));
 }