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

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?
    BertrandNinjaTrader Customer Service

    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") ...
        BertrandNinjaTrader Customer Service

        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.
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by DJ888, Today, 10:57 PM
            0 responses
            2 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by MacDad, 02-25-2024, 11:48 PM
            7 responses
            158 views
            0 likes
            Last Post loganjarosz123  
            Started by Belfortbucks, Today, 09:29 PM
            0 responses
            7 views
            0 likes
            Last Post Belfortbucks  
            Started by zstheorist, Today, 07:52 PM
            0 responses
            7 views
            0 likes
            Last Post zstheorist  
            Started by pmachiraju, 11-01-2023, 04:46 AM
            8 responses
            151 views
            0 likes
            Last Post rehmans
            by rehmans
             
            Working...
            X