Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

help with NT8 drawing objects

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

    help with NT8 drawing objects

    Hello,

    I'm converting NT7 to NT8....am trying to understand the structure of the drawing objects by reading the online documentation....but am confused

    ?? where is IDrawObject and ILine in NT8? ??


    not really finding what I need, which is to

    1) search for all hand drawn Ray and Horizontal lines, and of a specific color

    2) change the color of the line



    Perhaps an existing sample would work better...is there an indicator I can study?

    and, is there any visual diagram that shows the hierarchy of the draw components and where to find all the various properties?


    Thx


    #2
    Ok, I found this...




    that should answer part of my question....now I am confused about Anchors....in NT7 these were attribues of IDrawObject, I believe they were called StartY, EndY, StartBarsAgo, EndBarsAgo

    in NT8 it appears these are "denormalized" into a List attached to IDrawingTool?

    I need to get these attributes / anchors for a Horizontal Line and also a Ray in NT8.


    Does that mean that, for a Ray I need to iterate through the Anchors and derive my own anchor attributes?

    How many Anchors does a Ray have? I imagine only two? (because on the screen there is a middle point dot.)




    What about Horizontal Line? Would I expect only one Anchor?


    Is there any documentation on this? I can find it... (sorry)


    IntelliSense give these attributes for Anchor....Count, First, Last .... are these useful?

    Comment


      #3
      Hello llanqui,

      Thanks for your post.

      Some methods/properties have been changed in NinjaTrader 8. A list of the code-breaking changes from NinjaTrader 7 to NinjaTrader 8 could be found on this help guide page: http://ninjatrader.com/support/helpG...ng_changes.htm

      The help guide above will be the best way to see how things have changed from NinjaTrader 7 to NinjaTrader 8.​

      If you search IDrawObject, we can see the NinjaTrader 8 method/property is IDrawingTool. We can also search ILine to see that the NinjaTrader 8 method/property is Line.

      See the help guide documentation below for more information.
      IDrawingTool: http://www.ninjatrader.com/support/h...rawingtool.htm
      Line: http://www.ninjatrader.com/support/h....html?line.htm

      You could view the third sample code section on the help guide page linked below to see how to loop through the collection to find specific draw objects.



      You could then print out information about a draw object, such as the StartAnchor and EndAnchor as seen in the sample code mentioned above.

      The syntax below could be used to draw a ray using StartY, EndY, StartBarsAgo, EndBarsAgo arguments.

      Draw.Ray(NinjaScriptBase owner, string tag, bool isAutoScale, int startBarsAgo, double startY, int endBarsAgo, double endY, Brush brush, DashStyleHelper dashStyle, int width)

      Draw.Ray(): https://ninjatrader.com/support/help...8/draw_ray.htm

      To draw a horizontal line, see this help guide page: https://ninjatrader.com/support/help...zontalline.htm

      Let me know if I may assist further.
      <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

      Comment


        #4
        ok, with this advice I found the help page on the anchor interfaces for each draw object...that is what I needed...thank you

        --------------------------------------------------------------
        there is a property / interface between the draw object and the anchor's Start and End points, and the Brush

        Represents an interface that exposes information regarding a Ray IDrawingTool.
        Represents an interface that exposes information regarding a Horizontal Line IDrawingTool.​​

        --------------------------------------------------------------

        sure would help to see a diagram that showed the relationships of all the components in Ninja.... a Tree structure / collapse / expand

        since I'm visual it would speed up my comprehension greatly of NT8

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        576 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        553 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X