• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bars.MarketData.Connection

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Bars.MarketData.Connection

    Always on converting stuff from 7 to 8

    Code:
    private bool DisplayTime()
            {
    			if (ChartControl != null
    					&& Bars != null
    					&& Bars.Count > 0
    					&& Bars.MarketData != null
    					&& Bars.MarketData.Connection.PriceStatus == Cbi.ConnectionStatus.Connected)
    				return true;
    			
                return false;
            }
    		
    		private DateTime RightNow
    		{
    			get 
    			{ 
    				DateTime now = (Bars.MarketData.Connection.Options.Provider == Bars.IsInReplayMode ? Bars.MarketData.Connection.Now : DateTime.Now); 
    
    				if (now.Millisecond > 0)
    					now = Cbi.Globals.MinDate.AddSeconds((long) System.Math.Floor(now.Subtract(Cbi.Globals.MinDate).TotalSeconds));
    
    				return now;
    			}
    		}
    I have problem with these lines :

    Bars.MarketData

    Bars.MarketData.Connection.PriceStatus == Cbi.ConnectionStatus.Connected

    Bars.MarketData.Connection.Options.Provider

    Bars.MarketData.Connection.Now

    Cbi.Globals.MinDate

    #2
    Hello blar58,

    Thanks for your post.

    The code segment appears to be the same as what is in the BarTimer indicator in NT7. Please check the NT8 BarTimer indicator for the equivalents used.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thanks Paul

      Comment


        #4
        This might also help some people:

        Bars.Instrument.GetMarketDataConnection()

        DateTime now = (Bars.IsInReplayMode ? Bars.Instrument.GetMarketDataConnection().Now : DateTime.Now);

        Then look for the options in the returned connection object. I'm not really sure of the correct namespace object for the Connection though.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by spikeruk, Today, 01:49 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by Yandychang, Today, 02:16 PM
        2 responses
        7 views
        0 likes
        Last Post Yandychang  
        Started by priceisking, Today, 01:16 PM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by kashyapjdave, 03-23-2017, 12:12 AM
        11 responses
        1,956 views
        0 likes
        Last Post forextrader2003  
        Started by Gav_G, 07-26-2018, 04:29 PM
        5 responses
        422 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Working...
        X