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 Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                649 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                370 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                109 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                574 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                576 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X