예제 #1
0
 public TradeInfoEventArgs(TradeInfo tradeInfo)
 {
     TradeInfo = tradeInfo;
 }
예제 #2
0
 private TradeInfo method_2(Fill fill_1, Fill fill_2, double double_1)
 {
     TradeInfo tradeInfo = new TradeInfo();
     tradeInfo.Instrument = fill_1.Instrument;
     tradeInfo.EntryDate = fill_1.DateTime;
     tradeInfo.EntryPrice = fill_1.Price;
     tradeInfo.EntryCost = fill_1.Commission * double_1 / fill_1.Qty;
     tradeInfo.ExitDate = fill_2.DateTime;
     tradeInfo.ExitPrice = fill_2.Price;
     tradeInfo.ExitCost = fill_2.Commission * double_1 / fill_2.Qty;
     tradeInfo.Qty = double_1;
     tradeInfo.IsLong = this.method_3(fill_1);
     tradeInfo.BaseCurrencyId = this.portfolio_0.Account.CurrencyId;
     double num = (tradeInfo.Instrument.Factor == 0.0) ? 1.0 : tradeInfo.Instrument.Factor;
     double max = this.timeSeries_0.GetMax(tradeInfo.EntryDate, tradeInfo.ExitDate);
     double min = this.timeSeries_0.GetMin(tradeInfo.EntryDate, tradeInfo.ExitDate);
     if (tradeInfo.IsLong)
     {
         tradeInfo.MAE = num * tradeInfo.Qty * (min - tradeInfo.EntryPrice) - (tradeInfo.EntryCost + tradeInfo.ExitCost);
         tradeInfo.MFE = num * tradeInfo.Qty * (max - tradeInfo.EntryPrice) - (tradeInfo.EntryCost + tradeInfo.ExitCost);
         tradeInfo.ETD = tradeInfo.MFE - tradeInfo.NetPnL;
     }
     else
     {
         tradeInfo.MAE = num * tradeInfo.Qty * (max - tradeInfo.EntryPrice) * -1.0 - (tradeInfo.EntryCost + tradeInfo.ExitCost);
         tradeInfo.MFE = num * tradeInfo.Qty * (min - tradeInfo.EntryPrice) * -1.0 - (tradeInfo.EntryCost + tradeInfo.ExitCost);
         tradeInfo.ETD = tradeInfo.MFE - tradeInfo.NetPnL;
     }
     return tradeInfo;
 }
예제 #3
0
 public TradeInfoEventArgs(TradeInfo tradeInfo)
 {
     TradeInfo = tradeInfo;
 }
예제 #4
0
 private void BotEqOqmKI(TradeInfo tradeInfo_0)
 {
     this.list_0.Add(tradeInfo_0);
     TradeDetected?.Invoke(this.portfolio_0, new TradeInfoEventArgs(tradeInfo_0));
     
 }
예제 #5
0
 private void BotEqOqmKI(TradeInfo tradeInfo_0)
 {
     this.list_0.Add(tradeInfo_0);
     TradeDetected?.Invoke(this.portfolio_0, new TradeInfoEventArgs(tradeInfo_0));
 }