Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 trilliantrader, Today, 03:01 PM
      0 responses
      3 views
      0 likes
      Last Post trilliantrader  
      Started by pechtri, 06-22-2023, 02:31 AM
      9 responses
      122 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by frankthearm, 04-18-2024, 09:08 AM
      16 responses
      67 views
      0 likes
      Last Post NinjaTrader_Clayton  
      Started by habeebft, Today, 01:18 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by benmarkal, Today, 12:52 PM
      2 responses
      19 views
      0 likes
      Last Post benmarkal  
      Working...
      X