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
    Kate W.NinjaTrader Customer Service

    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 Omnbowjdw, Today, 09:02 AM
      0 responses
      2 views
      0 likes
      Last Post Omnbowjdw  
      Started by nailui, Today, 07:26 AM
      1 response
      25 views
      0 likes
      Last Post NinjaTrader_Spencer  
      Started by chartchartchart, Today, 08:08 AM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_Emily  
      Started by andreslazor7, Today, 08:08 AM
      2 responses
      14 views
      0 likes
      Last Post andreslazor7  
      Started by FatCanary, Today, 08:09 AM
      2 responses
      8 views
      0 likes
      Last Post FatCanary  
      Working...
      X