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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      155 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
      137 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