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

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 zstheorist, Today, 07:52 PM
            0 responses
            3 views
            0 likes
            Last Post zstheorist  
            Started by pmachiraju, 11-01-2023, 04:46 AM
            8 responses
            149 views
            0 likes
            Last Post rehmans
            by rehmans
             
            Started by mattbsea, Today, 05:44 PM
            0 responses
            5 views
            0 likes
            Last Post mattbsea  
            Started by RideMe, 04-07-2024, 04:54 PM
            6 responses
            33 views
            0 likes
            Last Post RideMe
            by RideMe
             
            Started by tkaboris, Today, 05:13 PM
            0 responses
            5 views
            0 likes
            Last Post tkaboris  
            Working...
            X