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

Differences with Minute Data Series and Second & Tick on MYM & M2K

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

    Differences with Minute Data Series and Second & Tick on MYM & M2K

    Hello Community,
    I wonder if anyone is able to share any insight as to why I am experiencing a problem which relates to type of Data Series used and is instrument specific.....
    I use an Opening Range indicator for the pre-session and which has some coding voodoo to throw an error message if Start and End times don't match up correctly. The problem is not with that per se (I believe i.e. it has never been a problem before & I haven't changed anything)
    I have this indicator on a Minute-based data series, a Second-based data series, and Tick-based data series, on four US Equity Futures indices

    I have used the same Workspace for several years.

    A few days ago, 2 instruments M2K and MYM, now display an error message on the Second-based data series and on the Tick-based data series. It doesn't matter what Second - 10, 5, 3 etc, nor Tick. Minute-based does not display the message (any integer), nor do Mini Contracts RTY and YM, nor do Mini or Micro ES and NQ

    The error being thrown is a mismatch between OR /pre-session and session template selected for the chart bars - but the 'point' is that everything is '100% cloned' as in every chart, indicator, setting, window. trading hours template is exactly the same irrespective of instrument loaded, I've never had this problem before, it only started happening a couple of days ago and is only on M2K and MYM and only on Second and Tick Data Series. Whether I load M2K or RTY it is all the same OR/Pre trading hours and session template, whether it is Minute, Second or Tick - but only error on Second and Tick. Error on Micro, not on Mini. Conversely, if I load MES or ES, or MNQ or NQ no error on any data series....

    So strikes me as something different specifically with M2K and MYM, not applying to ES, MES, NQ, MNQ Minute, Sec or Tick, nor YM, MYM, RTY, M2K Minute and which only began occurring a couple of days ago with no changes to anything by me

    I can of course post the code relating to the error message, but can't see it can be anything to do with the code as nothing has change and everything is the same re: parameters, trading hours sessions for all contracts etc.
    Any pointers appreciated

    Best
    Last edited by brucerobinson; 12-29-2022, 02:37 PM.

    #2
    Hello brucerobinson,

    Thanks for your post.

    You would need to further debug your script by reducing code and adding prints to find the exact line(s) of code causing the issue in the script. You could reduce sections of code to determine which section of code is causing the behavior to occur. When you do not see the error occur after reducing a section of code and retesting, it is likely that section of code causing the behavior. Prints could then be added to that section to narrow in on the culprit causing the error.

    Unfortunately, without knowing exactly what line(s) of code has a problem and what values caused the problem, we would not be able to provide further direction.

    Below is a link to a forum post that demonstrates how to use prints to understand behavior.

    https://ninjatrader.com/support/foru...121#post791121

    Let me know if I may assist you further.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Hello Brandon and thanks for your prompt assistance.

      "You would need to further debug your script by reducing code and adding prints to find the exact line(s) of code causing the issue in the script. "
      It isn't that I don't know what is 'causing' the 'error'. Hopefully I can improve my explanation.


      This is the relevant code:

      protected override void OnBarUpdate()
      {
      if(IsFirstTickOfBar)
      {
      if(errorMessage)
      {
      if(basicError)
      return;
      else if(sundaySessionError)
      {
      Draw.TextFixed(this, "error text 6", errorText6, TextPosition.Center, errorBrush, errorFont, Brushes.Transparent, Brushes.Transparent, 0);
      RemoveDrawObject("error text 7");
      return;
      }
      else if(startEndTimeError)
      {
      Draw.TextFixed(this, "error text 7", errorText7, TextPosition.Center, errorBrush, errorFont, Brushes.Transparent, Brushes.Transparent, 0);
      return;
      }
      }
      }​

      which if StartEndTimeError

      Draw TextFixed "error text 7"

      where:

      private string errorText7 = "amaOpeningRange: Mismatch between trading hours selected for the opening range / pre-session and the session template selected for the chart bars!";

      I could paste or attach the entire .cs as it is open source, it is one of LizardIndicators', or the rest of the code relating to calculating Start and End times etc.

      But this is not a question about debugging code to identify causes of coding errors - there are no errors being generated by the code (to be debugged).

      The question, the code works perfectly well, produces no coding errors, and if I were to use incorrect trading hours/mismatch with template for bar types it would display the text message on screen
      The question is, why, as of a couple of days ago, is this message now displaying, on M2K and MYM, on Second and Tick charts when it never used to but not Minute, and continues to work as it should on MES ES MNQ NQ YM, RTY as expected on Minute, Second and Tick, and no changes made to anything,
      The code has not changed

      I hope this is clearer

      Kind regards

      Comment


        #4
        Hello brucerobinson,

        Thanks for your note.

        I see that you mention "..it is one of LizardIndicators".

        To clarify, is this a custom NinjaScript that you created? Or, is this a custom NinjaScript created by LizardIndicators?

        If this is a script created by LizardIndicators, please reach out to LizardIndicators directly regarding the behavior that you are reporting so they may investigate why their script is displaying this message.

        If this is a script you created, please send me a reduced export of your script so I may further investigate this on our end. Note that a reduced copy refers to a copy of the script that contains the minimum amount of code needed to reproduce the issue. All other code is commented out or removed.

        To create a copy of your script to modify/reduce, open a New > NinjaScript Editor, select your script, right-click in the Editor, select 'Save as', name the script, and click OK.

        To export a script go to Tools > Export > NinjaScript AddOn.

        Let me know if I may assist further.​
        Brandon H.NinjaTrader Customer Service

        Comment


          #5
          Hello Brandon and thanks.
          "To clarify, is this a custom NinjaScript that you created? Or, is this a custom NinjaScript created by LizardIndicators?
          It is a script created by LizardIndicators, un-modified.

          "If this is a script created by LizardIndicators, please reach out to LizardIndicators directly regarding the behavior that you are reporting so they may investigate why their script is displaying this message.​"

          Yes. However, could you kindly answer my question:
          Has Ninjatrader made any changes to the manner in which the Contract Data Series is constructed or the manner in which Data Series are handled in the platform?
          The indicator was written in 2017 and remains unchanged. It has not produced this error message in 4 US Equity Index Futures over 80 mini contracts' Rollovers, plus introduction of micros, plus numerous other instruments
          It seems to me the answer is either
          - no
          - yes - please elaborate

          I'm looking for a variable. The code remains a constant.

          Kind regards
          Last edited by brucerobinson; 01-05-2023, 05:18 AM.

          Comment


            #6
            Hello brucerobinson,

            Thanks for your note.

            No, I am not aware of any changes made to the way that the contract data series are constructed or how the data series are handled in NinjaTrader.

            For further information on the behavior you are reporting, please reach out to the vendor of the indicator, LizardIndicators, so that they may investigate the cause of the message coming from their script.

            Note that updates/changes/fixes made to the platform can be found in the Release Notes section of the help guide linked below.

            Release Notes: https://ninjatrader.com/support/help...ease_notes.htm

            Let me know if you have further questions.
            Brandon H.NinjaTrader Customer Service

            Comment


              #7
              Thank you Braandon

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by rexsole, Today, 08:39 AM
              0 responses
              1 view
              0 likes
              Last Post rexsole
              by rexsole
               
              Started by trilliantrader, Yesterday, 03:01 PM
              3 responses
              30 views
              0 likes
              Last Post NinjaTrader_Clayton  
              Started by cmtjoancolmenero, Yesterday, 03:58 PM
              4 responses
              26 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by Brevo, Today, 01:45 AM
              1 response
              14 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by rjbtrade1, 11-30-2023, 04:38 PM
              2 responses
              74 views
              0 likes
              Last Post DavidHP
              by DavidHP
               
              Working...
              X