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 kevinenergy, 02-17-2023, 12:42 PM
          118 responses
          2,777 views
          1 like
          Last Post kevinenergy  
          Started by briansaul, Today, 05:31 AM
          0 responses
          6 views
          0 likes
          Last Post briansaul  
          Started by fwendolynlpxz, Today, 05:19 AM
          0 responses
          4 views
          0 likes
          Last Post fwendolynlpxz  
          Started by traderqz, Yesterday, 12:06 AM
          11 responses
          28 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by PaulMohn, Today, 03:49 AM
          0 responses
          8 views
          0 likes
          Last Post PaulMohn  
          Working...
          X