Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem with bar closure

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

    Problem with bar closure

    Hi. I'm a rookie programmer.
    I have this code
    (Volume[0] < Volume[1])&&(Volume[1] > Volume[2])
    The bar that fulfills this condition will be called the Bv
    I don't know how to do this now.
    If the Low[0] is < Bv then draw arrow
    thank you.

    #2
    Hello julifro,

    Thanks for your post.

    It depends on what of the Bv bar you are wishing to compare. I'll show a couple of ways.

    You could make Bv an int variable that holds the bar number of the latest bar that meets the criteria. You can then subtract the Bv from the CurrentBar to get the bars ago that the Bv was and reference that bars data, for example:

    if (Volume[0] < Volume[1])&&(Volume[1] > Volume[2])
    {
    Bv = Currentbar; // save bar number of the Bv bar
    }

    if (Low[0] < Low[CurrentBar - Bv]) // if the low is less than the low of the Bv bar.
    {
    // draw the arrow
    }

    Alternatively, if all you are interested in is the low Bv value then you could make the Bv a double variable and just store the low of the Bv bar at that point, for example:

    if (Volume[0] < Volume[1])&&(Volume[1] > Volume[2])
    {
    Bv = Low[0]; // save the Bv bar low value
    }

    if (Low[0] <Bv) // if the low is less than the low of the Bv bar.
    {
    // draw the arrow
    }

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    579 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    334 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
    554 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X