• 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

Find out the data provider

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

    Find out the data provider

    Hello,

    Is there a way to find out what is the current data provider from code ?

    Thank you

    #2
    Hello,
    Thanks for your post.

    This can be accomplished by using the OnConnectionStatusUpdate() method by doing something similar to below. The below sample will print "Kinetick" if Provider7(Kinetick) is your connected data provider. You will likely need to print that value to determine which provider number you should use for your own code.

    Code:
    protected override void OnConnectionStatusUpdate(ConnectionStatusEventArgs connectionStatusUpdate)
    		{
    		  
    		if (connectionStatusUpdate.Connection.Options.Provider == Provider.Provider7)
    			Print("Kinetick");
    		}
    It is also important to note that this method will only work for State.Realtime and will not be valid with State.Historical.

    NinjaScript-- The Connection Class
    https://ninjatrader.com/support/help...tion_class.htm

    Please let me know if you have any further questions.
    JoshNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by pjsmith, 04-14-2018, 06:14 AM
    3 responses
    480 views
    0 likes
    Last Post NinjaTrader_EricB  
    Started by losfer, Today, 05:29 AM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_EricB  
    Started by otislauwaert, Today, 04:36 AM
    0 responses
    6 views
    0 likes
    Last Post otislauwaert  
    Started by Tiang, Yesterday, 11:33 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by MakesTrades23, Yesterday, 07:51 PM
    1 response
    17 views
    0 likes
    Last Post NinjaTrader_AlanP  
    Working...
    X