Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Drawing a line at the Target

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

    Drawing a line at the Target

    Hello,

    I'm writing a strategy to backtest an option strategy.
    Now my question is how to draw a short line above the candle (or below the candle when it's a short position) when a long position is opened that represents the target?

    For example, the strategy opens a long position at a the current price of 1500, my target is set on 2% of the entry price what gives 30, so i want a short line above the candle when the position is opened at the price of 1530.

    I've tried a lot of things but i don't find the solution ...

    #2
    Hi Jimmy73, thanks for your note.

    If you would rather avoid custom rendering in the OnRender method with SharpDX, you can use the Draw.Line method to draw a simple line of any color.

    https://ninjatrader.com/support/help...?draw_line.htm

    For a SharpDX solution, see this example indicator that does a similar task:
    https://ninjatraderecosystem.com/use...ard-indicator/

    Please let me know if you have any questions on this material.

    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.
    Last edited by NinjaTrader_ChrisL; 03-14-2020, 04:21 PM.

    Comment


      #3
      Hello Chris,

      Thanks for your reaction.
      After a long search i've found the solution and thanks for the example indicator but this sort of code is to difficult for me to understand.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Today, 05:17 AM
      0 responses
      50 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      126 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      69 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      42 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