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 Christopher_R, Today, 12:29 AM
        0 responses
        8 views
        0 likes
        Last Post Christopher_R  
        Started by sidlercom80, 10-28-2023, 08:49 AM
        166 responses
        2,235 views
        0 likes
        Last Post sidlercom80  
        Started by thread, Yesterday, 11:58 PM
        0 responses
        3 views
        0 likes
        Last Post thread
        by thread
         
        Started by jclose, Yesterday, 09:37 PM
        0 responses
        7 views
        0 likes
        Last Post jclose
        by jclose
         
        Started by WeyldFalcon, 08-07-2020, 06:13 AM
        10 responses
        1,415 views
        0 likes
        Last Post Traderontheroad  
        Working...
        X