Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Plot on the first 20 bars

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

    Plot on the first 20 bars

    Hello Everybody,

    I'm developing a very simple indicator that plots a line 50 points below the closing of each day.

    Here's my OnBarUpdate method

    protected override void OnBarUpdate()
    {
    if (CurrentBar > 1) {
    Value[0] = Close[0] - 50.0;
    }
    }

    As showed in the attached image, the line is not plot for the first 20 bars of each chart, am I doing something wrong?

    TIA

    --
    andrea
    Attached Files

    #2
    Hello,

    Thank you for the post.

    You can set your BarsRequiredToPlot value inside of State.SetDefaults. This will control where the indicator starts plotting.

    if (State == State.SetDefaults){

    ...
    BarsRequiredToPlot = 10;
    }

    Here is the help guide link to BarsRequiredToPlot:


    Please let us know if we may be of any further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    561 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