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

Warning Message with Custom Bars Type

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

    Warning Message with Custom Bars Type

    Hello,

    I am getting the following warning message when I compile my custom bars type:

    Warning: 'NinjaTrader.Data.BarsPeriod.BarsPeriodTypeName' is obsolete CS0612
    In State.Defaults I use
    Code:
    BarsPeriod  = new BarsPeriod { BarsPeriodType = (BarsPeriodType) 99911, BarsPeriodTypeName = "myBarsType(99911)", Value = 1 };
    Can you please provide me with the correct syntax to add the custom bars type? Thank you.

    #2
    Hello Zeos6,

    Thank you for the post.

    The help guide example is declaring a BarsPeriodType like so.

    Code:
    new BarsPeriod { BarsPeriodType = BarsPeriodType.Minute, Value = 1440 }
    I'm not sure why the compiler throws a warning as it is not documented, but if there are code-breaking changes to this property in the future, it will be in the release notes.

    Please let me know if I can assist further.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hi ChrisL,

      Thank you for your reply. The response you provided is unfortunately not helpful. First, there are no code breaking changes in my script. Second, I have seen sample code from support at NT that have used this same syntax - for example Allan's PercentBars. And most importantly, third, your suggestion does not account for the name. How is the name handled? Please advise. Thank you.

      As an aside, the sample code you provided refers to standard bars, not custom bars type. Clearly I am referring to a custom bar type.

      Comment


        #4
        Hello Zeos6 ,

        Thank you for the reply.

        The code that you posted is a valid way to declare the bars period and it will compile. Your code does not have any errors, the warning about using the name property is just that it is obsolete. The property is not documented on this page so there is not much else I could advise on how to use it.

        Please let me know if I can assist further.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Hi ChrisL,

          Thank you for the clarification. I appreciate it. Yes, it is true that the script compiles, but it does give the warning message on compilation. Can you please clarify for me what the warning of being obsolete means in this specific context? I know the property is undocumented, but it is still being used by the script, and therefore Is it still functional? Is the name property deprecated for something else? I know I can get rid of the warning message by using #pragma warning disable but I would prefer to use the correct approach instead, if possible. Therefore, any insight you might be able to provide regarding this would be greatly appreciated. Thank you. Cheers

          Comment


            #6
            Hello Zeos6,

            Thanks for the reply.

            Since there is no documentation on it I could not give any more information about it. Did you find a use case for this property?

            I look forward to your reply.


            Chris L.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by maybeimnotrader, Today, 05:46 PM
            0 responses
            6 views
            0 likes
            Last Post maybeimnotrader  
            Started by quantismo, Today, 05:13 PM
            0 responses
            6 views
            0 likes
            Last Post quantismo  
            Started by AttiM, 02-14-2024, 05:20 PM
            8 responses
            166 views
            0 likes
            Last Post jeronymite  
            Started by cre8able, Today, 04:22 PM
            0 responses
            8 views
            0 likes
            Last Post cre8able  
            Started by RichStudent, Today, 04:21 PM
            0 responses
            5 views
            0 likes
            Last Post RichStudent  
            Working...
            X