Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Importing instrument lists with symbol mapping

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

    #16
    Hello PaulMohn,

    Is NZD meant to be a forex pair, a future, or an equity?

    Are you able to load NZD as a row in TraderWorkstation?

    As an example NZDUSD would be a forex instrument in NinjaTrader.

    NinjaTrader does not have a 5YY 03-22, but there is a 5YR 03-22. (Try typing 5-Year in the Instrument selector to see the suggested available instruments)


    GetCurrentFuture is not documented or supported.

    Below are links to a few suggestions on getting the current expiry of an instrument.
    Hi, How can I get the current symbol for a future instrument ? I have a multi-instrument strategy and i look for something like GetInstrument(instrumentName), for example: GetInstrument("MNQ") returns "MNQ 09-20"; GetInstrument("MES") returns "MES 09-20"; Is this possible ? Thanks.


    I am working on an Indicator that references more than one symbol to measure overall market direction. I'd like to write this so that whenever the the contract rolls over to the latest contract that I will not need to modify the indicator. So is that something that I can query to get the latest name of the contract say the


    Chelsea B.NinjaTrader Customer Service

    Comment


      #17
      Hello Chelsea and thanks for the reply.

      Is NZD meant to be a forex pair, a future, or an equity?
      They are all Futures.

      Are you able to load NZD as a row in TraderWorkstation?
      They all load in TraderWorkstation (please see TWS Classics window in post #15 )


      As an example NZDUSD would be a forex instrument in NinjaTrader.
      please see TWS Classics window in post #15 (there are forex at the top EUR.AUD, USD.CAD, and futures at the bottom CAD, GBP, NZD etc.)

      Does NZDUSD in NinjaTrader refer to IB Spot Forex (i.e. NZD.USD Spot Forex IB symbol) or to the FX Futures (CME) Contract (i.e. NZD FX Futures Symbol) ?

      I need the FX Futures contracts not Spot Forex.

      Under
      Control Center > Tools > Instrument > Futures I can't find NZD.

      While NZDUSD appears
      under
      Control Center > Tools > Instrument > Forex

      How can I add it from NZD FX Futures from IB listing to NT8?


      NinjaTrader does not have a 5YY 03-22, but there is a 5YR 03-22. (Try typing 5-Year in the Instrument selector to see the suggested available instruments)
      5YR loads on the Chart, and I can find it under
      Control Center > Tools > Instrument > Futures > 5YR.

      If I use 5YR (NT symbol) instead of 5YY (IB Symbol) with AddDataSeries(), will it work?

      And How can I know what are the corresponding symbols for the other instruments?

      Here are the vylid symbols for IB

      Electronic Chicago Board of Trade (ECBOT)
      TN,5YY,30Y,2YY,10Y

      CME Globex Indexes
      MSF,MNH,CAD,GBP,NZD,MXP,ZAR,BRE,RUR,CHF

      Don't you have a NT8/IB correspondence Table?

      GetCurrentFuture is not documented or supported.
      Yes sorry for not precising before, that's a custom Method from Jim to retrieve the current/next expiry and add it to the AddDataSeries() method I use
      Expiry method and here from Jim

      Thanks!

      Comment


        #18
        Hello PaulMohn,

        Futures have an expiry like 06-22. NZD used without an expiry will load as an equity.

        NinjaTrader does not have an NZD 06-22 future and this would require setting up this custom instrument in the instrument manager. You will also need to setup the rollover dates for the future instrument as well.


        The 5YR 03-22 uses the symbol mapping '5YY|ECBOT' for Interactive Brokers. You can check the symbol mapping to see the corresponding instrument in the instrument settings.


        I do not have table of the instruments used in Interactive Brokers.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #19
          Futures have an expiry like 06-22. NZD used without an expiry will load as an equity.
          Jim's method provides the expiry. It' works for CL, ES and GC.

          I tested loading TN 06-22 on a blank chart and get this error
          Time Category Message
          28/03/2022 21:29:09 Default Error on requesting bars series: 'IB was unable to locate instrument. Please verify your symbol mapping is correct for instrument TN 06-22 Globex'
          Can you please test TN 06-22 to see if the error shows on your end?
          How to fix it? IB TWS loads and it streams quotes so TN 06-22 is working in TWS.

          NinjaTrader does not have an NZD 06-22 future and this would require setting up this custom instrument in the instrument manager. You will also need to setup the rollover dates for the future instrument as well.
          https://ninjatrader.com/support/help...tMonthsSection

          The 5YR 03-22 uses the symbol mapping '5YY|ECBOT' for Interactive Brokers. You can check the symbol mapping to see the corresponding instrument in the instrument settings.
          https://ninjatrader.com/support/help...mbolMapSection

          I do not have table of the instruments used in Interactive Brokers.
          Please do you have exact steps or demo on how to do it (I've never done it before)? Thanks!

          How do I know/find how to fill those fields

          Exchange
          Point value
          Merge Policy
          Sim feed start price
          Trading Hours
          Tick Size
          Description
          URL
          Interactive Brokers
          Contract months

          Click image for larger version  Name:	5yy (1).png Views:	0 Size:	318.8 KB ID:	1195611

          From the IB pages (post #13)? Or from elsewhere? How would you do it to make it work with the AddDataSeries() method? Thanks!
          Last edited by PaulMohn; 03-28-2022, 01:49 PM.

          Comment


            #20
            Hello PaulMohn,

            At this time I do not have an account to test with on my end.

            However, I would expect a chart with the TN 06-22 to load if you are subscribed to real-time data. The symbol mapping for IB is also TN.

            Have you changed the settings of the TN future in the Instrument window? (if so reset this in Tools -> Database Management -> Update Instruments)

            If I recall, the instrument settings come from the Instrument right-click menu -> Contract Info -> Description in TWS.

            Regarding the 5YY instrument you are creating, the 5YY symbol mapping is already used for 5YR 03-22 (Micro 5-Year Yield Futures). You cannot use the same symbol mapping on multiple instruments and you will need to choose a different symbol map for the 5YY. (Or use 5YR 03-22 if you are intending to pull up Micro 5-Year Yield Futures)


            Chelsea B.NinjaTrader Customer Service

            Comment


              #21
              Ok, I'll test and see next. But back to my Trading Hours question what's the Ninjatrader Trading Hours preset for


              Trading Hours
              Sun 17:00-23:59
              Mon 00:00-16:00
              17:00-23:59
              Tue 00:00-16:00
              17:00-23:59
              Wed 00:00-16:00
              17:00-23:59
              Thu 00:00-16:00
              17:00-23:59
              Fri 00:00-16:00
              Sat 00:00-00:00
              Liquid Trading Hours
              Sun 17:00-23:59
              Mon 08:30-16:00
              Tue 08:30-16:00
              Wed 08:30-16:00
              Thu 08:30-16:00
              Fri 00:00-00:00
              Sat 17:00-23:59

              Comment


                #22
                Hello PaulMohn,

                I'm not aware of a trading hours template with these hours. However, you can make one.


                The TN 06-22 and 5YR 03-22 both use the CBOT Interest Rate ETH trading hours template.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #23
                  Chelsea I've done Tools > Database management > Update instrument with ticked General Properties and Symbol Mappings but TN still returns the error.
                  I have real-time data subscription.

                  Click image for larger version  Name:	TN.png Views:	0 Size:	1.12 MB ID:	1195630

                  Comment


                    #24
                    Hello PaulMohn,

                    You could try using TN|ECBOT as the symbol mapping.

                    May I confirm you have not created a second instrument using TN as the symbol mapping?

                    May I see the instrument settings?
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #25
                      Chelsea, I've tested NKD symbol which gives no error but it doesn't load the data on the chart
                      Click image for larger version  Name:	blankchartNKD.png Views:	0 Size:	358.6 KB ID:	1195639
                      Click image for larger version  Name:	nkd1.png Views:	0 Size:	741.6 KB ID:	1195638


                      Click image for larger version  Name:	nkd.png Views:	0 Size:	31.7 KB ID:	1195636



                      Here's my NKD settings

                      Click image for larger version  Name:	NKD Settings.png Views:	0 Size:	396.8 KB ID:	1195643

                      I've tested with NKD|CME and now I get the error
                      Time Category Message
                      28/03/2022 23:53:37 Connection IB was unable to locate instrument. Please verify your symbol mapping is correct for instrument NKD 06-22 Globex
                      Ok, found the solution, it was NKD|GLOBEX
                      Attached Files
                      Last edited by PaulMohn; 03-28-2022, 04:00 PM.

                      Comment


                        #26
                        Originally posted by NinjaTrader_ChelseaB View Post
                        Hello PaulMohn,

                        You could try using TN|ECBOT as the symbol mapping.

                        May I confirm you have not created a second instrument using TN as the symbol mapping?

                        May I see the instrument settings?
                        Here the setting for TN

                        Click image for larger version  Name:	TN Settings.png Views:	0 Size:	861.0 KB ID:	1195641

                        IB has just TN. I'll test as you suggest with TN|ECBOT

                        I tested and the error still show up
                        Click image for larger version  Name:	TN ECBOT.png Views:	0 Size:	1.23 MB ID:	1195642


                        Ok, Found the solution, for some reason the Exchange ticked was Globex as default.

                        I unticked it and then ticked Ecbot (Chicago Board of trade electronic)
                        (still with the TN|ECBOT as IB mapping)
                        Now it loads data on the chart.

                        Does the wrong exchange is also ticked on you end for TN by default? Might be an issue with the latest NT release (someone ticked the wrong exchange, and forgot to add the complete mapping for IB for at least for TN and NDK).
                        Last edited by PaulMohn; 03-28-2022, 04:07 PM.

                        Comment


                          #27
                          Chelsea how do I set the Rollover date and offset?

                          I've found the CME Specs page for NZD contract from the IB Specs page

                          NZD IB specs page

                          Click image for larger version  Name:	IB NZD Specs page.png Views:	0 Size:	708.3 KB ID:	1195666

                          NZD CME Specs page

                          Click image for larger version  Name:	NZD CME Specs page.png Views:	0 Size:	454.8 KB ID:	1195667

                          Instrument Settings for Rollover Date and Offset

                          Click image for larger version  Name:	Rollover and Sim feed.png Views:	0 Size:	1.05 MB ID:	1195668


                          Listed Contracts
                          Quarterly contracts (Mar, Jun, Sep, Dec) listed for 6 consecutive quarters

                          Termination of Trading
                          Trading terminates at 9:16 a.m. CT, 2 business day prior to the third Wednesday of the contract month.
                          Do you have a default way to set the Rollover date and offset based on the Termination of Trading CME info?

                          How would I set them to automatically rollover before the Termination of Trading date?

                          For example, how would I make sure it rolls over 5 days prior the third Wednesday of Mar, Jun, Sep, Dec 2022 and every subsequent year?
                          What how to make it do it automatically (I mean without having to manually go find the date and every time typing it in)? What Function to call to do it if there is one?
                          More generally how Ninjatrader manages rollovers and how to mimic it if possible?

                          The doc
                          Contract Month Properties


                          Once a contract is selected in the Configured section you may edit it properties. The Contract month, Offset value, and Rollover date are used when NinjaTrader automatically merges historical data.



                          The Offset value is used to connect the last value of a contract month with the next one.



                          Although NinjaTrader will attempt to download the Offset values from the data server, if they do not exist on the data server, they will be calculated locally. Offsets are only downloaded when the "Offset" field is left blank and the rollover date matches the date defined on the server.



                          When NinjaTrader will calculate the Offset value locally:



                          •The Offset field in the Contract Months window is blank

                          •Historical data exists in the database for both the new and old contract near the rollover date

                          •The Merge Back Adjusted policy must be selected in the Market data category of the Options menu

                          •You must be connected to your data provider and requesting data for the instrument



                          How NinjaTrader will calculate the Offset value locally:



                          •Request the old and new expiry’s daily price data for calculations

                          •If daily data is not offered by the data provider, use minute data

                          •If minute data is not offered by the data provider, default Offset value will be 0

                          •One day prior to the rollover date, calculate the difference between the close price of the new expiry and the close price of the old expiry. This is the Offset value.

                          •If you wish to overwrite the calculated Offset value you can input in your own

                          •When using minute data, the close price at the ending time as defined in the default session template for the instrument will be used
                          Notes:

                          1.If you inputted your own Offset value, it will be overwritten by values downloaded from the data server if it exists there. To prevent this you will need to ensure that your rollover date is not the same as the ones coming from the data server.

                          2.The rollover date is the date to roll into the selected contract month and NOT out of.
                          Also how do I set the Sim feed start price? Thanks!


                          I figured I could use the Ninjatrader FX Futures Equivament symbols and create an equivalence table

                          NT8 - TWS
                          6A = AUD
                          6B = GBP
                          6C = CAD
                          6E = EUR
                          6J = JPY
                          6L = BRE
                          6M = MXP
                          6R = RUR

                          Then I found again as default the 6A, 6B, 6C etc. Ninjatrader 8 symbols don't include the correct mapping for IB (Only the symbol without "|GLOBEX")

                          I added the |GLOBEX to the symbols mapping, then changed the AddDataseries() and corresponding lines to use the NT8 symbols (6A, 6B, 6C etc. not as previously the TWS AUD, GBP, CAD etc.)

                          PHP Code:
                          // FX - CME - GLOBEX
                          AddDataSeries(GetCurrentFuture("6A"), BarsPeriodType.Day1); // AUD - GLOBEX
                          AddDataSeries(GetCurrentFuture("6C"), BarsPeriodType.Day1); // CAD - GLOBEX
                          AddDataSeries(GetCurrentFuture("6E"), BarsPeriodType.Day1); // EUR - GLOBEX
                          AddDataSeries(GetCurrentFuture("6B"), BarsPeriodType.Day1); // GBP - GLOBEX
                          AddDataSeries(GetCurrentFuture("6N"), BarsPeriodType.Day1); // NZD (New Zealand Dollar) - GLOBEX
                          AddDataSeries(GetCurrentFuture("6M"), BarsPeriodType.Day1); // MXP (Mexican Peso) - GLOBEX
                          AddDataSeries(GetCurrentFuture("6Z"), BarsPeriodType.Day1); // ZAR (South African Rand) - GLOBEX
                          AddDataSeries(GetCurrentFuture("6B"), BarsPeriodType.Day1); // BRE (Brazilian Real) - GLOBEX
                          AddDataSeries(GetCurrentFuture("6R"), BarsPeriodType.Day1); // RUR (Russian Ruble) - GLOBEX
                          AddDataSeries(GetCurrentFuture("6S"), BarsPeriodType.Day1); // CHF - GLOBEX
                          AddDataSeries(GetCurrentFuture("6J"), BarsPeriodType.Day1); // YEN - GLOBEX 
                          PHP Code:
                          // FX - CME - GLOBEX
                          AddDataSeries(GetCurrentFuture("AUD"), BarsPeriodType.Day1); // AUD - GLOBEX
                          AddDataSeries(GetCurrentFuture("CAD"), BarsPeriodType.Day1); // CAD - GLOBEX
                          AddDataSeries(GetCurrentFuture("EUR"), BarsPeriodType.Day1); // EUR - GLOBEX
                          AddDataSeries(GetCurrentFuture("GBP"), BarsPeriodType.Day1); // GBP - GLOBEX
                          AddDataSeries(GetCurrentFuture("NZD"), BarsPeriodType.Day1); // NZD (New Zealand Dollar) - GLOBEX
                          AddDataSeries(GetCurrentFuture("MXP"), BarsPeriodType.Day1); // MXP (Mexican Peso) - GLOBEX
                          AddDataSeries(GetCurrentFuture("ZAR"), BarsPeriodType.Day1); // ZAR (South African Rand) - GLOBEX
                          AddDataSeries(GetCurrentFuture("BRE"), BarsPeriodType.Day1); // BRE (Brazilian Real) - GLOBEX
                          AddDataSeries(GetCurrentFuture("RUR"), BarsPeriodType.Day1); // RUR (Russian Ruble) - GLOBEX
                          AddDataSeries(GetCurrentFuture("CHF"), BarsPeriodType.Day1); // CHF - GLOBEX
                          AddDataSeries(GetCurrentFuture("JPY"), BarsPeriodType.Day1); // YEN - GLOBEX 
                          That solves the FX Futures symbol mapping and I can use the NT8 defaults ones with IB (spares having to recreate new symbols and I can use the already built in Rollover setting from NT8 already preset symbols)
                          Last edited by PaulMohn; 03-29-2022, 05:00 AM.

                          Comment


                            #28
                            Originally posted by NinjaTrader_ChelseaB View Post
                            Hello PaulMohn,

                            I'm not aware of a trading hours template with these hours. However, you can make one.


                            The TN 06-22 and 5YR 03-22 both use the CBOT Interest Rate ETH trading hours template.
                            For NZD Trading Hours

                            Control Center > Tools > Trading Hours > CME FX Futures ETH

                            Click image for larger version

Name:	FX Trading Hours.png
Views:	125
Size:	1.38 MB
ID:	1195670

                            Checked the Schedule Sunday to Friday 17:00 to 16:00
                            matches
                            Chicago Mercantile Exchange (CME)
                            NZD
                            https://misc.interactivebrokers.com/cstools/contract_info/v3.10/index.php?action=CONTRACT_DETAILS&clt=1&detlev=2&s ite=IB&sess=1648469829&mid=001&conid=460126366



                            Comment


                              #29
                              Hello PaulMohn,

                              The Rollover dates are set in the Contract Months window, opened from the bottom of the Instrument settings.

                              There is a link to the help guide in post #18.

                              The rollover dates cannot be set automatically and need to be entered one by one.

                              NinjaTrader's product management team looks these up, and enters these one by one for each instrument for the default instrument settings.

                              To set the Sim feed start price for the Simulated Data Feed, type a value in the Sim feed start price input in the Instrument settings.


                              Chelsea B.NinjaTrader Customer Service

                              Comment


                                #30
                                Ok, thanks Chelsea. Do you mean NinjaTrader's product management team look the Dates and then we get it from the server call into our NT terminals?
                                Why isn't it automated? I guess because the exact dates aren't "linear" enough / they can change depending on the CME?
                                If they are linear enough on the other Hand (i.e. for example every 4 days prior to the 3rd Wednesday of the expiry month) wouldn't it be easier to set them in an automated way?



                                To Recap my findings:

                                Before Considering adding new symbols with the AddDataSeries() method to be used with Interactive Brokers, first LOAD EACH SYMBOL in a Ninjatrader 8 Chart.
                                That Way you can check IF THEY ARE MAPPED AT ALL / CORRECTLY MAPPED as a first step.

                                The symbols that do not load on the Chart (for which you have an IB subscription) are ones NOT MAPPED AT ALL / CORRECTLY MAPPED.

                                Then proceed to MAP/REMAP those symbols to clear the mapping errors before using them in the ADDDATASERIES() method.

                                2 types of "mapping" error can occurs:

                                A Log tab error explicit:

                                That shows up in the log Tab
                                That means the Exchange ticked is the wrong one and / or the exchange is not specified in the Interactive Brokers mapping Field,
                                but the IB symbol is set (alone) in the Interactive Brokers mapping Field.

                                Solution: Untick the wrong Exchange and tick the right exchange for the Exchange Menu,
                                and add the Pipe + Exchange to the IB symbol in the IB mapping Field for the Interactive Brokers Menu.

                                A Log Tab implicit Error
                                Nothing shows on the log tab and nothing shows on the chart (the indicator returns nothing)

                                That means the the Exchange ticked is the right one (I think)
                                But nothing is added to the Interactive Brokers Mapping Field.

                                Solution: Fill in the Interactive brokers Mapping Filed the IB symbol + Pipe + Exchange (i.e. fr example ZS|ECBOT)

                                Takeaways:

                                We need NT8 symbols for the AddDataSeries() exclusively (not IB symbols).
                                But for many NT8 symbols, they are either not mapped for IB at all (ZS example, empty IB filed in instrument),
                                or the IB Field lacks the exchange reference (i.e "|GLOBEX" or "|ECBOT" etc.)
                                or and the Wrong exchange is selected (Globex is ticked instead on Ecbtt for example).

                                Therefore I had to double-check each symbol instrument settings for

                                Exchange (Globex or Ecbot and tick the correct one)
                                Interactive Brokers (type the symbol + pipe + Exchange , i.e for example ZS|ECBOT)

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by tsantospinto, 04-12-2024, 07:04 PM
                                7 responses
                                126 views
                                0 likes
                                Last Post aligator  
                                Started by futtrader, 04-21-2024, 01:50 AM
                                5 responses
                                56 views
                                0 likes
                                Last Post NinjaTrader_Eduardo  
                                Started by PeakTry, Today, 10:49 AM
                                0 responses
                                2 views
                                0 likes
                                Last Post PeakTry
                                by PeakTry
                                 
                                Started by llanqui, Today, 10:32 AM
                                0 responses
                                5 views
                                0 likes
                                Last Post llanqui
                                by llanqui
                                 
                                Started by StockTrader88, 03-06-2021, 08:58 AM
                                45 responses
                                3,992 views
                                3 likes
                                Last Post johntraderuser2  
                                Working...
                                X