Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

AddOn BarsRequest by Connection

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

    AddOn BarsRequest by Connection

    Different Connections can provide data for the same Instrument, with it being highly likely that the different Providers will provide different data for the same Instrument at the same time; e.g. Ask/Bid prices, possibly volume.

    The BarsRequest method allows specification of Instrument but not Connection.

    In an AddOn that handles multiple Instruments and multiple non-Simulation Accounts (and therefore multiple Connections), how does one make a BarsRequest for a specific Instrument on a specific Connection?

    If it cannot be done with BarsRequest, can it be done with any other approach?

    Thanks.
    Multi-Dimensional Managed Trading
    jeronymite
    NinjaTrader Ecosystem Vendor - Mizpah Software

    #2
    Hello jeronymite,

    The bars request would use the platforms general connection settings and what you are currently connected to. Connections that are not connected could not be used until you connect to them. If you have connections which share data you can configure that in the options menu. There is otherwise not a way to specify the connection when using a bars request.

    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks, Jesse.

      Understood that only active (Connected) Connections can be used.

      Suppose one has live Forex Accounts with CityIndex, FXCM and IB, and all three are Connected at the same time. It is likely that each of the three will provide different realtime data from the others. (The same could be true for multiple Accounts for Futures or other Instrument types and associated Providers.)

      In an AddOn that actively trades all three Accounts, it only makes sense to submit Orders to each Account if the data used to make decisions for each Order is from the relevant Provider. One can set Options as you have recommended, but that would not make it possible to obtain realtime data from all three Account Providers in this case.

      In this type of AddOn scenario, how can one obtain specific realtime data from each of the three specific Providers?

      Thanks.
      Multi-Dimensional Managed Trading
      jeronymite
      NinjaTrader Ecosystem Vendor - Mizpah Software

      Comment


        #4
        Hello jeronymite,

        Considering that you can only set one preferred provider in the options the given scenario is not going to work in general, you would need to set a preferred provider which you wanted to use for the data if you want data from one specific connection.

        The account being traded really has no relevance here in terms of data, the account is sending orders to the associated connection for that account, that has nothing to do with the live data subscription. You can mix and match getting live data from one provider and submitting to another, you can't mix multiple providers using the same data and try to differentiate them. Only 1 of them is going to be the data source that you see in charts or that scripts use.

        If you need to trade 3 accounts in an addon you would need to pick one connection to use for data which will drive that addon, the orders for each account would be submitted to its appropriate connection.




        JesseNinjaTrader Customer Service

        Comment


          #5
          Thanks again, Jesse.

          So to be clear, it is not possible within NinjaScript to select a source of price data. It is determined by the first Connection of the type required, or the set preferred Provider.

          In the scenario already mentioned, Accounts correspond to Connections. Each Connection corresponds with a Provider. Each Provider will have, at its source, price data that is specific to that Provider and that Account. So, in the scenario mentioned, the following may be the case:
          • Connected to CityIndex as the first (or preferred) Connection, thereby receiving all price data from CityIndex
          • At some moment in time, CityIndex data for EURUSD is Ask = 1.0010'0, Bid = 1.0009'0, Spread = 0.0001'0
          • At that same moment, FXCM data for EURUSD is Ask = 1.0010'0, Bid = 1.0009'8, Spread = 0.0000'2
          • And at that same moment, IB data for EURUSD is Ask = 1.0010'0, Bid = 1.0008'0, Spread = 0.0002'0
          • The only visible/accessible price data in the platform is the CityIndex data
          So, if trading EURUSD, the range of the spreads in all three Accounts/Connections/Providers' data is 0.0001'8, a very significant difference, highly likely to be relevant to decision-making on which Accounts are appropriate to trade. Yet that difference is not visible in the platform, nor able to be obtained by any data query.

          In summary, it is not currently possible (supported or unsupported) to monitor prices for any specific Instrument using data from different Providers, correct? In other words, price data will always be only available from one and only one Provider. Accounts connected to other Providers cannot be queried for prices from those other Providers.

          If this is a correct summary, is there any intention to enhance the platform to make it possible to use data for any Instrument from any (connected) Connection/Provider providing price data for the Instrument?

          Given that price data from different Providers will inevitably vary, and even within Providers it may vary according to account type, the need to be able to see price data from every Connection is critical to informed trading decisions. This means that this enhancement should be a high priority for the platform. Even more so as the number of enquiries in this forum about trading multiple accounts is significant.

          Thanks.
          Multi-Dimensional Managed Trading
          jeronymite
          NinjaTrader Ecosystem Vendor - Mizpah Software

          Comment


            #6
            Hello jeronymite,

            To select a source of price data you need to use the options menu as I linked previously. That's platform wide, NinjaScript has nothing to do with this question. You can't open 3 charts for 3 different feeds using the same instrument, all 3 charts would use the same data source for the instrument. That is how the platform is designed to work.

            When using multiple feeds with the same instrument its data is determined by a few factors. Whichever connection supports the instrument, if multiple connections support it then its connection order or if you selected a preferred data feed in the options menu then that is used. This is a core feature of how the platform works so this would not be something which would be likely to be changed, that would affect all users of the platform if that were changed.

            If you use multiple providers it would be up to you to figure out which works best for your trading, that is going to be your preference to set for the preferred data feed. Most users do not use more than 1 feed, in the chance you do then you can still only use 1 feed at a time for the same instrument. Multiple feeds is really only beneficial if you get some instruments on one data provider, some on another but can trade all of them on the actual brokerage connection. In that use case there are no overlapping instruments and you are using both feeds at once.





            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by llanqui, Today, 03:53 AM
            0 responses
            6 views
            0 likes
            Last Post llanqui
            by llanqui
             
            Started by burtoninlondon, Today, 12:38 AM
            0 responses
            10 views
            0 likes
            Last Post burtoninlondon  
            Started by AaronKoRn, Yesterday, 09:49 PM
            0 responses
            15 views
            0 likes
            Last Post AaronKoRn  
            Started by carnitron, Yesterday, 08:42 PM
            0 responses
            11 views
            0 likes
            Last Post carnitron  
            Started by strategist007, Yesterday, 07:51 PM
            0 responses
            14 views
            0 likes
            Last Post strategist007  
            Working...
            X