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 Mindset, Today, 06:46 AM
          0 responses
          8 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, Yesterday, 05:21 PM
          0 responses
          14 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          15 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by cmoran13, 04-16-2026, 01:02 PM
          0 responses
          82 views
          0 likes
          Last Post cmoran13  
          Started by PaulMohn, 04-10-2026, 11:11 AM
          0 responses
          47 views
          0 likes
          Last Post PaulMohn  
          Working...
          X