Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Instantiate indicator OnBarUpdate calling only a predifined number of bars

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

    Instantiate indicator OnBarUpdate calling only a predifined number of bars

    Hello,

    I need to run several interations of a indicator with parameters determined by logic OnBarUpdate.

    Is there a way to run it only in the last bars for performance reasons?

    Regards,
    Vava

    #2
    I just know using Onrender() to draw object will faster a bit.

    If it was logic flow, I think it should be stick to the OnBarUpdate there.

    Comment


      #3
      You can see the performance practice to make your program run faster :

      Comment


        #4
        Thank you for your reply.

        Is this case i'm not ploting, so OnRender should not be useful.

        I just need to make several interactions with diferent indicator parameters in the last bars until a mach is found.

        Thank you again!

        Comment


          #5
          Hello vavatete,

          Thank you for the post.

          You can call the indicator on a last bar to start calculating at that point for performance reasons however by not calling the indicator during historical bars it won't be able to calculate that data. For the indicator to calculate the full series of historical data points it would need to be called from OnBarUpdate during those bars.

          I look forward to being of further assistance.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          605 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          351 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          105 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          560 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          561 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X