public LiveSecurityCreatedEventArgs(LiveSecurity security_) { NewlyCreated = security_; }
private void subscribeToBbgLive() { var gmtStartTime = TimeZoneHelper.ConvertDateTime(DateTime.Now.AddMinutes(-1d).StartOfMinute(), TimeZoneInfo.Local, TimeZoneInfo.Utc); // need to subscribe to 3 things, the priorContract, the newContract, and the spread m_spreadTickerFormation = AttributeHelper.GetSingleAttribute<BbgContractAttribute>(Set).SpreadTickerFormation; // 1) back contract { var ticker = BackContractBloombergTicker(); m_bbgLive_candles_BackContract = BbgTalk.Core.Instance.GetLiveSecurityBarData( gmtStartTime_: gmtStartTime, ticker_: ticker, barWidthInMinutes_: 1); m_bbgLive_Price_BackContract = BbgTalk.Core.Instance.GetLiveSecurity(securityId_: ticker, fields_: new[] { BBG_LIVE_FIELD }, intervalInSeconds_: 2d); subscribeToBackContractCandles(); } // 2) front contract { var ticker = FrontContractBloombergTicker(); m_bbgLive_candles_FrontContract = BbgTalk.Core.Instance.GetLiveSecurityBarData( gmtStartTime_: gmtStartTime, ticker_: ticker, barWidthInMinutes_: 1); m_bbgLive_Price_FrontContract = BbgTalk.Core.Instance.GetLiveSecurity(securityId_: ticker, fields_: new[] { BBG_LIVE_FIELD }, intervalInSeconds_: 2d); subscribeToFrontContractCandles(); subscribeToFrontContractPrice(); } // 3) spread { var ticker = SpreadContractBbgTicker(m_spreadTickerFormation); m_bbgLive_candles_spread = BbgTalk.Core.Instance.GetLiveSecurityBarData( gmtStartTime_: gmtStartTime, ticker_: ticker, barWidthInMinutes_: 1); m_bbgLive_Price_Spread = BbgTalk.Core.Instance.GetLiveSecurity(securityId_: ticker, fields_: new[] { BBG_LIVE_FIELD }, intervalInSeconds_: 2d); } subscribeToSpreadContractCandles(); subscribeToSpreadContractPrice(); }
public void Dispose() { subscribeToLiveSecurity(m_sec, false); m_sec = null; }
private void subscribeToLiveSecurity(LiveSecurity sec_, bool do_=true) { if (sec_ == null) return; sec_.PropertyChanged -= handleSecurityChanged; if (!do_) return; sec_.PropertyChanged += handleSecurityChanged; }
private void subscribeToThis(LiveSecurity sec_) { subscribeToLiveSecurity(m_sec, false); m_sec = sec_; subscribeToLiveSecurity(m_sec); }
public LsLiveSecurity(LiveSecurity liveSecurity) { this.liveSecurity = liveSecurity; }