Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NinjaTrader globals

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

    NinjaTrader globals

    Hello,

    in NT7 I could access global variables in the static object NinjaTrader.Cbi.Globals
    for example I could have access to a Connections object (a list of Connection)

    In NT8 this has changed, It seems to be in NinjaTrader.Core.Globals , but it is not there.

    Any help available? I would be intererested in the global Connections object.


    Best regards
    Andreas

    #2
    Originally posted by zweistein View Post
    Hello,

    in NT7 I could access global variables in the static object NinjaTrader.Cbi.Globals
    for example I could have access to a Connections object (a list of Connection)

    In NT8 this has changed, It seems to be in NinjaTrader.Core.Globals , but it is not there.

    Any help available? I would be intererested in the global Connections object.


    Best regards
    Andreas
    Is this it? http://ninjatrader.com/support/forum...ad.php?t=75608

    Comment


      #3
      Originally posted by koganam View Post
      That should do the trick for the Connection object. Are there any other specific objects you are looking for?
      Dave I.NinjaTrader Product Management

      Comment


        #4
        In NT7 I would do this (see below) to get current market data for an Instrument.

        In NT8 however I cannot find the Connections object any more.


        Best regards
        Andreas




        namespace Zweistein {

        public class NinjaTraderController {

        static public double CurrenMarketData(NinjaTrader.Cbi.Instrument instrument)
        {

        foreach (NinjaTrader.Cbi.Connection Connection in NinjaTrader.Cbi.Globals.Connections)
        {
        if (Connection.MarketDataStreams != null)
        {
        MarketDataDictionary d = Connection.MarketDataStreams;
        MarketData md = d[instrument];
        if (md != null)
        {
        MarketDataEventArgs mdea = md.Last;
        if (mdea == null) return 0.0;
        return mdea.Price;
        }
        }
        }
        return 0.0;
        }

        }
        }

        Comment


          #5
          Originally posted by zweistein View Post
          In NT7 I would do this (see below) to get current market data for an Instrument.

          In NT8 however I cannot find the Connections object any more.


          Best regards
          Andreas




          namespace Zweistein {

          public class NinjaTraderController {

          static public double CurrenMarketData(NinjaTrader.Cbi.Instrument instrument)
          {

          foreach (NinjaTrader.Cbi.Connection Connection in NinjaTrader.Cbi.Globals.Connections)
          {
          if (Connection.MarketDataStreams != null)
          {
          MarketDataDictionary d = Connection.MarketDataStreams;
          MarketData md = d[instrument];
          if (md != null)
          {
          MarketDataEventArgs mdea = md.Last;
          if (mdea == null) return 0.0;
          return mdea.Price;
          }
          }
          }
          return 0.0;
          }

          }
          }
          There is a plethora of Connection stuff exposed.

          ref: http://ninjatrader.com/support/helpG...tion_class.htm



          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          663 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          376 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          110 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          575 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          580 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X