Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

how to see on all charts line drawn with SharpDX(isGlobal=1)

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

    how to see on all charts line drawn with SharpDX(isGlobal=1)

    I want to draw a segment line that stays anchored to the right edge of the chart when I move/zoom the X axis. Reading the reference the only way I found is to use RenderTarget.DrawLine() and RenderTarget.DrawTextLayout() inside onRender() using to compute something like double startX = ChartPanel.X + ChartPanel.W - 50 and double endX = ChartPanel.X + ChartPanel.W

    (I looked at the code from Pivots and PriceLine).

    Drawing lines and text this way, however, does not create DrawingObjects. I would need to load this indicator on only one chart but that drawn lines and text would show on all charts of the same instrument. Like if I drew a line Draw.Line() by setting isGlobal = true

    Is there a solution ? or in order to have this anchoring of the drawn elements I have to absolutely load the same indicator on all the charts where I need it ?

    thanks​

    #2
    OK I'm realizing that what I asked doesn't make sense. It doesn't make sense to size graph objects from a master graph to a slave depending on the zoom of the master. The slave will always have different dimensions
    The slave will always have dimensions​

    Comment


      #3
      Hello sn0z33r,

      When Drawing tool objects are made global NinjaTrader clones the instance of the drawing object class for each chart.
      The drawing object holds the price and time for each anchor and this is converted to rendering coordinates by each cloned instance for the chart it is on.

      With your script you would need to store the price and time and then add an instance of class to each chart, and convert the price and time to rendering coordinates for that chart.
      Unfortunately, I'm not able to think of a supported way to achieve this and it may require unsupported code such as using a static class property.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        thanks chelsea

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        648 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        369 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        572 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        574 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X