Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Comparing Highs/Lows with COBC

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

    Comparing Highs/Lows with COBC

    Hello,

    I´m having a simple indicator that should compare the Highs and Lows of ES and MES. I run it on a minutebar with BIP0 and BIP1 so it should refer to the same bar. I draw a line when eg low of ES is lower than low of MES and a line when high of ES is higher than high of MES. (I dont say it should be always same high and low! this is not the question)
    When I compare Highs[0][0] and Highs[1][0] (same for Lows) where BIP0=ES and BIP1=MES it plots sometimes the line even when Highs or Lows are same. What can I do please to have correct plotting?
    if(Highs[0][0]>Highs[1][0])
    {Draw.Line(this, "High1" + CurrentBar, true, 0, Highs[0][0], -3, Highs[0][0], Brushes.Firebrick, DashStyleHelper.Dash, 2);
    }

    I understand that it does not plot correctly when I compare eg Range Bars, but minute bars close same time so it should plot only when ">" is true and not plot sometimes when same High or Low.

    Thank you!
    Tony

    #2
    Hello tonynt,

    Thank you for your reply.

    In my testing in a very simple script I'm seeing the lines plotted when I would expect. Can you provide a larger script example that may shed more light on what may be occurring?

    I've attached my script that I've been testing on an ES 06-21 chart.

    Thanks in advance; I look forward to assisting you further.
    Attached Files

    Comment


      #3
      Hello,

      thank you for your reply. Thats interesting, yours is plotting correctly. The code is almost the same, just have few conditions which bar I´m interested in.

      I have in onbarupdate just as a basic routine from another indicator becaue my first try was with max and min
      if ( CurrentBars[0] < 8
      || CurrentBars[1] < 8
      )
      return;

      But this should not cause the difference.

      Thank you for your support!

      Tony

      Comment

      Latest Posts

      Collapse

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