• 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

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 Trade95, Today, 05:38 PM
            0 responses
            4 views
            0 likes
            Last Post Trade95
            by Trade95
             
            Started by Karelgp7, Today, 03:16 PM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by orenytz, Today, 01:18 PM
            1 response
            20 views
            0 likes
            Last Post NinjaTrader_PaulH  
            Started by des.kkeng, Today, 01:10 PM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_PatrickG  
            Started by Capablanca, Today, 12:35 PM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Working...
            X