Example #1
0
        public InfoRecord[] GetInfoRecords(ITranslationManager tm)
        {
            const string tg      = "Statistics";
            var          records = new List <InfoRecord>
            {
                new InfoRecord
                {
                    Name  = tm.T(tg, "Type"),
                    Value = InstrType.ToString()
                },
                new InfoRecord
                {
                    Name  = tm.T(tg, "Comment"),
                    Value = Comment
                },
                new InfoRecord
                {
                    Name  = tm.T(tg, "Digits"),
                    Value = Digits.ToString(CultureInfo.InvariantCulture)
                },
                new InfoRecord
                {
                    Name  = tm.T(tg, "Point value"),
                    Value = Point.ToString("0.#####")
                },
                new InfoRecord
                {
                    Name  = tm.T(tg, "Lot size"),
                    Value = LotSize.ToString(CultureInfo.InvariantCulture)
                },
                new InfoRecord
                {
                    Name  = tm.T(tg, "Spread"),
                    Value = Spread.ToString("F2") + " " + tm.T(tg, "points")
                },
                new InfoRecord
                {
                    Name  = tm.T(tg, "Swap long"),
                    Value = SwapLong.ToString("F2") + " " + tm.T(tg, SwapType.ToString().ToLower())
                },
                new InfoRecord
                {
                    Name  = tm.T(tg, "Swap short"),
                    Value = SwapShort.ToString("F2") + " " + tm.T(tg, SwapType.ToString().ToLower())
                },
                new InfoRecord
                {
                    Name  = tm.T(tg, "Commission"),
                    Value = Commission.ToString("F2") + " " + tm.T(tg, CommissionType.ToString().ToLower())
                },
                new InfoRecord
                {
                    Name  = tm.T(tg, "Slippage"),
                    Value = Slippage.ToString("F2") + " " + tm.T(tg, "points")
                }
            };

            return(records.ToArray());
        }
 public override string ToString()
 {
     return(base.ToString() + " Commission: " + Commission.ToString() + " Currentsales: " + currentSales.ToString("C"));
 }
