Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Update indicator plot in strategy

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

    Update indicator plot in strategy

    Hi,

    I'm developing a strategy that uses Add(Indicator(StartingPeriod)) inside Initialize() to show plot using a user defined Parameter for StartingPeriod.

    Inside the strategy when Indicator(StartingPeriod) is called, StartingPeriod is a dynamic variable, and changes OnBarUpdate().

    How can I update the plot of Indicator(StartingPeriod) in the OnBarUpdate().

    Thanks!

    #2
    ngsevers, welcome to our forums - this is something undocumented so we could not officially support it, however have you tried Indicator(StartingPeriod).YourUserInput = your new period value?

    Comment


      #3
      Hi Bertrand,

      Thanks for the reply; i've already tried that.. the graph still shows the output with the original StartingPeriod unchanged.. do you have any other ideas?

      Thanks in advance!
      Noah

      Comment


        #4
        Another idea would be coding the dynamic adjustment directly into the study you Add() in visuals, this way all is taken care of internally already.

        Comment


          #5
          The only way I could see to do it would be to move the dynamic period calculations into the indicator itself. But this seems kind of backwards..

          Is there not a way to access the parameter of the indicator that was added using the Add() method and modify it and force an update of the graph.. something like Indicator(StartingPeriod).Update() ?

          Comment


            #6
            Unfortunately there would be nothing supported I can offer here. In my testing setting the period for example of the added script worked out as I would expect, that's the only idea I would have to workaround.

            Comment


              #7
              Are you testing on live data or backtesting.. I was backtesting when testing Indicator(StartingPeriod).YourUserInput = your new period value..

              I haven't checked to see if it functions differently on live data or if it makes a difference..

              Comment


                #8
                I was backtesting directly applied to a chart.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by charlesugo_1, 05-26-2026, 05:03 PM
                0 responses
                59 views
                0 likes
                Last Post charlesugo_1  
                Started by DannyP96, 05-18-2026, 02:38 PM
                1 response
                143 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by CarlTrading, 05-11-2026, 05:56 AM
                0 responses
                161 views
                0 likes
                Last Post CarlTrading  
                Started by CarlTrading, 05-10-2026, 08:12 PM
                0 responses
                97 views
                0 likes
                Last Post CarlTrading  
                Started by Hwop38, 05-04-2026, 07:02 PM
                0 responses
                283 views
                0 likes
                Last Post Hwop38
                by Hwop38
                 
                Working...
                X