Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

error in code

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

    error in code

    Why doesn't this line compile?

    int xyz = Math.Sign(BOP(bopDaysLong)[0]);

    Thx

    #2
    The error messages at the bottom of the editor window will provide you an idea what's wrong with your code.

    Comment


      #3
      It compiles for me.

      are you sure bopDaysLong is defined? What does the compile error say?

      I would replace bopDaysLong with a static value like 5 just to test

      mrLogik
      mrlogik
      NinjaTrader Ecosystem Vendor - Purelogik Trading

      Comment


        #4
        Ok guys, that compiles. By chance i have removed the part of the line that gave the problem

        It's
        Code:
        private int xyz = Math.Sign(BOP(bopDaysLong)[0]);
        that gives a lot of errors.
        Why can't i define a local variable inside OnBarUpdate() ??

        Comment


          #5
          You can't declare a private within a private method (OnBarUpdate).

          Just remove the private part of that line, there is no need for it as all variables declared within OnBarUpdate are inherently private.
          mrlogik
          NinjaTrader Ecosystem Vendor - Purelogik Trading

          Comment


            #6
            Hello,

            Thank you for your post mrlogik!
            DenNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Hwop38, 05-04-2026, 07:02 PM
            0 responses
            169 views
            0 likes
            Last Post Hwop38
            by Hwop38
             
            Started by CaptainJack, 04-24-2026, 11:07 PM
            0 responses
            324 views
            0 likes
            Last Post CaptainJack  
            Started by Mindset, 04-21-2026, 06:46 AM
            0 responses
            250 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by M4ndoo, 04-20-2026, 05:21 PM
            0 responses
            353 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by M4ndoo, 04-19-2026, 05:54 PM
            0 responses
            180 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Working...
            X