• 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 Seneca, Today, 10:50 AM
      2 responses
      20 views
      0 likes
      Last Post Seneca
      by Seneca
       
      Started by antrux, Today, 09:47 AM
      2 responses
      11 views
      0 likes
      Last Post antrux
      by antrux
       
      Started by wtfalfred, Today, 06:04 AM
      1 response
      11 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by guillembm, Today, 09:02 AM
      1 response
      13 views
      0 likes
      Last Post NinjaTrader_SergeyS  
      Started by Johnny Santiago, Today, 07:18 AM
      1 response
      18 views
      0 likes
      Last Post NinjaTrader_ChristopherD  
      Working...
      X