using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Muchinfo.MTPClient.Data.Helper;
namespace Muchinfo.MTPClient.Data.Model.Account
{
public class TradePosition : OrderBase
{
[PropertyDisc("accountid")]
public long accountid { get; set; }
[PropertyDisc("accountname")]
public string accountname { get; set; }
[PropertyDisc("reckondate")]
public string reckondate { get; set; }
[PropertyDisc("agreeunit")]
public decimal agreeunit { get; set; }
[PropertyDisc("decimalplace")]
public decimal decimalplace { get; set; }
[PropertyDisc("buypositionqty")]
public decimal buypositionqty { get; set; }
[PropertyDisc("buyholderamount")]
public decimal buyholderamount { get; set; }
[PropertyDisc("buycurpositionqty")]
public decimal buycurpositionqty { get; set; }
[PropertyDisc("buycurholderamount")]
public decimal buycurholderamount { get; set; }
[PropertyDisc("buyfrozenqty")]
public decimal buyfrozenqty { get; set; }
[PropertyDisc("buyotherfrozenqty")]
public decimal buyotherfrozenqty { get; set; }
[PropertyDisc("buyopenreqqty")]
public decimal buyopenreqqty { get; set; }
[PropertyDisc("buyreckonpl")]
public decimal buyreckonpl { get; set; }
[PropertyDisc("buyinterest")]
public decimal buyinterest { get; set; }
[PropertyDisc("buyusedmargin")]
public decimal buyusedmargin { get; set; }
[PropertyDisc("buyopentotalqty")]
public decimal buyopentotalqty { get; set; }
[PropertyDisc("buyclosetotalqty")]
public decimal buyclosetotalqty { get; set; }
[PropertyDisc("buyclosetotalpl")]
public decimal buyclosetotalpl { get; set; }
[PropertyDisc("sellpositionqty")]
public decimal sellpositionqty { get; set; }
[PropertyDisc("sellholderamount")]
public decimal sellholderamount { get; set; }
[PropertyDisc("sellcurpositionqty")]
public decimal sellcurpositionqty { get; set; }
[PropertyDisc("sellcurholderamount")]
public decimal sellcurholderamount { get; set; }
[PropertyDisc("sellfrozenqty")]
public decimal sellfrozenqty { get; set; }
[PropertyDisc("sellotherfrozenqty")]
public decimal sellotherfrozenqty { get; set; }
[PropertyDisc("sellopenreqqty")]
public decimal sellopenreqqty { get; set; }
[PropertyDisc("sellreckonpl")]
public decimal sellreckonpl { get; set; }
[PropertyDisc("sellinterest")]
public decimal sellinterest { get; set; }
[PropertyDisc("sellusedmargin")]
public decimal sellusedmargin { get; set; }
[PropertyDisc("sellopentotalqty")]
public decimal sellopentotalqty { get; set; }
[PropertyDisc("sellclosetotalqty")]
public decimal sellclosetotalqty { get; set; }
[PropertyDisc("sellclosetotalpl")]
public decimal sellclosetotalpl { get; set; }
[PropertyDisc("tradeproperty")]
public decimal tradeproperty { get; set; }
[PropertyDisc("interest2")]
public decimal interest2 { get; set; }
[PropertyDisc("accountcurrencyid")]
public decimal accountcurrencyid { get; set; }
[PropertyDisc("goodscurrencyid")]
public decimal goodscurrencyid { get; set; }
[PropertyDisc("curexchangerate")]
public decimal curexchangerate { get; set; }
[PropertyDisc("buyreckonpl2")]
public decimal buyreckonpl2 { get; set; }
[PropertyDisc("sellreckonpl2")]
public decimal sellreckonpl2 { get; set; }
[PropertyDisc("trademode")]
public int trademode { get; set; }
[PropertyDisc("marketname")]
public string marketname { get; set; }
public string BuyAvgPriceDisplay
{
get
{
if (buycurpositionqty == 0) return "-";
return (buycurholderamount/buycurpositionqty).ToString(PriceExpFormat);
}
}
public string SellAvgPriceDisplay
{
get
{
if (sellcurpositionqty == 0) return "-";
return (sellcurholderamount / sellcurpositionqty).ToString(PriceExpFormat);
}
}
///
/// Gets the hold total amount.
///
/// The hold total amount.
public string HoldTotalAmountDisplay
{
get { return (buycurholderamount + sellcurholderamount).ToString("N2"); }
}
///
/// Gets the reckon pl display.
///
/// The reckon pl display.
public string ReckonPLDisplay
{
get { return (buyreckonpl + sellreckonpl).ToString("N2"); }
}
public string ReckonPL2Display
{
get { return (buyreckonpl2 + sellreckonpl2).ToString("N2"); }
}
///
/// Gets the buy qty display.
///
/// The buy qty display.
public string BuyQtyDisplay
{
get
{
if (buycurpositionqty == 0) return "-";
return (buycurpositionqty).ToString();
}
}
///
/// Gets the sell qty display.
///
/// The sell qty display.
public string SellQtyDisplay
{
get
{
if (sellcurpositionqty == 0) return "-";
return (sellcurpositionqty).ToString();
}
}
}
}