Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Incorrect indicator value in strategy

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

    Incorrect indicator value in strategy

    Hello dear support. Sorry for my English. I use google translator. I hope you understand and can help me.
    I use the BuySellVolume indicator in my strategy. The indicator values ​​are incorrectly displayed in the real-time strategy and when testing its market replay (it does not correspond to the real values ​​and the value of the indicator added just to the chart). If I check the strategy in the strategy analyzer, then everything is fine. Please tell me how to add an indicator to the strategy so that it is displayed correctly.

    Attached Files

    #2
    Hello drenmar,

    Have you only used AddChartIndicator in your strategy? Are you otherwise not calling the indicator from OnBarUpdate? If you are not calling the indicator and just have only used AddChartIndciator, it will be incorrect. You would need to also call the indicator to have it calculate:

    Code:
    double notUsed = BuySellVolume()[0];

    I look forward to being of further assistance.

    Comment


      #3

      Thanks for the quick response!
      Yes, I use AddChartIndicator in my strategy. Here is an example of the simplest strategy with this indicator. Primer11111.cs
      The code was made through the strategy builder. Unfortunately, I did not understand how to apply the code presented by you.
      I will be grateful if you show me how to do it.

      Comment


        #4
        Sorry, I made a mistake and created the topic in NinjaTrader 7. I use NinjaTrader 8.

        Comment


          #5
          Hello drenmar,

          Thank you for clarifying.

          I will move the post to the NT8 sub forums. I also wanted to provide a note that I am looking into the builder syntax that was generated.

          For the current script, if you have unlocked it you can try adding the line I posted in post #2, it could be added at line number 77 in the sample you provided.

          I look forward to being of further assistance.

          Comment


            #6
            Thank you very much! It really works! Thanks again for the quick and professional support!

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            579 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            334 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
            554 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            551 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X