Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BarsPeriod NT7 vs. NT 6.5?

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

    BarsPeriod NT7 vs. NT 6.5?

    I developed an indicator in NT7 and used the BarsPeriod class. However, when I copy the code over to create a NT6.5 indicator, it gives me this error:

    Indicator\RTSwingTrader.cs The name 'BarsPeriod' does not exist in the current context CS0103 - click for info 1547 39

    Am I missing an include? Or is this not supported?

    Thanks!

    #2
    moflaherty, code generated in NT7 would not be downwards compatible 100% of the time of course...which exact offending line is being referenced as you compile?

    Comment


      #3
      Code

      Code:
       
      if (BarsPeriod.Id.ToString() == "Day")
      Since BarsPeriod is referenced in the 6.5 documentation (but for a strategy), I assume I need an include??

      Comment


        #4
        Please use this for indicators in 6.5 -

        if (Bars.Period.Id.ToString() == "Day") ...

        Comment


          #5
          Originally posted by NinjaTrader_Bertrand View Post
          if (Bars.Period.Id.ToString() == "Day") ...
          And the very best version is this one:

          if (Bars.Period.Id == PeriodType.Day)

          Regards
          Ralph

          Comment


            #6
            True Ralph, good spot.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by cmoran13, 04-16-2026, 01:02 PM
            0 responses
            42 views
            0 likes
            Last Post cmoran13  
            Started by PaulMohn, 04-10-2026, 11:11 AM
            0 responses
            25 views
            0 likes
            Last Post PaulMohn  
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            162 views
            1 like
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            98 views
            1 like
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            157 views
            2 likes
            Last Post CaptainJack  
            Working...
            X