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

Logo Bitmap on price panel issue

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

    Logo Bitmap on price panel issue

    Hi.

    I'm trying to add a logo on the chart inside one of my own indicator code.
    For that, I'm using one sample code you posted in the forum.

    But I'm having issues that I don't understand.

    First of all : When I add the logo code inside my indicator code, my indicator is not plotting any value anymore, why that ?
    (Screenshot 1 is my normal indicator plotting, screenshot 2 in the same with the logo code added)

    Second issue :
    If I select to plot my indicator in the same panel than the price, I can see my logo at the top left eon the screen as I expect it to. (Screenshot 2)
    But if I select a new panel for my indicator, then the logo will be hidden behind the price panel (Screenshot 3). If I enlarge the indicator panel to the top, I can see the logo (Screenshot 4).

    How can I have my logo plotted on the price panel, and at the same have my indicator plotting in its own panel ?

    I attached my code to the post.

    Thanx in advance for your help.
    Attached Files

    #2
    Hello thanajo,

    Thank you for your inquiry.

    I do not see your attached code.

    Please reupload your code here so that I may further investigate the issue.

    Looking forward to your reply.

    Comment


      #3
      Originally posted by NinjaTrader_ConnerS View Post
      I do not see your attached code.
      Firefox shows it right there under the 4 thumbnails.

      Click image for larger version  Name:	IMGDT_20210218_084300.png Views:	0 Size:	149.4 KB ID:	1142569

      Comment


        #4
        Hello thanajo,

        If you are using standard plots along with custom rendering from an indicator or strategy, you will need to ensure to call the base.OnRender() method for those plots to display. Implement base.OnRender(chartControl, chartScale); at the top of your OnRender method to fix your first issue.

        Please visit the following NinjaScript documentation for information:Next, your indicator is plotting the logo at the right coordinates, but the rendering is clipped.

        Please implement RenderTarget.DrawBitmap(myBitmap, new SharpDX.RectangleF(ChartPanel.X, ChartPanel.Y, 150, 150), 1.0f, SharpDX.Direct2D1.BitmapInterpolationMode.Linear); in your OnRender method to place the logo in the top left of the respective chart panel.

        For more information on using SharpDX for custom chart rendering, please visit the following links:You may not plot the logo on the price panel unless the indicator is assigned to display on the same price panel. To work around this, you would need to use a separate indicator to plot only the logo in the price panel while maintaining the original plot indicator in a separate panel.

        For more information on chart panel properties, please visit the following links:Please let me know if I may be of further assistance.
        Last edited by NinjaTrader_ConnerS; 02-18-2021, 01:54 PM.

        Comment


          #5
          Thanx.

          So you say :
          "To work around this, you would need to use a separate indicator to plot only the logo in the price panel while maintaining the indicator in a separate panel"
          But I can't use the addchartindicator method in my indicator. So how may I have my logoindicator plotting threw my origi alindicator ?

          Comment


            #6
            Hello thanajo,

            Thank you for your reply.

            The logo indicator would have to be a completely separate indicator.

            You may still render a logo in your original indicator, but you can only render within the indicator's assigned panel.

            Please let me know if I may be of further assistance.

            Comment


              #7
              Originally posted by NinjaTrader_ConnerS View Post

              The logo indicator would have to be a completely separate indicator.
              Ok, but then, how can I call this separate indicator from my original indicator ? And so make it pop up the bitmap ?

              Regards.

              Comment


                #8
                Hello thanajo,

                The indicator would have to be added separately and cannot be added from another indicator. It would be recommended to ship a template that sets up the chart to your liking. Please see below for how you can distribute a chart template with an export.



                As an aside, I did notice some ill behavior testing your indicator. I made some recent revisions to my SampleDrawBitmap example that follows recommended practices for SharpDX resource management. It may be worth a look for you.



                We look forward to assisting.
                JimNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by frslvr, 04-11-2024, 07:26 AM
                7 responses
                109 views
                1 like
                Last Post caryc123  
                Started by rocketman7, Today, 09:41 AM
                3 responses
                7 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by traderqz, Today, 09:44 AM
                2 responses
                4 views
                0 likes
                Last Post NinjaTrader_Gaby  
                Started by stafe, 04-15-2024, 08:34 PM
                8 responses
                41 views
                0 likes
                Last Post stafe
                by stafe
                 
                Started by rocketman7, Today, 02:12 AM
                7 responses
                31 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Working...
                X