Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Second BarsArray not showing historic results

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

    Second BarsArray not showing historic results

    Hi,
    My chart is a 300 tick chart which is barsarray[0].

    I was reading the help file and attempted to replicate the AddLineBreak() function but only am seeing results for the most recent occurance, no history.

    When I refresh the chart, the script below only shows one green dot within the last few bars yet there are 20 days of charted tick bars.

    Any ideas what I did wrong that makes the script not show any historical results from the barsarray[1] over 20 days?

    protected override void Initialize()
    {

    // BarsInProgress index = 1
    AddLineBreak("TF 12-14", PeriodType.Volume, 500, 3, MarketDataType.Last);
    }


    /// <summary>
    /// Called on each bar update event (incoming tick)
    /// </summary>
    protected override void OnBarUpdate()
    {
    // Checks to ensure all Bars objects contain enough bars before beginning
    if ( CurrentBars[0] <= BarsRequired || CurrentBars[1] <= BarsRequired )
    return;


    if (BarsInProgress == 0)
    {
    //Up bar after a down bar of LineBreak bars (BarsArray 1)
    if (
    Closes[1][0] > Opens[1][0]
    && Closes[1][1] < Opens[1][1]
    )
    {
    DrawDot("DotUp", true, 0, Low[0] - 5, Color.Green);
    }
    }


    Thanks for any help you can provide!

    #2
    Hello whiterhino,

    Thank you for your post.

    You can think of the tag of your drawing object as the instance. If the tag is always the same then only one object will be drawn. So you would add something that changes with the bars, for example:
    Code:
    if (BarsInProgress == 0)
    { 
    //Up bar after a down bar of LineBreak bars (BarsArray 1)
    if ( 
    Closes[1][0] > Opens[1][0]
    && Closes[1][1] < Opens[1][1]
    )
    {
    DrawDot("DotUp"+[B]CurrentBars[0][/B], true, 0, Low[0] - 5, Color.Green);
    }
    }

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    597 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    343 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    556 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    555 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X