Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Horizontal Line: Interactive and retrieve the price value

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

    Horizontal Line: Interactive and retrieve the price value

    I am trying to create an indicator that calculates my position size based on 2 horizontal lines, one for my entry point and another for my stop loss. however, I can't make the lines interactive to allow me to drag and drop where I want to place the entry and stop. Also when I try to retrieve the price where the line is placed, say that Value property is not accessible.

    Can someone help me with that?

    tks,
    Rodrigo Miranda

    #2
    Hello rodrigolmiranda,

    To do this you would likely need to use the DrawObjects collection to find manually drawn lines so they can be modified, you can see a sample of working with that collection here:

    Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.


    To get the price it would be:

    double price = myDrawingObject.StartAnchor.Price;

    Comment


      #3
      Maybe you can use this indicator as a reference: https://ninjatraderecosystem.com/use...d/price-alert/

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      559 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      324 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
      546 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      547 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X