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 TheWhiteDragon, 01-21-2019, 12:44 PM
      4 responses
      543 views
      0 likes
      Last Post PaulMohn  
      Started by GLFX005, Today, 03:23 AM
      0 responses
      3 views
      0 likes
      Last Post GLFX005
      by GLFX005
       
      Started by XXtrader, Yesterday, 11:30 PM
      2 responses
      12 views
      0 likes
      Last Post XXtrader  
      Started by Waxavi, Today, 02:10 AM
      0 responses
      7 views
      0 likes
      Last Post Waxavi
      by Waxavi
       
      Started by TradeForge, Today, 02:09 AM
      0 responses
      14 views
      0 likes
      Last Post TradeForge  
      Working...
      X