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