public RoundTrip(Position Position, Instrument Instrument, PositionSide TradePosition, double Amount, double EntryPrice, double ExitPrice, DateTime EntryDateTime, DateTime ExitDateTime, RoundTripStatus Status) : base() { this.position = Position; this.instrument = Instrument; this.tradePosition = TradePosition; this.amount = Amount; this.entryPrice = EntryPrice; this.exitPrice = ExitPrice; this.entryDateTime = EntryDateTime; this.exitDateTime = ExitDateTime; this.entryCost = 0.0; this.exitCost = 0.0; this.entryValue = EntryPrice * Amount; this.exitValue = ExitPrice * Amount; this.roundTripLowPrice = EntryPrice; this.roundTripHighPrice = EntryPrice; this.status = Status; if (this.status != RoundTripStatus.Opened) { return; } this.series = new DoubleSeries(); this.series.Add(EntryDateTime, this.entryPrice); this.Connect(); }
public void Close(DateTime exitDate) { this.status = RoundTripStatus.Closed; this.exitDateTime = exitDate; this.exitPrice = this.position.Transactions[1].Price; this.roundTripHighPrice = Math.Max(this.roundTripHighPrice, this.exitPrice); this.roundTripLowPrice = Math.Min(this.roundTripLowPrice, this.exitPrice); this.series.Add(this.exitDateTime, this.exitPrice); this.Disconnect(); this.ddEzhORsd(); }
public RoundTrip(Position Position, Instrument Instrument, PositionSide TradePosition, double Amount, double EntryPrice, double ExitPrice, DateTime EntryDateTime, DateTime ExitDateTime) : base() { this.position = Position; this.instrument = Instrument; this.tradePosition = TradePosition; this.amount = Amount; this.entryPrice = EntryPrice; this.exitPrice = ExitPrice; this.entryDateTime = EntryDateTime; this.exitDateTime = ExitDateTime; this.entryCost = 0.0; this.exitCost = 0.0; this.entryValue = EntryPrice * Amount; this.exitValue = ExitPrice * Amount; this.roundTripLowPrice = EntryPrice; this.roundTripHighPrice = EntryPrice; this.status = RoundTripStatus.Closed; }
public void Cancel() { this.status = RoundTripStatus.Canceled; this.Disconnect(); this.ddEzhORsd(); }
public RoundTrip(Position Position, Instrument Instrument, PositionSide TradePosition, double Amount, double EntryPrice, double ExitPrice, DateTime EntryDateTime, DateTime ExitDateTime) :base() { this.position = Position; this.instrument = Instrument; this.tradePosition = TradePosition; this.amount = Amount; this.entryPrice = EntryPrice; this.exitPrice = ExitPrice; this.entryDateTime = EntryDateTime; this.exitDateTime = ExitDateTime; this.entryCost = 0.0; this.exitCost = 0.0; this.entryValue = EntryPrice * Amount; this.exitValue = ExitPrice * Amount; this.roundTripLowPrice = EntryPrice; this.roundTripHighPrice = EntryPrice; this.status = RoundTripStatus.Closed; }
public RoundTrip(Position Position, Instrument Instrument, PositionSide TradePosition, double Amount, double EntryPrice, double ExitPrice, DateTime EntryDateTime, DateTime ExitDateTime, RoundTripStatus Status) : base() { this.position = Position; this.instrument = Instrument; this.tradePosition = TradePosition; this.amount = Amount; this.entryPrice = EntryPrice; this.exitPrice = ExitPrice; this.entryDateTime = EntryDateTime; this.exitDateTime = ExitDateTime; this.entryCost = 0.0; this.exitCost = 0.0; this.entryValue = EntryPrice * Amount; this.exitValue = ExitPrice * Amount; this.roundTripLowPrice = EntryPrice; this.roundTripHighPrice = EntryPrice; this.status = Status; if (this.status != RoundTripStatus.Opened) return; this.series = new DoubleSeries(); this.series.Add(EntryDateTime, this.entryPrice); this.Connect(); }