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

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

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

          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 PaulMohn, Today, 05:00 AM
            0 responses
            8 views
            0 likes
            Last Post PaulMohn  
            Started by ZenCortexAuCost, Today, 04:24 AM
            0 responses
            6 views
            0 likes
            Last Post ZenCortexAuCost  
            Started by ZenCortexAuCost, Today, 04:22 AM
            0 responses
            3 views
            0 likes
            Last Post ZenCortexAuCost  
            Started by SantoshXX, Today, 03:09 AM
            0 responses
            16 views
            0 likes
            Last Post SantoshXX  
            Started by DanielTynera, Today, 01:14 AM
            0 responses
            5 views
            0 likes
            Last Post DanielTynera  
            Working...
            X