using Muchinfo.MTPClient.Data.Helper;
using Muchinfo.MTPClient.Resources;
namespace Muchinfo.MTPClient.Data.Model.Account
{
public class MemberPosition : OrderBase
{
///
/// 客户买浮动盈亏
///
public decimal BuyFloatPL { get; set; }
///
///会员买浮动盈亏
///
public decimal MemberBuyFloatPL { get; set; }
///
///会员卖浮动盈亏
///
public decimal MemberSellFloatPL { get; set; }
///
/// 客户买数量
///
public decimal BuyHolderQty { get; set; }
///
/// 客户净盈亏
///
public decimal CustomerFloatPL
{
get { return BuyFloatPL + SellFloatPL; }
}
///
/// 客户净头寸
///
public decimal CustomerNetQty
{
get { return BuyHolderQty - SellHolderQty; }
}
///
/// 会员净盈亏
///
public decimal MemberFloatPL {
get
{
return MemberBuyFloatPL + MemberSellFloatPL;
} }
///
/// 会员净头寸
///
public decimal MemberNetQty
{
get { return MemberBuyHolderQty - MemberSellHolderQty; }
}
///
/// 会员买数量
///
public decimal MemberBuyHolderQty { get; set; }
///
/// 会员卖数量
///
public decimal MemberSellHolderQty { get; set; }
///
/// 客户卖浮动盈亏
///
public decimal SellFloatPL { get; set; }
///
/// 客户卖数量
///
public decimal SellHolderQty { get; set; }
///
/// 客户卖浮动盈亏格式化
///
public string SellFloatPLDisplay
{
get
{
return SellFloatPL.ToString(PriceFormat);
}
}
///
/// 客户买浮动盈亏格式化
///
public string BuyFloatPLDisplay
{
get
{
return BuyFloatPL.ToString(PriceFormat);
}
}
///
/// 客户净盈亏格式化
///
public string CustomerFloatPLDisplay
{
get
{
return CustomerFloatPL.ToString("f2");//[固定保留两位小数]
}
}
///
/// 会员净盈亏格式化
///
public string MemberFloatPLDisplay
{
get
{
return MemberFloatPL.ToString("f2");//[固定保留两位小数]
}
}
///
/// 会员净盈亏汇总
///
public string SumMemberNetFloatPLDisplay
{
get
{
return (CustomerFloatPL + MemberFloatPL).ToString("f2");//[固定保留两位小数]
}
}
///
/// 会员净头寸汇总
///
public string SumMemberNetLotDisplay
{
get
{
return (MemberNetQty - CustomerNetQty).ToString();
}
}
///
/// 价格格式化
///
//public string PriceFormat
//{
// get
// {
// return "F2";
// //if (this.QuoteGoods != null)
// //{
// // return QuoteGoods.FormatPrice;
// //}
// //else
// //{
// // return "F0";
// //}
// }
//}
///
/// 可平数量
///
public string CloseQtyDisplay {
get
{
return string.Format(Client_Resource.Position_CloseBidAskQty,
CloseBidQty<= 0 ? "-" : CloseBidQty + string.Empty,
CloseAskQty <= 0 ? "-" : CloseAskQty + string.Empty);
} }
///
/// 可以平买数量
///
public decimal CloseBidQty { get; set; }
///
/// 可以平卖数量
///
public decimal CloseAskQty { get; set; }
///
/// 头寸类型
///
public string FPLTypeString
{
get
{
return FPLType.Discription();
//switch (FPLType)
//{
// case FPLType.Member:
// return "会员";
// case FPLType.MemberBid:
// return "会员-竞价";
// case FPLType.Customer:
// return "投资者";
// case FPLType.None:
// return "--";
// break;
// default:
// return "--";
// break;
//}
}
}
///
/// 头寸类型
///
public FPLType FPLType { get; set; }
}
//暂时添加头寸类型动盈亏类型 01: 客户端-会员竞价头寸浮动盈亏, 02: 客户端-客户头寸浮动盈亏, 03: 客户端-自营头寸浮动盈亏
public enum FPLType
{
///
/// 无
///
[ItemDisc("Domain_No")]
None = 0,
//客户端-会员竞价头寸浮动盈亏
[ItemDisc("Domain_MembBid")]
MemberBid = 1,
///
/// 投资者
///
[ItemDisc("Domain_Investor")]
Customer = 2,
///
/// 会员
///
[ItemDisc("Domain_Memb")]
Member = 3,
}
}