Below method is called from OnBarUpdate()
private void SetBrekeven() { // Raise stop loss to breakeven when there is at least 10 ticks in profit if (Close[0] >= Position.AveragePrice + 10 * TickSize) { // set breakeven stop loss order if (Position.MarketPosition == MarketPosition.Long) { ExitLongStopMarket(Position.Quantity, Position.AveragePrice); } else { ExitShortStopMarket(Position.Quantity, Position.AveragePrice); } } }
|
Comment