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

Update chart at all series events when only first series is visualized?

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

    Update chart at all series events when only first series is visualized?

    Situation:

    1. Primary series is visualized on chart.
    2. Active indicator contains >1 series, (not visualized in chart).

    In this situation the chart is updated only at events in the first series.

    Question:

    Is there a way to have the chart components updated on ALL series events?


    #2
    Hello FREEN,

    Thank you for the question.

    I believe in this case the simple answer is no, the chart will only relate to the primary that is applied there. What specifically are you trying to update in your described case? Are you drawing from one of the secondary series or what is the overall situation you are describing?
    ​​​​​​

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Now, that´s a wonderful answere in all it´s simplicity : )

      What about force update from custom event... like a timer?

      Comment


        #4
        Guess I found the answere here;

        Comment


          #5
          Hello FREEN,

          Correct, that is the general suggestion anytime you need to inform the chart it needs updated. For some custom cases where a faster update may be needed like a button click event you can also add and remove a drawing object as that will cause a render.

          I look, forward to being of further assistance.
          JesseNinjaTrader Customer Service

          Comment


            #6
            For some custom cases where a faster update may be needed like a button click event you can also add and remove a drawing object as that will cause a render.

            That doesn´t seem to be the case when I do this test:

            Code:
                    protected override void OnBarUpdate()
                    {            
                        // all series events should trigger this draw method, stil the chart is updated only at primary series
                        // does the draw method have to include data from the secondary (etc...) series in order to cause a render?
                        Draw.TextFixed(this, "label", labelText, TextPosition.Center...
                    }
            Last edited by FREEN; 09-09-2019, 01:32 PM.

            Comment


              #7
              Hello FREEN,

              You would also need to remove it right after that line, the removal is what causes the render. It also wouldn't matter from OnBarUpdate, this would be specifically for any out of event driven logic like in a button event handler. OnBarUpdate will be more or less synced with the rendering due to the market data coming in/frequency that it is called.


              I look forward to being of further assistance.
              JesseNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Irukandji, Yesterday, 02:53 AM
              2 responses
              17 views
              0 likes
              Last Post Irukandji  
              Started by adeelshahzad, Today, 03:54 AM
              0 responses
              3 views
              0 likes
              Last Post adeelshahzad  
              Started by CortexZenUSA, Today, 12:53 AM
              0 responses
              3 views
              0 likes
              Last Post CortexZenUSA  
              Started by CortexZenUSA, Today, 12:46 AM
              0 responses
              1 view
              0 likes
              Last Post CortexZenUSA  
              Started by usazencortex, Today, 12:43 AM
              0 responses
              5 views
              0 likes
              Last Post usazencortex  
              Working...
              X