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 Hwop38, 05-04-2026, 07:02 PM
    0 responses
    153 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    306 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    244 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    345 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    176 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Working...
    X