• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Loading Custom Instrument

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

    Loading Custom Instrument

    Good day

    I've taken some historic data from NinjaTrader/IB and created a contract that spans over a longer period.
    The data does import, but the problem that I have is this.

    If I load the historic data first, then it autocreates definitions for the instrument - says its a "stock" and the tick value and point price cant be changed.
    Besides that I was able to load the instrument onto an instrument list and use it for backtesting.

    If I create the instrument first, and then load the data for it, the instrument then has the correct values,
    but if I try and add it to an instrument list it keeps throwing the exception
    "Unhandled exception: Instrument not found, there is likely a problem with how the instrument is defined in the database".
    I am also unable to select the instrument in backtesting.

    Any ideas how I can load the backtesting data and set the values?
    Its historic data of CL that has a point value of 100, so with a default point value of 1 and adding commissions my testing results with commissions can be quite out.



    #2
    Hello bchip,

    To confirm, you are wanting to import to an instrument that is not already in the Tools > Instruments master list, is this correct?
    (I ask because the CL future is already in the master instrument list and it will not be possible to create two instruments using the same symbol)

    What is the instrument you are wanting to import this data to?
    Is the instrument an equity or a future?

    (If the instrument is a future, a new instrument will need added to the master instrument list and the rollover dates will need to be setup)

    Does the historical data file match the name format for the instrument type (meaning if the instrument is a future the expiry contract month is in the file name)?

    Below is a link to the help guide on the file and content formats.
    https://ninjatrader.com/support/help...AndDataFormats

    Please attach the file you are wanting to import.

    Also, please attach a screenshot of the instrument settings from Tools > Instruments > select the instrument > click edit.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Hello bchip,

      To confirm, you are wanting to import to an instrument that is not already in the Tools > Instruments master list, is this correct?
      (I ask because the CL future is already in the master instrument list and it will not be possible to create two instruments using the same symbol)
      Correct,it is an instrument that is not on the master list (It was called CL_TEST).
      The data correctly imported to CL_TEST from the file CL_TEST.Last.txt


      Originally posted by NinjaTrader_ChelseaB View Post
      What is the instrument you are wanting to import this data to?
      Is the instrument an equity or a future?

      (If the instrument is a future, a new instrument will need added to the master instrument list and the rollover dates will need to be setup)
      As CL it is a future, CL_TEST should have the exact same property values as CL.
      I am happy to manually add/edit these, but loading the file first I was not able to do so.
      Loading the instrument first under the master list I then could change the values, but could not longer select the instrument in the backtest.

      Originally posted by NinjaTrader_ChelseaB View Post
      Does the historical data file match the name format for the instrument type (meaning if the instrument is a future the expiry contract month is in the file name)?
      This could be the issue, as I have classified the instrument as a future but it did not have an expiry month.
      The data goes from 2015 to 2019 - how would classify the expiry month for a contiuous contract?
      Is it "CL_TEST ##-##"
      The file was only called CL_TEST.Last.txt

      Originally posted by NinjaTrader_ChelseaB View Post
      Also, please attach a screenshot of the instrument settings from Tools > Instruments > select the instrument > click edit.
      Ive attached a screenshot.

      Thank you
      Attached Files

      Comment


        #4
        Hello bchip,

        This would be the format for an equity not a future.

        Futures use expiry contract months in the file name.

        The help guide I have linked in my previous post shows the file format for a future:
        'ES 12-09.Bid.txt for the S&P E-mini December contract bid price data'

        For your needs the file name would be something similar to:
        CL_TEST 09-19.Last.txt or CL_TEST ##-##.Last.txt

        For the instrument settings only use the Default exchange and do not check any other exchanges (as this is not a real instrument on an exchange).

        The only symbol mapping needed will be for the Simulated Data Feed, but as a heads up, if you connect to a real-time connection this instrument will error as it attempts to download data.

        Video that demonstrates.
        https://drive.google.com/file/d/1N-J...w?usp=drivesdk
        Last edited by NinjaTrader_ChelseaB; 07-24-2019, 09:30 AM.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_ChelseaB View Post
          Hello bchip,

          Video that demonstrates.
          https://drive.google.com/file/d/1N-J...w?usp=drivesdk
          Hi, thanks the video was really helpful.

          I've followed it from the start (as I still couldnt get it right).
          So I deleted the instrument, I deleted the data and followed the video step by step.

          Everything is exactly the same, up to the point where you show the chart.
          (so I didnt use my own data, just like yours in the video I downloaded the latest contract data and exported)

          Once done:
          If I go into Chart and select then nothing happens.
          If I go into "Instrument List" it throws the exception again
          "Unhandled exception: Instrument not found, there is likely a problem with how the instrument is defined in the database".
          Backtesting I also cant select it.

          I am using version 8.0.17.2 64bit with a license

          Thank you
          Attached Files

          Comment


            #6
            Hello bchip,

            Are you connected to a data feed when the error appears?

            Does the error appear when you are not connected to a data feed?

            Before continuing please update to the latest version 8.0.18.1.

            Updates to NinjaTrader will contain the latest security updates and bug fixes, as well as new instruments and rollover dates.

            To update NinjaTrader
            • Shutdown all programs including NinjaTrader *important
            • Download NinjaTrader from the public link below
              Click here to download NinjaTrader
            • Double click the downloaded file to execute it
            • Follow the on screen instructions
            • Restart NinjaTrader
            If the error still occurs, please send an email to platformsupport [at] ninjatrader [dot] com so that we can schedule a call where I can observe.
            In the email please include a link to this forum thread.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_ChelseaB View Post
              Hello bchip,
              ...
              If the error still occurs, please send an email to platformsupport [at] ninjatrader [dot] com so that we can schedule a call where I can observe.
              In the email please include a link to this forum thread.

              Hi

              I've installed/updated and tried again, but still no success. I tried when I had no data feed.
              What I noticed was that the loading data made no difference,
              i.e. Its simply I try and create an instrument and then add it to a new instrument list and I already get the exception.
              I dont have to load any data to get the exception.

              Will email the address then.

              Thanks.

              Comment


                #8
                Hello bchip,

                It sounds like the behavior or error you are describing isn't with loading data for the instrument as I have demonstrated in the video.


                When exactly does the error appear?

                You mentioned:
                "If I go into Chart and select then nothing happens.
                If I go into "Instrument List" it throws the exception again"

                Are you talking about selecting a specific instrument list from the Instrument drop-down in the Data Series window when creating a new chart or from an existing chart?

                Are you talking about the Control Center > Tools > Instrument Lists window?

                Does the error appear when opening the window?

                Does the error appear when selecting an instrument list?

                Does the error appear when clicking add to the instrument lists or to the instruments in a specific list?

                Does the error appear when adding this specific instrument?
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_ChelseaB View Post
                  Hello bchip,

                  It sounds like the behavior or error you are describing isn't with loading data for the instrument as I have demonstrated in the video.
                  Hi Ive tried to answer all the questions below.
                  Ive also attached a pic of each screen that I click on, but basically the process is

                  1. Control Centre > Tools > Instrument -- click on add
                  2. Type in the details & select "Default" exchange
                  3. Type in the rest of the details
                  4. Add "CL_TEST" in Simulator
                  5. Now its showing in "Instruments"
                  6. Control Centre > Tools > Instrument Lists - click on add on the left pane and add the list "Testing"
                  7. Once "Testing" has been added, then on the right click on add to add the instrument
                  8. Once I click OK the error appears

                  Nothing else seems to be able to use this instrument either (like Backtesting or Charting)

                  Hope that describes the process well.


                  Comment


                    #10
                    Hello bchip,

                    Thank you for confirming the error appears when clicking OK to add this specific instrument to an instrument list.

                    This will occur if there are no rollover dates setup.

                    May I confirm you have set rollover dates so that NinjaTrader can choose the currently trading contract month automatically when adding to the Instrument List?

                    (You can open a chart without adding to the instrument list by typing CL_TEST ##-## in the Instrument Selector if you wish as demonstrated in the video I have provided)
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #11
                      Originally posted by NinjaTrader_ChelseaB View Post
                      Hello bchip,

                      Thank you for confirming the error appears when clicking OK to add this specific instrument to an instrument list.

                      This will occur if there are no rollover dates setup.

                      May I confirm you have set rollover dates so that NinjaTrader can choose the currently trading contract month automatically when adding to the Instrument List?

                      (You can open a chart without adding to the instrument list by typing CL_TEST ##-## in the Instrument Selector if you wish as demonstrated in the video I have provided)
                      Hi.
                      Thanks so much for your help so far.
                      I've added a contract month and it allows me to add the instrument to an instrument list now.
                      With the backtesting and chart I can now choose the instrument without any errors popping up.
                      However the backtesting doesnt display any results (I test a basic system of if 1 up candle then go long, so there definitely should be trades)
                      I take it I havent set the contract to the right value or I have changed the setting to automatically select the right contract month.
                      Not sure where to do that.

                      Ive taken some screenshots, hopefully they help.

                      Comment


                        #12
                        Oh I just figured it out. Sorry forgot to do something on my side with the data (after loading the new instrument).
                        I get results now.


                        Thank you, the service was phenomenal!

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by alenadruza, Today, 07:03 AM
                        0 responses
                        3 views
                        0 likes
                        Last Post alenadruza  
                        Started by sidviciousX, Today, 06:47 AM
                        0 responses
                        2 views
                        0 likes
                        Last Post sidviciousX  
                        Started by samir, 04-17-2019, 01:20 PM
                        4 responses
                        30 views
                        0 likes
                        Last Post gviand
                        by gviand
                         
                        Started by Debayan Sen, Today, 01:50 AM
                        0 responses
                        7 views
                        0 likes
                        Last Post Debayan Sen  
                        Started by eleven, Yesterday, 10:03 PM
                        1 response
                        11 views
                        0 likes
                        Last Post eleven
                        by eleven
                         
                        Working...
                        X