Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Volume Based Indicator Help

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

    #31
    Hello StoneMan78,

    Regions are used to organize the code, but do not provide structure.

    The public properties are within the scope of the class, the private variables are also within the scope of the class, OnStateChange and OnBarUpdate are in the scope of the class.
    A class level value (declared in the scope of the class) can be used in any method within that class. These can be at the top or bottom, as long as they are within the curly braces of the class and not between the curly braces of a method.

    The Update method in the help guide has sample code for making a public double.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #32
      Hello ChelseaB,

      I have successfully managed to reference the BuySellNetPressure code from my previous response in a new indicator. When I print the output it matches the original indicator. However, problems arise when I begin to do calculations with it. In the pasted code I have attempted to get the 5 period EMA of this new indicator and am running into the error codes shown. I'm still a bit confused about the best practices on where and how to define your variables so I feel like that may be where I went wrong. I guess my question is are there errors in this new code, the code I am referring to (pasted in my previous response) or both? Thank you so much for your continued assistance, learning an entirely new coding language is tough when you don't have much of a background in the subject, working on this project has grown my skillset immensely.
      Attached Files

      Comment


        #33
        Hello StoneMan78,

        BSNP.NetPressure is a series. BSNP.NetPressure[0] is a double (the last bar in the series).

        EMA requires a series as the input, you cannot supply a double.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #34
          Hello ChelseaB,

          I have been able to make some very good progress on the indicator thanks to your recent direction. However, I noticed that historical data is being truncated when I load in the indicator using tick replay. The first 30 or so bars do not seem to register. I traced this back to original NetPressure signal. Attached is the code I am running, a picture of the chart I'm getting, and the prints from that chart. Any thoughts on what could be causing this? As always, your help is greatly appreciated.
          Attached Files

          Comment


            #35
            Hello StoneMan78,

            It's likely 20 bars. BarsRequiredToPlot defaults to 20 if you do not set it.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            566 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            330 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            547 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            548 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X