Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Close Bbove or Below ExtendedLine

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

    Close Bbove or Below ExtendedLine

    Hello,

    I've drawn an extended line like so:
    Draw.ExtendedLine(this, "topline", CurrentBar-EB, EP, CurrentBar-AB, AP, Brushes.LimeGreen);

    Is there something built into ninjatrader that allows me to run some code when the close is above or below the line?

    I know I can figure out the Y value of the line for the given x value but I wan tot know if there's something built in.

    Thanks,

    Evan

    #2
    Hello evanp90,

    Thank you for your note.

    There's no simple way to check if the price crosses the extended line from NinjaScript. This example script from our User App Share can't be opened in NinjaTrader 8 as it was for NinjaTrader 7, but if you open it in a text editor, it gives an example of how to check if the line has been crossed. Obviously this code would need to be updated to be used in NinjaTrader 8, but this should give you a jumping off point for the necessary logic:

    Updated 9-28-11: Used a simpler approach for horizontal lines and improved "no alert" message handling so that these messages should always be correctly removed. ========= This indicator will alert when the most recent bar crosses manually drawn lines. Works on lines, rays, horizontal lines, and extended lines. Apply the indicator to a chart and manually […]


    Here's a link to our help guide on Code Breaking changes between NinjaTrader 7 and NinjaTrader 8:



    Please let us know if we may be of further assistance to you.

    The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.

    Comment


      #3
      Thank you!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      43 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      21 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      30 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      50 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Working...
      X