Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ninja script how can I draw my own line similar to Profit Target line

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

    Ninja script how can I draw my own line similar to Profit Target line

    Hello,

    I would like to know how I could draw a line similar to the one that appears in the Char Trader when a Profit Target is set and also how to remove it when I want.

    Any help will be greatly appreciated.

    All the best.

    #2
    Hello JoseFRS,

    Thanks for your question.

    There is not an out-of-box supported way to draw Order Marker like lines in NinjaScript, but it is certainly possible to create your own custom rendering routines to draw something as such. Using SharpDX in OnRender, you can use RenderTarget.DrawLine to draw a line, and you can use PathGeometry and RenderTarget.FillGeometry to create a figure that looks like the Order Marker flag.

    To get more acquainted with SharpDX rendering, please see the Help Guide article below, and please see the SampleCustomRender indicator that comes with NinjaTrader.

    https://ninjatrader.com/support/help..._rendering.htm

    Although less flexible, you could consider using NinjaTrader drawing tools to give you something that provides similar functionality. The result would not be 1:1 but may be enough for your needs.

    Drawing - https://ninjatrader.com/support/help...t8/drawing.htm

    We look forward to assisting.

    Comment


      #3
      Originally posted by NinjaTrader_Jim View Post
      Hello JoseFRS,

      Thanks for your question.

      There is not an out-of-box supported way to draw Order Marker like lines in NinjaScript, but it is certainly possible to create your own custom rendering routines to draw something as such. Using SharpDX in OnRender, you can use RenderTarget.DrawLine to draw a line, and you can use PathGeometry and RenderTarget.FillGeometry to create a figure that looks like the Order Marker flag.

      To get more acquainted with SharpDX rendering, please see the Help Guide article below, and please see the SampleCustomRender indicator that comes with NinjaTrader.

      https://ninjatrader.com/support/help..._rendering.htm

      Although less flexible, you could consider using NinjaTrader drawing tools to give you something that provides similar functionality. The result would not be 1:1 but may be enough for your needs.

      Drawing - https://ninjatrader.com/support/help...t8/drawing.htm

      We look forward to assisting.
      Hi Jim,

      Thank you very much for your quick response.

      Ok, I'll try what you tell me.

      All the best.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      579 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      334 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      554 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      551 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X