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.

    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 Mindset, Today, 06:46 AM
        0 responses
        8 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, Yesterday, 05:21 PM
        0 responses
        13 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        15 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        82 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        47 views
        0 likes
        Last Post PaulMohn  
        Working...
        X