Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Needing to run a strategy on every bar?

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

    Needing to run a strategy on every bar?

    Hi there,

    This could be such a silly question, one which I may have not have thought through enough.

    If you run a strategy on historical data.

    And the strategy calls an indicator at lets say 15:00pm only.

    But that indicator has to run its own OnBarUpdate every tick from 08:00am to 15:00pm to have the value correct for when the strategy calls it.

    Does that strategy need to run OnBarUpdate() on every single bar up until 15:00pm for that indictor to have all the data it needs or can the OnBarUpdate of the strategy simply be returned on every iteration until it gets to 15:00pm where it can finally go head and call the indicator?

    Does that make sense?

    I am asking because I only ever look for trades after 14:45pm and so when I'm running my strategy on historical data, I just want the strategy to return;. But I need the indicators to know what happened before 14:45 if that makes sense.

    Cheers.

    Tarik

    #2
    Hi Tarik, thanks for posting. The strategy hosting the indicators will keep them updated even if you return from OnBarUpdate. It can be tested by using Print() within the strategy to print out the data and return. e.g. print out the indicator's value in OnBarUpdate to see its value.

    Kind regards,
    -ChrisL

    Comment


      #3
      Hey Chris,

      Ahh amazing I will give that a go but that helps a lot thanks,

      Tarik

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      62 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      134 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      75 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      45 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      50 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X