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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        650 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        370 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        109 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        574 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        577 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X