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

Sample Code for Drawing in AddOn

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

    Sample Code for Drawing in AddOn

    Hello!

    I'm trying to do some custom drawing on a chart from within my AddOnBase subclass.

    Are they any examples on how to do this? I'm used to using OnRender(), RenderTarget, etc (with the SharpDX API) but I don't really see a facility for that in the "AddOnBase" world.

    If you could point me in the right direction, that would be wonderful.

    Thanks in advance!

    #2
    Hello MarkWise,

    Thank you for opening the thread.

    We currently don't have any example code that can demonstrate this.

    The AddOnBase class does not have a RenderTarget or methods for rendering. You could include the SharpDX using directives and capture the RenderTarget, ChartControl, and ChartScale of a Chart so you can create your own external OnRender() and OnRenderTargetChanged() methods for custom rendering to that chart.

    I will look into creating a basic example to see if this would be possible through supported methods.

    I look forward to being of further assistance.
    JimNinjaTrader Customer Service

    Comment


      #3
      That would be extremely helpful,, thanks!

      I'll do some of my own research as well.

      Comment


        #4
        Hello MarkWise,

        After looking into this further, the rabbit hole appears to get deeper and deeper and the possibility of doing this gets further and further away from what we may support.

        Even if the RenderTarget is captured and then used externally from an AddOn, the rendering from the AddOn would not be in sync with the chart. I.E. a chart's render pass could update immediately after the AddOn draws to it and the custom rendering would be lost.

        As the syncing issue would be a difficult issue to overcome, I would advise to stick to leaving custom rendering in the context of an indicator.

        If there is any thing else I can do to be of further help, please let me know.
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by DanielSanMartin, Yesterday, 02:37 PM
        2 responses
        12 views
        0 likes
        Last Post DanielSanMartin  
        Started by DJ888, 04-16-2024, 06:09 PM
        4 responses
        12 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by terofs, Today, 04:18 PM
        0 responses
        11 views
        0 likes
        Last Post terofs
        by terofs
         
        Started by nandhumca, Today, 03:41 PM
        0 responses
        7 views
        0 likes
        Last Post nandhumca  
        Started by The_Sec, Today, 03:37 PM
        0 responses
        3 views
        0 likes
        Last Post The_Sec
        by The_Sec
         
        Working...
        X