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 bubblegum, 03-18-2024, 10:41 AM
            3 responses
            43 views
            0 likes
            Last Post vjsworld  
            Started by JamesK1, Today, 02:48 PM
            1 response
            10 views
            0 likes
            Last Post JamesK1
            by JamesK1
             
            Started by llanqui, Today, 03:51 PM
            0 responses
            9 views
            0 likes
            Last Post llanqui
            by llanqui
             
            Started by Quanto, 04-17-2024, 10:43 AM
            2 responses
            24 views
            0 likes
            Last Post Quanto
            by Quanto
             
            Started by Irukandji, Today, 03:06 PM
            0 responses
            9 views
            0 likes
            Last Post Irukandji  
            Working...
            X