Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Roll problem

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

    Roll problem

    Hi
    Today is rolling time in Crude Oil going from CL 07-20 to CL 08-20.
    I am changing the contract but my indicator is still using the old CL 07-20 and it will do so for the full day of the roll.

    In my code I am using instrument when I refer to the contract.

    If I use the print statement to debug and print the Instrument.FullName I see CL 07-20 even if I have changed the chart to CL 08-20.

    Do you have any idea about this weird behavior ?

    Thank you


    #2
    Today the front contract is CLN20 yet, IMHO, the rollover next week seems to me

    Comment


      #3
      Hello blar58,

      The indicator's primary series will be the series of the chart.

      Does the script call AddDataSeries() to add a secondary series?

      In the script are you printing the Instrument.FullName to the output window?
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Chelsea
        I am calling AddDataSeries() to add a secondary series ( 1 minute )
        I am adding a Bars object for the primary instrument of the script.

        In the script I am printing Instrument.FullName
        Last edited by blar58; 06-10-2020, 11:06 AM.

        Comment


          #5
          Hello blar58,

          If there are multiple series Instruments[0].FullName will be the name of the primary series.
          https://ninjatrader.com/support/help...injascript.htm

          What appears in the output window when printing Print(Instruments[0].FullName); ?

          May we have a screenshot of the chart this indicator is applied to?
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            It says CL 07-20

            Comment


              #7

              Comment


                #8
                Hello blar58,

                Is the indicator called ProSuiteMarketProfiler?

                Open a new chart with no templates or other indicators and add this indicator. On a new chart is the behavior the same?

                If the behavior is the same, may I test this on my end?

                To export a NinjaTrader 8 NinjaScript so this can be shared and imported by the recipient do the following:
                1. Click Tools -> Export -> NinjaScript...
                2. Click the 'add' link -> check the box(es) for the script(s) and reference(s) you want to include
                3. Click the 'Export' button
                4. Enter a unique name for the file in the value for 'File name:'
                5. Choose a save location -> click Save
                6. Click OK to clear the export location message
                By default your exported file will be in the following location:
                • (My) Documents/NinjaTrader 8/bin/Custom/ExportNinjaScript/<export_file_name.zip>
                Below is a link to the help guide on Exporting NinjaScripts.

                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Chelsea

                  It is weird it not even related to my indicator.

                  If I open a new chart with CL 08-20.
                  I just add an ADX indicator.

                  It displays the CL 07-20 contract.
                  I have attached an image.
                  Last edited by blar58; 06-10-2020, 12:47 PM.

                  Comment


                    #10
                    I realized that to work properly I have to roll the contracts from the database, close NinjaTrader and reopen it.
                    Don't know why though

                    Comment


                      #11
                      Hello blar58,

                      This could possibly mean that the roll dates are not using the default settings.

                      To reset these:
                      • On the Control Center click Tools > Database Management
                      • In the Update instruments section, check the box for Future expiries as well just in case
                      • Click the Update button in the Update instruments section
                      • Restart NinjaTrader
                      https://ninjatrader.com/support/help...ateInstruments


                      Also, check to ensure the PC Clock is in sync with internet time.

                      Compare your PC Clock with https://www.time.gov/

                      If you are not in sync:
                      • Shutdown NinjaTrader
                      • Navigate to the Windows Control Panel
                      • Select Clock and Region -> then click 'Set the time and date'
                        (Or click 'Date and Time' if this is visible)
                      • Click on Internet Time tab
                      • In the Server: drop-down select time.nist.gov
                      • Click Update
                      • If the message that appears says successful your PC clock should now be updated
                        If not, select a different server from the Server: drop-down and try again (repeat until one of the servers is successful)
                      • Restart NinjaTrader
                      • Connect to a data feed, then right-click the chart and select Reload All Historical Data
                      Below are a few links to 3rd party educational sites with steps to synchronize with internet time.

                      If your device is showing the wrong time, and it's not a time zone issue, you can try changing the Internet Time settings on Windows 10 to fix the problem.

                      Starting with Windows Vista and on through Windows 7 and 8, you can synchronize your clock with an internet-based server. This will ensure your computer time is always correct. Having the correct t&#8230;

                      This tutorial will show you how to synchronize time with Internet time server and add the new time server using the Registry in Windows 10.
                      Chelsea B.NinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Trader146, 05-10-2024, 09:17 PM
                      1 response
                      22 views
                      0 likes
                      Last Post NinjaTrader_BrandonH  
                      Started by bourasrafik, Today, 03:26 PM
                      0 responses
                      2 views
                      0 likes
                      Last Post bourasrafik  
                      Started by benmarkal, Yesterday, 08:44 AM
                      1 response
                      30 views
                      0 likes
                      Last Post NinjaTrader_BrandonH  
                      Started by somethingcomplex, Yesterday, 10:36 PM
                      1 response
                      24 views
                      0 likes
                      Last Post NinjaTrader_BrandonH  
                      Started by rayyyu12, Today, 12:47 AM
                      1 response
                      14 views
                      0 likes
                      Last Post NinjaTrader_BrandonH  
                      Working...
                      X