Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Scrolling when Overriding Plot

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

    Scrolling when Overriding Plot

    I have some code that is using static XY coords to plot a line. This is being done by Overriding the Plot method and drawing the line by hand. Although the problem I am having is when scrolling the line stays static and does not scroll with the rest of the chart. Is there a different graphics object (maybe a buffered one) that I can write to so that my custom drawn objects participate in the scrolling?

    thanks,

    Udo

    #2
    Hello Udo,

    Welcome to the NinjaTrader forums!

    All manually drawn lines will use date time for x position and price values for y position. Unfortunately there's no way to configure to use the chart canvas for their position.

    For drawing lines programatically, see the custom plot sample for an example. Tools > Edit NinjaScript > Open CustomPlotSample
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      I've seen the CustomPlot sample but that doesn't show any example of how to deal with scrolling. Do you know of any samples that show how to handle scrolling when using the Plot method?

      Comment


        #4
        The plot sample draws lines at chart coordinates, so it draws independent of the price scale.

        For overriding the plot method, pointing to this sample is unfortunately all the support we can offer.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_RyanM View Post
          The plot sample draws lines at chart coordinates, so it draws independent of the price scale.

          For overriding the plot method, pointing to this sample is unfortunately all the support we can offer.
          The CustomPlotSample most definitely does not draw at chart coordinates (time/price). It draws in window client coordinates.

          Is there a conversion from time/price to window client coords?

          Comment


            #6
            Thank you for the clarification TNixon. Unfortunately documentation for this is not available, but you may find this thread useful.
            Ryan M.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            152 views
            1 like
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            89 views
            1 like
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            133 views
            2 likes
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            127 views
            1 like
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            107 views
            0 likes
            Last Post CarlTrading  
            Working...
            X