• 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, 08:28 AM.
    JoshNinjaTrader Customer Service

    Comment


      #3
      Thanks for that Josh :-)

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Dan_D_Trader, Today, 03:49 PM
      0 responses
      4 views
      0 likes
      Last Post Dan_D_Trader  
      Started by JohnAymin, Today, 02:38 PM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_Tyler  
      Started by Rmos22, Today, 02:20 PM
      2 responses
      23 views
      0 likes
      Last Post Rmos22
      by Rmos22
       
      Started by sawtooth500, Today, 12:59 PM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_Spencer  
      Started by Steve L, Yesterday, 09:36 PM
      1 response
      24 views
      0 likes
      Last Post NinjaTrader_Kate  
      Working...
      X