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

how to know start point and End point of Line

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

    how to know start point and End point of Line

    hi,
    i have this line code :

    Code:
    
    Draw.Line(this, "Trend" + CurrentBar, true, indexMemFIrstPoint, Low[indexMemFIrstPoint], 0, valTrendTerzoPunto, UpTrendColor, DashStyleHelper.Solid, 2);
    i want to know the start point and end point of line..(i want to know it using Tag of draw.line)




    i want to know StartAnchor and EndAnchor of the Line
    Last edited by turbofib; 07-22-2017, 10:28 AM.

    #2
    Hello,

    Thank you for the question.

    I wanted to clarify, are you asking how to access the Anchors of a Line object using the sample from the help guide?

    If so, you could change the third sample to remove draw.IsGlobalDrawingTool and instead add a check for your Tag name instead.

    Alternatively, you could use the first sample to supply a tag name directly but this would require similar syntax to the third example to cast to a line and then access its anchor.

    Could you confirm is this what you were asking?

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hello !

      I'm also trying to get the StartY and EndY value of an object made by hand and not in the context of the NinjaScript, it look like you managed to fix your issue turbofib, but, could you share how you did to get the StartY and EndY Value ?
      We are not necessarily all as fast than you

      Thanks ! Have a great day !

      Comment


        #4
        Excuse for my english......

        watch it :



        you draw 2 lines....i see name in drawing object : " Line" and "Line 2" ....this is name of tag..

        now i loop it :



        foreach (DrawingTool draw in DrawObjects)
        {
        if (!(draw is DrawingTools.Line)) continue;
        DrawingTools.Line globalLine = draw as DrawingTools.Line;
        if (globalLine.Tag.Contains("Line"))
        {
        Print(Time[0] + " Start Point " + globalLine.StartAnchor.Price + " End Point " + globalLine.EndAnchor.Price);
        }
        }
        this would write point start and point end of your line draw made by hand

        I hope to help you...

        Comment


          #5
          Thanks a lot turbofib !
          You just saved me days, you are fantastic !

          By the way, your english is great

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by The_Sec, Yesterday, 03:37 PM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by vecnopus, Today, 06:15 AM
          0 responses
          1 view
          0 likes
          Last Post vecnopus  
          Started by Aviram Y, Today, 05:29 AM
          0 responses
          5 views
          0 likes
          Last Post Aviram Y  
          Started by quantismo, 04-17-2024, 05:13 PM
          3 responses
          27 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by ScottWalsh, 04-16-2024, 04:29 PM
          7 responses
          36 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Working...
          X