• 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

Connection Status in an Indicator?

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

    Connection Status in an Indicator?

    Hi,

    I would like to know if there is a connection in an indicator. I already use Historical but would like to know if NT7 is actually connected to a data feed.

    Is there any way to determine this?

    Thanks in advance,
    Ivan

    #2
    Hello AusTrader,
    Thanks for your post.

    You can check for connectivity with the OnConnectionStatus() function: https://ninjatrader.com/support/help...tionstatus.htm

    This next part was undocumented and unsupported in NT7, but you could also loop through the Account objects and find the connection that way. Something like the following snippet will print the connection name to the Output window on each bar close.

    Code:
    protected override void OnBarUpdate()
    {
        foreach (Account acct in Cbi.Globals.Accounts)
        {    
              Print(acct.Connection.Options.Name);
        }
    }
    Last edited by NinjaTrader_JoshG; 10-26-2018, 07:28 AM.
    JoshNinjaTrader Customer Service

    Comment


      #3
      Thanks for that Josh :-)

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by TazoTodua, Today, 01:26 AM
      0 responses
      1 view
      0 likes
      Last Post TazoTodua  
      Started by TazoTodua, Today, 01:21 AM
      0 responses
      1 view
      0 likes
      Last Post TazoTodua  
      Started by TikDaddy, Yesterday, 02:08 PM
      3 responses
      11 views
      0 likes
      Last Post TikDaddy  
      Started by Brillo, Yesterday, 01:52 PM
      1 response
      16 views
      0 likes
      Last Post NinjaTrader_Jim  
      Started by TazoTodua, 02-09-2018, 08:40 AM
      10 responses
      884 views
      0 likes
      Last Post NinjaTrader_JoshG  
      Working...
      X