Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Could I get the CurrentBar value within OnStarUp() ?

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

    Could I get the CurrentBar value within OnStarUp() ?

    If that is not possible, is there any alternative to get that value ?
    Thanks

    #2
    Hello pstrusi,

    This is not possible to do. The CurrentBar relates specifically to OnBarUpdate and the Processing bar. OnStartUp is called before your data begins processing. This override is generally used to do one time actions to setup your script. If your one time action requires bar data, you should instead use:

    Code:
    protected override void OnBarUpdate()
    {
       if(CurrentBar == 0)
       {
          // execute your code on the first bar before the rest of your logic.
       }
    }
    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
    562 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    325 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    547 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    547 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X