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 sjsj2732, 03-23-2026, 04:31 AM
    0 responses
    150 views
    0 likes
    Last Post sjsj2732  
    Started by NullPointStrategies, 03-13-2026, 05:17 AM
    0 responses
    353 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    391 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    182 views
    1 like
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    137 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Working...
    X