Exemplo n.º 1
0
 public int CompareTo(object obj)
 {
     if (obj is Node n)
     {
         return(CurrentCost.CompareTo(n.CurrentCost));
     }
     return(-1);
 }
Exemplo n.º 2
0
        protected override void OnInitialize()
        {
            base.OnInitialize();

            Ad.Value = Shell.Config.LoadAd("2block.gif");
            Prices   = Session.Query <Price>()
                       .OrderBy(p => p.Name)
                       .Select(p => new Selectable <Price>(p))
                       .ToList();
            Costs = Diff.Skip(1).Throttle(Consts.TextInputLoadTimeout, UiScheduler).Select(v => (object)v)
                    .Merge(Prices.Select(p => p.Changed()).Merge().Throttle(Consts.FilterUpdateTimeout, UiScheduler))
                    .Merge(SearchBehavior.ActiveSearchTerm)
                    .Merge(DbReloadToken)
                    .Do(_ => IsLoading.Value = true)
                    .Select(_ => RxQuery(Load))
                    .Switch()
                    .Do(_ => IsLoading.Value = false)
                    .ToValue(CloseCancellation);

            CurrentCost
            .Throttle(Consts.ScrollLoadTimeout, UiScheduler)
            .Merge(DbReloadToken)
            .Subscribe(_ => UpdateAsync(), CloseCancellation.Token);
        }
Exemplo n.º 3
0
 public override string ToString()
 {
     return(CurrentCost.ToString());
 }
Exemplo n.º 4
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());
        }
 /// ------------------------------------------------------------- HUD 관련 ------------------------------------------------------------- ///
 // 플레이어 정보에 따라 UI 업데이트
 void RefreshPlayerUI()
 {
     healthText.text = CurrentHealth.ToString() + "/" + maxHealth.ToString();
     costText.text   = CurrentCost.ToString() + "/" + maxCost.ToString();
     goldText.text   = gold.ToString();
 }