Example #3
0
        /// <summary>
        /// Returns the string presentation of the object
        /// </summary>
        /// <returns>String presentation of the object</returns>
        public override string ToString()
        {
            var sb = new System.Text.StringBuilder();

            sb.Append("class PositionResponse {\n");
            sb.Append("  Account: ").Append(Account.ToString()).Append("\n");
            sb.Append("  Symbol: ").Append(Symbol.ToString()).Append("\n");
            sb.Append("  Currency: ").Append(Currency.ToString()).Append("\n");
            sb.Append("  Underlying: ").Append(Underlying.ToString()).Append("\n");
            sb.Append("  QuoteCurrency: ").Append(QuoteCurrency.ToString()).Append("\n");
            sb.Append("  Commission: ").Append(Commission.ToString()).Append("\n");
            sb.Append("  InitMarginReq: ").Append(InitMarginReq.ToString()).Append("\n");
            sb.Append("  MaintMarginReq: ").Append(MaintMarginReq.ToString()).Append("\n");
            sb.Append("  RiskLimit: ").Append(RiskLimit.ToString()).Append("\n");
            sb.Append("  Leverage: ").Append(Leverage.ToString()).Append("\n");
            sb.Append("  CrossMargin: ").Append(CrossMargin.ToString()).Append("\n");
            //sb.Append("  DeleveragePercentile: ").Append(DeleveragePercentile.ToString()).Append("\n");
            sb.Append("  RebalancedPnl: ").Append(RebalancedPnl.ToString()).Append("\n");
            sb.Append("  PrevRealisedPnl: ").Append(PrevRealisedPnl.ToString()).Append("\n");
            sb.Append("  PrevUnrealisedPnl: ").Append(PrevUnrealisedPnl.ToString()).Append("\n");
            sb.Append("  PrevClosePrice: ").Append(PrevClosePrice.ToString()).Append("\n");
            sb.Append("  OpeningTimestamp: ").Append(OpeningTimestamp.ToString()).Append("\n");
            sb.Append("  OpeningQty: ").Append(OpeningQty.ToString()).Append("\n");
            sb.Append("  OpeningCost: ").Append(OpeningCost.ToString()).Append("\n");
            sb.Append("  OpeningComm: ").Append(OpeningComm.ToString()).Append("\n");
            sb.Append("  OpenOrderBuyQty: ").Append(OpenOrderBuyQty.ToString()).Append("\n");
            sb.Append("  OpenOrderBuyCost: ").Append(OpenOrderBuyCost.ToString()).Append("\n");
            sb.Append("  OpenOrderBuyPremium: ").Append(OpenOrderBuyPremium.ToString()).Append("\n");
            sb.Append("  OpenOrderSellQty: ").Append(OpenOrderSellQty.ToString()).Append("\n");
            sb.Append("  OpenOrderSellCost: ").Append(OpenOrderSellCost.ToString()).Append("\n");
            sb.Append("  OpenOrderSellPremium: ").Append(OpenOrderSellPremium.ToString()).Append("\n");
            sb.Append("  ExecBuyQty: ").Append(ExecBuyQty.ToString()).Append("\n");
            sb.Append("  ExecBuyCost: ").Append(ExecBuyCost.ToString()).Append("\n");
            sb.Append("  ExecSellQty: ").Append(ExecSellQty.ToString()).Append("\n");
            sb.Append("  ExecSellCost: ").Append(ExecSellCost.ToString()).Append("\n");
            sb.Append("  ExecQty: ").Append(ExecQty.ToString()).Append("\n");
            sb.Append("  ExecCost: ").Append(ExecCost.ToString()).Append("\n");
            sb.Append("  ExecComm: ").Append(ExecComm.ToString()).Append("\n");
            sb.Append("  CurrentTimestamp: ").Append(CurrentTimestamp.ToString()).Append("\n");
            sb.Append("  CurrentQty: ").Append(CurrentQty.ToString()).Append("\n");
            sb.Append("  CurrentCost: ").Append(CurrentCost.ToString()).Append("\n");
            sb.Append("  CurrentComm: ").Append(CurrentComm.ToString()).Append("\n");
            sb.Append("  RealisedCost: ").Append(RealisedCost.ToString()).Append("\n");
            sb.Append("  UnrealisedCost: ").Append(UnrealisedCost.ToString()).Append("\n");
            sb.Append("  GrossOpenCost: ").Append(GrossOpenCost.ToString()).Append("\n");
            sb.Append("  GrossOpenPremium: ").Append(GrossOpenPremium.ToString()).Append("\n");
            sb.Append("  GrossExecCost: ").Append(GrossExecCost.ToString()).Append("\n");
            sb.Append("  IsOpen: ").Append(IsOpen.ToString()).Append("\n");
            sb.Append("  MarkPrice: ").Append(MarkPrice.ToString()).Append("\n");
            sb.Append("  MarkValue: ").Append(MarkValue.ToString()).Append("\n");
            sb.Append("  RiskValue: ").Append(RiskValue.ToString()).Append("\n");
            sb.Append("  HomeNotional: ").Append(HomeNotional.ToString()).Append("\n");
            sb.Append("  ForeignNotional: ").Append(ForeignNotional.ToString()).Append("\n");
            sb.Append("  PosState: ").Append(PosState.ToString()).Append("\n");
            sb.Append("  PosCost: ").Append(PosCost.ToString()).Append("\n");
            sb.Append("  PosCost2: ").Append(PosCost2.ToString()).Append("\n");
            sb.Append("  PosCross: ").Append(PosCross.ToString()).Append("\n");
            sb.Append("  PosInit: ").Append(PosInit.ToString()).Append("\n");
            sb.Append("  PosComm: ").Append(PosComm.ToString()).Append("\n");
            sb.Append("  PosLoss: ").Append(PosLoss.ToString()).Append("\n");
            sb.Append("  PosMargin: ").Append(PosMargin.ToString()).Append("\n");
            sb.Append("  PosMaint: ").Append(PosMaint.ToString()).Append("\n");
            sb.Append("  PosAllowance: ").Append(PosAllowance.ToString()).Append("\n");
            sb.Append("  TaxableMargin: ").Append(TaxableMargin.ToString()).Append("\n");
            sb.Append("  InitMargin: ").Append(InitMargin.ToString()).Append("\n");
            sb.Append("  MaintMargin: ").Append(MaintMargin.ToString()).Append("\n");
            sb.Append("  SessionMargin: ").Append(SessionMargin.ToString()).Append("\n");
            sb.Append("  TargetExcessMargin: ").Append(TargetExcessMargin.ToString()).Append("\n");
            sb.Append("  VarMargin: ").Append(VarMargin.ToString()).Append("\n");
            sb.Append("  RealisedGrossPnl: ").Append(RealisedGrossPnl.ToString()).Append("\n");
            sb.Append("  RealisedTax: ").Append(RealisedTax.ToString()).Append("\n");
            sb.Append("  RealisedPnl: ").Append(RealisedPnl.ToString()).Append("\n");
            sb.Append("  UnrealisedGrossPnl: ").Append(UnrealisedGrossPnl.ToString()).Append("\n");
            sb.Append("  LongBankrupt: ").Append(LongBankrupt.ToString()).Append("\n");
            sb.Append("  ShortBankrupt: ").Append(ShortBankrupt.ToString()).Append("\n");
            sb.Append("  TaxBase: ").Append(TaxBase.ToString()).Append("\n");
            sb.Append("  IndicativeTaxRate: ").Append(IndicativeTaxRate.ToString()).Append("\n");
            sb.Append("  IndicativeTax: ").Append(IndicativeTax.ToString()).Append("\n");
            sb.Append("  UnrealisedTax: ").Append(UnrealisedTax.ToString()).Append("\n");
            sb.Append("  UnrealisedPnl: ").Append(UnrealisedPnl.ToString()).Append("\n");
            sb.Append("  UnrealisedPnlPcnt: ").Append(UnrealisedPnlPcnt.ToString()).Append("\n");
            sb.Append("  UnrealisedRoePcnt: ").Append(UnrealisedRoePcnt.ToString()).Append("\n");
            //sb.Append("  SimpleQty: ").Append(SimpleQty.ToString()).Append("\n");
            //sb.Append("  SimpleCost: ").Append(SimpleCost.ToString()).Append("\n");
            //sb.Append("  SimpleValue: ").Append(SimpleValue.ToString()).Append("\n");
            //sb.Append("  SimplePnl: ").Append(SimplePnl.ToString()).Append("\n");
            //sb.Append("  SimplePnlPcnt: ").Append(SimplePnlPcnt.ToString()).Append("\n");
            //sb.Append("  AvgCostPrice: ").Append(AvgCostPrice.ToString()).Append("\n");
            //sb.Append("  AvgEntryPrice: ").Append(AvgEntryPrice.ToString()).Append("\n");
            //sb.Append("  BreakEvenPrice: ").Append(BreakEvenPrice.ToString()).Append("\n");
            //sb.Append("  MarginCallPrice: ").Append(MarginCallPrice.ToString()).Append("\n");
            //sb.Append("  LiquidationPrice: ").Append(LiquidationPrice.ToString()).Append("\n");
            //sb.Append("  BankruptPrice: ").Append(BankruptPrice.ToString()).Append("\n");
            sb.Append("  Timestamp: ").Append(Timestamp.ToString()).Append("\n");
            sb.Append("  LastPrice: ").Append(LastPrice.ToString()).Append("\n");
            sb.Append("  LastValue: ").Append(LastValue.ToString()).Append("\n");
            sb.Append("}\n");
            return(sb.ToString());
        }