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 Hwop38, 05-04-2026, 07:02 PM
      0 responses
      150 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      303 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      243 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      345 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      174 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X