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

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 zstheorist, Today, 07:52 PM
            0 responses
            7 views
            0 likes
            Last Post zstheorist  
            Started by pmachiraju, 11-01-2023, 04:46 AM
            8 responses
            150 views
            0 likes
            Last Post rehmans
            by rehmans
             
            Started by mattbsea, Today, 05:44 PM
            0 responses
            6 views
            0 likes
            Last Post mattbsea  
            Started by RideMe, 04-07-2024, 04:54 PM
            6 responses
            33 views
            0 likes
            Last Post RideMe
            by RideMe
             
            Started by tkaboris, Today, 05:13 PM
            0 responses
            6 views
            0 likes
            Last Post tkaboris  
            Working...
            X