Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
 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();
 }
Exemplo n.º 3
0
 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;
 }
Exemplo n.º 4
0
 public void Cancel()
 {
     this.status = RoundTripStatus.Canceled;
     this.Disconnect();
     this.ddEzhORsd();
 }
Exemplo n.º 5
0
 public void Cancel()
 {
   this.status = RoundTripStatus.Canceled;
   this.Disconnect();
   this.ddEzhORsd();
 }
Exemplo n.º 6
0
 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();
 }
Exemplo n.º 7
0
    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;
    }
Exemplo n.º 8
0
    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();
    }