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

Why can't i display the indicators in the strategy analyzer?

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

    #16
    Hello YuriyGulyayev,

    Thank you for your response.

    So I may reproduce, please be precise here in what indicators are drawing. Are you saying that the strategy calls an indicator that in turn calls an indicator that then is drawing on the chart? If so, can you provide and example of this in code?

    I look forward to your response.

    Comment


      #17
      Please see attached and comments inside.
      Attached Files

      Comment


        #18
        Hello YuriyGulyayev,

        Thank you for your patience.

        I only receive one drawing object on the chart. Can you provide a screenshot of the behavior you are seeing?

        I look forward to your response.

        Comment


          #19
          That is correct. That drawing object isn't supposed to appear on the chart because the instance of the indicator that draws it hasn't been added to the chart.

          Comment


            #20
            Hello YuriyGulyayev,

            Thank you for your patience.

            Can you detail the expected behavior here?
            Perhaps we can schedule a support call with you to look into this on your PC?

            If so, please send me a note to platformsupport[at]ninjatrader[dot]com with 'ATTN: Patrick H' in the subject line with a reference to this thread along with a time window to reach you and the best phone number. We are available from 8:30 am to 6 pm EST, Monday through Friday.

            I look forward to assisting you further.

            Comment


              #21
              The expected behavior is that nothing will show up. It works as expected on a regular chart, but not in the strategy analyzer.

              Comment


                #22
                Hello YuriyGulyayev,

                Thank you for your patience.

                Line 71 updates the instance of the indicator if the indicator object you added in State.Configure is not null, when that object then is not null in it's own call it processes the logic from line 73 down. This would be expected based on your internal logic in the indicator.

                Commenting out lines 68 to 74 and then line 93 prevents the object from drawing the chart.

                Please let me know if you have any questions.

                Comment


                  #23
                  Patrick, please take a closer look.
                  The strategy passes false to the indicator creation method.
                  The indicator, in turn, if false was passed, creates another instance of itself and passes true.
                  The indicator draws only if the reference to its other instance is null, which is if true was passed, meaning that only the indicator instance that hasn't been added to the chart by the strategy draws.

                  A separate, although possibly related issue is that explicit calls to Update that both the strategy and the indicator make are needed because one and/or both indicator's OnBarUpdate would not be called otherwise. I understand that in the strategy analyzer there is no need to update unused indicators, but on a chart, including a strategy analyzer chart, all indicators have to be auto-updated, just in case one draws something.

                  How about if you guys add an indicator property named IsAutoUpdate, which true value would result in OnBarUpdate being called automatically, even if it appears that the indicator is not used?

                  Comment


                    #24
                    Hello YuriyGulyayev,

                    Thank you for your response.

                    I am trying to figure the use case here based on the code you provided. I could understand that you are stating that an indicator called that is not plotted on the chart is not updating, is this is what you are detailing.

                    Can you provide the use case here and explain if you are stating that an indicator called that is not plotted is not updating? I am trying to figure how this relates to indicators on the Chart Display of the Strategy Analyzer.

                    I look forward to your response.

                    Comment


                      #25
                      The Update thing is not why I created this thread.

                      The main problem here is simple. The behavior is different on a regular chart vs. a chart in the strategy analyzer. If you run this strategy on a regular chart you will not see the drawing, which is the correct behavior. However in the strategy analyzer you will see the drawing.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by RubenCazorla, 08-30-2022, 06:36 AM
                      3 responses
                      77 views
                      0 likes
                      Last Post PaulMohn  
                      Started by f.saeidi, Yesterday, 12:14 PM
                      9 responses
                      23 views
                      0 likes
                      Last Post f.saeidi  
                      Started by Tim-c, Today, 03:54 AM
                      0 responses
                      3 views
                      0 likes
                      Last Post Tim-c
                      by Tim-c
                       
                      Started by FrancisMorro, Today, 03:24 AM
                      0 responses
                      4 views
                      0 likes
                      Last Post FrancisMorro  
                      Started by Segwin, 05-07-2018, 02:15 PM
                      10 responses
                      1,772 views
                      0 likes
                      Last Post Leafcutter  
                      Working...
                      X