Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BarsType inheritance not supported completely?

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

    BarsType inheritance not supported completely?

    I've developed a custom BarType based on MinuteBarsType:
    Code:
    public class MyMinuteBarsType : MinuteBarsType
    . However, there is no way to utilize the custom PeriodType registration for example:
    Code:
    public MyMinuteBarsType() : base(PeriodType.Custom2)
    You get the error
    'NinjaTrader.Data.MinuteBarsType' does not contain a constructor the takes '1' arguments
    If I use BarTypes as the base for my inheritance, then indicators, such as BarTimer don't see my bar type a a Minute type bar. BarTimer fails to recognize the BarTypes derived class as a minute type:
    Code:
    if (Bars.Period.Id == PeriodType.Minute || Bars.Period.Id == PeriodType.Second)
    even tho the BarTypes derived class uses
    Code:
            public override PeriodType BuiltFrom
            {
                get { return PeriodType.Minute; }
            }
    So I'm stuck between a rock and a hard place. If I derive from BarsType, I can't be seen as a MinuteBarsType. If I derive from MinuteBarsType, I can't "register" as a custom PeriodType.

    Am I missing something?

    #2
    Hello TiggerTrader,

    Thank you for your post.

    Unfortunately, custom bar types are unsupported in NinjaTrader 7. Custom bar types will be supported in NinjaTrader 8. You can find the list of major enhancements at the following link: http://www.ninjatrader.com/downloads...njaTrader8.pdf

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    66 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    36 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    59 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Working...
    X