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 NullPointStrategies, Today, 05:17 AM
      0 responses
      30 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      124 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      64 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      41 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X