• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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 JohnAymin, Today, 02:38 PM
        0 responses
        2 views
        0 likes
        Last Post JohnAymin  
        Started by Rmos22, Today, 02:20 PM
        0 responses
        8 views
        0 likes
        Last Post Rmos22
        by Rmos22
         
        Started by sawtooth500, Today, 12:59 PM
        1 response
        3 views
        0 likes
        Last Post NinjaTrader_Spencer  
        Started by Steve L, Yesterday, 09:36 PM
        1 response
        19 views
        0 likes
        Last Post NinjaTrader_Kate  
        Started by MichaelAlexander, 04-25-2017, 03:28 AM
        9 responses
        1,170 views
        0 likes
        Last Post dani neira  
        Working...
        X