Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    Chris L.NinjaTrader Customer Service

    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 usazencort, Today, 01:16 AM
      0 responses
      1 view
      0 likes
      Last Post usazencort  
      Started by kaywai, 09-01-2023, 08:44 PM
      5 responses
      603 views
      0 likes
      Last Post NinjaTrader_Jason  
      Started by xiinteractive, 04-09-2024, 08:08 AM
      6 responses
      23 views
      0 likes
      Last Post xiinteractive  
      Started by Pattontje, Yesterday, 02:10 PM
      2 responses
      22 views
      0 likes
      Last Post Pattontje  
      Started by flybuzz, 04-21-2024, 04:07 PM
      17 responses
      230 views
      0 likes
      Last Post TradingLoss  
      Working...
      X