示例#1
0
        public void SetActivePosition(LivePosition position)
        {
            if (position != null && ActiveAccount.Portfolio.HasOpenPosition(position.Ticker))
            {
                ActivePosition = ActiveAccount.Portfolio.GetPosition <LivePosition>(position.Ticker);

                LiveQuoteForm.Instance.SetActiveSecurity(ActivePosition.Security);
                LiveTradeEntryForm.Instance.SetActiveSecurity(ActivePosition.Security);

                SingleSecurityIndicatorForm.Instance.SetSecurity(ActivePosition.Security);
            }
            else
            {
                ActivePosition = null;
            }
        }
示例#2
0
 protected void OnPositionChanged(LivePosition position)
 {
     PositionChanged?.Invoke(this, new OpenPositionEventArgs(position));
 }
 protected void OnOpenPositionUpdate(LivePosition position)
 {
     OpenPositionsUpdate?.Invoke(this, new OpenPositionEventArgs(position));
 }