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 CarlTrading, 03-31-2026, 09:41 PM
                1 response
                63 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by CarlTrading, 04-01-2026, 02:41 AM
                0 responses
                35 views
                0 likes
                Last Post CarlTrading  
                Started by CaptainJack, 03-31-2026, 11:44 PM
                0 responses
                54 views
                1 like
                Last Post CaptainJack  
                Started by CarlTrading, 03-30-2026, 11:51 AM
                0 responses
                61 views
                0 likes
                Last Post CarlTrading  
                Started by CarlTrading, 03-30-2026, 11:48 AM
                0 responses
                48 views
                0 likes
                Last Post CarlTrading  
                Working...
                X