44 lines
1.5 KiB
C#
44 lines
1.5 KiB
C#
using Qdp.ComputeServiceV2.Data.CommonModels.TradeInfos;
|
|
using Qdp.Foundation.Implementations;
|
|
using Qdp.Pricing.Base.Implementations;
|
|
using Qdp.Pricing.Library.Base.Interfaces;
|
|
|
|
namespace YLErp.BLL.Calculation
|
|
{
|
|
public class ForwardTrade : TradeBase
|
|
{
|
|
public ForwardTrade(string tradeId, Date tradeDate, Date startDate, Date maturityDate,
|
|
TradeType tradeType, double notional, double price, string instrumentCode, double unWindProfit, double unWindNotional, double marginCost)
|
|
: base(tradeId, tradeDate, startDate, maturityDate, tradeType, notional, price, new DummyForwardInstrument())
|
|
{
|
|
InstrumentCode = instrumentCode;
|
|
UnWindProfit = unWindProfit;
|
|
UnWindNotional = unWindNotional;
|
|
MarginCost = marginCost;
|
|
}
|
|
|
|
public string InstrumentCode { get; private set; }
|
|
|
|
public double UnWindProfit { get; set; }
|
|
|
|
public double UnWindNotional { get; set; }
|
|
|
|
public double MarginCost { get; set; }
|
|
|
|
public string CallPut { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 临时的远期Instrument,如果QDP中实现了股票Instrument,该类可以不使用
|
|
/// </summary>
|
|
public class DummyForwardInstrument : IInstrument
|
|
{
|
|
public string Id { get; }
|
|
public string TypeName => "Forward";
|
|
public Date StartDate { get; }
|
|
public Date UnderlyingMaturityDate { get; }
|
|
public DayGap SettlementGap { get; }
|
|
public double Notional { get; set; }
|
|
}
|
|
}
|