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

How to redraw chart?

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

    How to redraw chart?

    A bit newbie question...

    I have a button (comes from my indi) onto chart. When I click that, I change value of one input (from true to false) and then I want that indi acted like as if someone changes an input and then Indi is redrawn on chart with changed input value...

    how to do that programatically?

    Code:
    ........
    
    void Init(){
       ...
       if (show_the_lines ) { ......}
       else {....}
       ...
    }
    
    ......
    
    void CLickFUnc() {
       ......
       if (clicked){
          show_the_lines = false;
          Reinitilize_Indocator()  ... or something like this..
       }
       ...
    }

    #2
    Hello selnomeria,

    To recalculate all historical values from a single script, you would need a loop. Loop through all bars on the chart and set the Value for the plot on that bar.

    To recalculate all indicators on the chart call ReloadAllHistoricalData();
    (This is not documented but should re-download the data and then reload all indicators.)
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      ouh.. is not there a simple way to just "reload" current indi? (MT4 has RealoadChart() function).
      i mean, i just want the same indicator to be applied, like i had done that using "change input> click apply".

      p.s.



      another hint - Maybe some event can cause the indi to force redraw?

      I saw, that hiding/showing a panel, caused the indi to recalculate ???

      can you give me programatical hint about this fact?
      Last edited by ttodua; 05-02-2017, 11:39 PM.

      Comment


        #4
        Hello selnomeria,

        I am not aware of any documented or undocumented way of reloading one indicator.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          I am also interested in this ability. I think selnomeria doesn't necessarily want just the one indicator updated, but to simulate a reload as if the user changed the indicator parameter and then pressed Apply or OK forcing the chart to reload and the indicator to recalculate.

          I've looked at the other forum posts leading to the use of SendKeys.Send("{F5}") but this doesn't work consistently in a loop of multiple or progressive parameter changes. The F5 sometimes gets lost because some Windows background app temporarily grabs focus.

          Anyone out there have a solution?

          Comment


            #6
            Originally posted by selnomeria View Post
            ouh.. is not there a simple way to just "reload" current indi? (MT4 has RealoadChart() function).
            i mean, i just want the same indicator to be applied, like i had done that using "change input> click apply"....

            another hint - Maybe some event can cause the indi to force redraw?

            I saw, that hiding/showing a panel, caused the indi to recalculate ???

            can you give me programatical hint about this fact?
            Code:
            ChartControl.Refresh()
            ?
            Undocumented and unsupported. Be advised accordingly.

            Comment


              #7
              Thanks, I'll test it tonight.

              Comment


                #8
                Nope that just refreshes the paint of the window. What is needed is a "Reload Ninjascript" event.

                Comment


                  #9
                  Hello TiggerTrader,

                  I have submitted a feature request on your behalf for the NinjaTrader Development to consider adding a ReloadNinjaScript() method that would reload a single indicator.

                  Once I have a tracking ID for this request, I will post this in this thread for future reference.
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #10
                    Hello TiggerTrader,

                    I have received a tracking ID for your request.

                    For future reference, your request for a supported way to reload NS programmatically is being tracked with ID #SFT-1579.

                    Please note it is up to the NinjaTrader Development to decide if and when a request will be implemented.

                    Thank you for your suggestion. Please let me know of any other requests or suggestions you have for NinjaTrader.
                    Chelsea B.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by ZenCortexAuCost, Today, 04:24 AM
                    0 responses
                    3 views
                    0 likes
                    Last Post ZenCortexAuCost  
                    Started by ZenCortexAuCost, Today, 04:22 AM
                    0 responses
                    0 views
                    0 likes
                    Last Post ZenCortexAuCost  
                    Started by SantoshXX, Today, 03:09 AM
                    0 responses
                    13 views
                    0 likes
                    Last Post SantoshXX  
                    Started by DanielTynera, Today, 01:14 AM
                    0 responses
                    2 views
                    0 likes
                    Last Post DanielTynera  
                    Started by yertle, 04-18-2024, 08:38 AM
                    9 responses
                    42 views
                    0 likes
                    Last Post yertle
                    by yertle
                     
                    Working...
                    X