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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      63 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      92 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      48 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      106 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      63 views
      0 likes
      Last Post PaulMohn  
      Working...
      X