Exemplo n.º 1
0
 protected override double exitLevel()
 {
     return(position.priceAtPnlNoSlippage(Math.Max(0, highWaterMark) - stopLoss, bridge.arguments().runInNativeCurrency, bridge.fxRate(position.symbol)));
 }
Exemplo 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));
 }