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 ZenCortexCLICK, Today, 04:58 AM
          0 responses
          2 views
          0 likes
          Last Post ZenCortexCLICK  
          Started by sidlercom80, 10-28-2023, 08:49 AM
          172 responses
          2,280 views
          0 likes
          Last Post sidlercom80  
          Started by Irukandji, Yesterday, 02:53 AM
          2 responses
          17 views
          0 likes
          Last Post Irukandji  
          Started by adeelshahzad, Today, 03:54 AM
          0 responses
          4 views
          0 likes
          Last Post adeelshahzad  
          Started by Barry Milan, Yesterday, 10:35 PM
          3 responses
          13 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Working...
          X