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