Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Issue: Specifying a custom bar type as the value of a indicator property

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

    Issue: Specifying a custom bar type as the value of a indicator property

    How is one supposed to have a user specify a custom bar type as the value of an indicator or strategy property? Custom bar types are not formally part of the BarsPeriodType enumeration, and so don't appear in the list of selectable values in a property dialog for a property of type BarsPeriodType. The user certainly has no way to do it, and it's a hard problem for a coder unless he knows the integer codes of all the bar types he intends to support (perhaps because he will only be using his own custom bar types.)

    One could use a property of type integer instead (and cast the integer when and as necessary,) but that's very user unfriendly. How will a user know which integer value to use for any bar type, let alone for custom ones? How could the developer know what custom bar types there might be, and what their integer codes are, in order to provide help for the user?

    One solution would be to provide a mapping service that maps between bar type names and bar type integer codes (for both built-in and custom bar types,) and also a way to enumerate the names of all installed bar types.
    Last edited by strategesis; 10-28-2015, 09:08 PM.

    #2
    Hello strategesis,

    Thank you for your inquiry.

    To utilize a custom bar type when using AddDataSeries(), for example, you would need to utilize the integer value of the bar type and cast it to BarsPeriodType.

    Example:
    Code:
    AddDataSeries((BarsPeriodType)14, 1);
    Unfortunately, that is currently the only way a custom bar type can be used in this regard.

    As you have stated in your post, you could use a property of type int to allow the user to enter in a value to correspond with a specific bar type.

    The numerical value for the bar type can be found in the bar type's BarsPeriod property.

    I have submitted your feedback to the product management team. We highly value customer feedback to improve NinjaTrader!
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      "The numerical value for the bar type can be found in the bar type's BarsPeriod property."

      Yes. Having developed my own bar types for NT8, I was aware of that. And if I'm simply using one of my own bar types, that solution works.

      Here's the issue: I make my indicators available to customers. I have no idea what bar types they might be using. Most of them are not programmers--and even if one of them happens to be such, he may nevertheless be unable to examine the source code for one or more of the bar types he uses that reside in DLLs, instead of residing as human-readable source code in the BarsTypes folder.

      Don't you think that's a problem?

      How would you recommend it be resolved?

      Comment


        #4
        There is a BarsPeriodTypeConverter we will be exposing in B7 which will work as a property editor to include custom bars types - NTEIGHT-9028
        MatthewNinjaTrader Product Management

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        666 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        376 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        110 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        575 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        580 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X