public override void PnlUpdate(PnlInfo oInfo) { StringBuilder sb = new StringBuilder(); oInfo.Dump(sb); sb.AppendFormat("\n"); debug(sb); }
public override void PnlUpdate(PnlInfo oInfo) { StringBuilder sb = new StringBuilder(); oInfo.Dump(sb); sb.AppendFormat("\n"); System.Console.Out.Write(sb); }
private void Settings_Load(object sender, EventArgs e) { mainFrm = (MainForm)this.Owner; AddListItems(new[] { "常规", "播放", "声音", "画面", "字幕", "关联", "背景", "截图", "赞助", "更新", "其他" }); MenuList.Items[0].Focus(); MenuList.Items[0].BackColor = SelectedBackColor; Thread thread = new Thread(LoadPrepare); thread.Start(); PnlInfo.Refresh(); }
private void ProcessPnL(PnlInfo info) { //ProcessAccount(info.Account); BaseChangeMessage <PositionChangeTypes> message; if (info.Symbol.IsEmpty()) { message = this.CreatePortfolioChangeMessage(info.Account.AccountId); } else { message = this.CreatePositionChangeMessage( info.Account.AccountId, new SecurityId { SecurityCode = info.Symbol, BoardCode = info.Exchange, }); } switch (info.Position.State) { case Ignorable <int> .ValueState.Ignore: break; case Ignorable <int> .ValueState.Clear: message.Add(PositionChangeTypes.CurrentValue, 0m); break; case Ignorable <int> .ValueState.Use: message.Add(PositionChangeTypes.CurrentValue, (decimal)info.Position.Value); break; default: throw new ArgumentOutOfRangeException(); } SendOutMessage(message .TryAdd(PositionChangeTypes.CurrentPrice, info.AccountBalance) .TryAdd(PositionChangeTypes.VariationMargin, info.MarginBalance) .TryAdd(PositionChangeTypes.UnrealizedPnL, info.OpenPnl) .TryAdd(PositionChangeTypes.RealizedPnL, info.ClosedPnl) .TryAdd(PositionChangeTypes.AveragePrice, info.AvgOpenFillPrice) ); }
public override void PnlUpdate(PnlInfo info) { _client.AccountPnLUpdate.WithDump(_receiver).WithError(TransactionError).SafeInvoke(info); }
private void SessionHolderOnAccountPnLUpdate(PnlInfo info) { ProcessAccount(info.Account); ProcessPnL(info); }
private void ProcessPnL(PnlInfo info) { //ProcessAccount(info.Account); BaseChangeMessage<PositionChangeTypes> message; if (info.Symbol.IsEmpty()) { message = this.CreatePortfolioChangeMessage(info.Account.AccountId); } else { message = this.CreatePositionChangeMessage( info.Account.AccountId, new SecurityId { SecurityCode = info.Symbol, BoardCode = info.Exchange, }); } switch (info.Position.State) { case Ignorable<int>.ValueState.Ignore: break; case Ignorable<int>.ValueState.Clear: message.Add(PositionChangeTypes.CurrentValue, 0m); break; case Ignorable<int>.ValueState.Use: message.Add(PositionChangeTypes.CurrentValue, (decimal)info.Position.Value); break; default: throw new ArgumentOutOfRangeException(); } SendOutMessage(message .TryAdd(PositionChangeTypes.CurrentPrice, info.AccountBalance) .TryAdd(PositionChangeTypes.VariationMargin, info.MarginBalance) .TryAdd(PositionChangeTypes.UnrealizedPnL, info.OpenPnl) .TryAdd(PositionChangeTypes.RealizedPnL, info.ClosedPnl) .TryAdd(PositionChangeTypes.AveragePrice, info.AvgOpenFillPrice) ); }