Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Converting DrawObject code from NT7 to NT8

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

    Converting DrawObject code from NT7 to NT8

    any BIG Hints so I don't have to spend hours with this? :-)

    (I'm not a C# expert...)


    #region CheckDrawObjects
    private void CheckDrawObjects()
    {
    foreach (IDrawObject draw in DrawObjects)
    {
    // select User Drawn Horizontal or Ray Lines, and BLACK
    if (draw.UserDrawn && (draw.DrawType == DrawType.Ray || draw.DrawType == DrawType.HorizontalLine))
    {
    //Sets some line properties programatically
    ILine ThisLine = (ILine) draw;
    if (ThisLine.Pen.Color == Color.Black
    || ThisLine.Pen.Color == Color.Cyan)
    {
    ProcessDrawObject(draw, ThisLine);
    }
    }
    }

    Thanks!

    #2
    Hello llanqui,

    Thanks for your post.

    in NT7 Color has been replaced with Brushes in NT8. IE: Brushes.Black You may want to review: https://ninjatrader.com/support/help...ng_changes.htm to better understand the changes.

    For looping through draw objects, please see the help guide and examples here: https://ninjatrader.com/support/help...rawobjects.htm

    Comment


      #3
      Well.... does anyone know if there is a NT8 indicator that senses when the price intersects a line or a ray?

      Even with this information it is not a small task for me to convert this

      Thank you

      Comment


        #4
        Hello llanqui,

        Thanks for your reply.

        I'm not aware of a specific indicator that would do this.

        Please see this thread on how to project the y axis of a ray (same would apply to a line): https://ninjatrader.com/support/foru...rossing-a-line.

        If you would like something created for you, we can provide a link to 3rd party programmers in the NinjaTrader Ecosystem who can provide the coding service.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        156 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        90 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        140 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        130 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