Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

problem drawing a line in the chart

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

    problem drawing a line in the chart

    Hello,

    I'm developing a new indicator and for drawing this indicator I have to override the plot method. My indicator Has to draw a line between two bars, the beginning and the end of the zone where this indicator is calculated.

    For drawing this line I have to get the coords of this two bars. For doing this I start looking all bars from ChartControl.FirstBarPainted on until I find my two bars and I calculate the offset from this first painted bar to my two bars and after that I calc the coords this way:

    initial x = bounds.x + (offset to beginning bar * (ChartControl.BarWidth+ChartControl.BarSpace))

    final x = bounds.x + (offset to final bar * (ChartControl.BarWidth+ChartControl.BarSpace))

    Bounds is the rectangle object parameter for the plot method and I suppose firstpaintedbar is painted the most possible to the left.

    The coords I have for initial x and final x are bigger than bounds.x+bounds.width. How Can I get the width a the bar (distance from beggining of bar to beginning of next bar) and the starting point where bars are plotted?

    Thanks in advance

    #2
    Hello telbentel,

    This is unfortunately outside our scope of support. Hopefully another community member can offer input here. This thread may be useful for you:
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      is the chartcontrol class a class developed by ninja or is a generic class of c#?

      if it is a ninjatrader class, is there any documentation about this class?

      Comment


        #4
        ChartControl is part of NinjaTrader. Unfortunately it is not documented or supported. I would search our forums to see how other members have used it.
        Last edited by NinjaTrader_RyanM1; 03-28-2011, 11:24 AM.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          I already solve this problem, I used ChartControl.GetXByBarIdx() to get the right coord.

          Just for anyone with the same problem

          Comment


            #6
            Thank you for sharing your solution here, telbentel.
            Ryan M.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Hwop38, 05-04-2026, 07:02 PM
            0 responses
            161 views
            0 likes
            Last Post Hwop38
            by Hwop38
             
            Started by CaptainJack, 04-24-2026, 11:07 PM
            0 responses
            308 views
            0 likes
            Last Post CaptainJack  
            Started by Mindset, 04-21-2026, 06:46 AM
            0 responses
            245 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by M4ndoo, 04-20-2026, 05:21 PM
            0 responses
            349 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