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

rendering bitmap on chart window

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

    rendering bitmap on chart window

    Hi, I am now rendering a bitmap image on chart for my indicator on left bottom corner. problem is, it goes up when I add another indicator in additional panel. is there anyway I can still be able to render the bitmap image regardless additional panel added due to additional indicators added to the chart? if yes, can you please advise syntax for that?

    #2
    Hello asmmbillah, thanks for writing in.

    We have an example that I attached here. It is able to render a bitmap to the main panel and stay there when a new panel is drawn. Could you reference this and let me know if you have any questions on it?

    I look forward to hearing of your results.
    Attached Files
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      thanks for your reply and sample. currently I am following the its done in your sample. but with that whenever you add additional indicators in new panels, it moves up as well. please see the screenshots. Its relative to the panel at the moment. But what I am trying to achieve, is regardless of adding more indicators in the chart, the bitmap needs to stay where it was initially. I hope that clarifies. thanks in advance.
      Attached Files

      Comment


        #4
        Hello asmmbillah, thanks for your reply.

        The render target for the indicator is clipped to the panel size, so this would take a more advanced approach to render relative to the window size. This would involve getting the size of the WPF window and drawing the rectangle based on that data. I attached a basic example demonstrating accessing the window size. If you have questions on this please let me know.

        Attached Files
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          thanks for your sample. I think, this is the one will help. but with the chartWindow print, it is very difficult to get an idea where the points are. But when I am trying to convert them with chartWindow, I have no idea whether is it pointing the exact points which it used to be or not. I have tried printing the value, but with prints, it is not going anywhere. currently I am using like below:
          float startPoint = 100;
          float endPint = chartWindow.Height - 300;

          And when additional panel is added, then its bitmap image is hiding behind the panel. Therefore back to square one. I hope, that clarifies.
          thanks in advance.
          Last edited by asmmbillah; 10-27-2020, 03:16 PM.

          Comment


            #6
            Hello asmmbillah, thanks for your reply.

            Unfortunately, I will not be able to debug this issue. It will take trial and error debugging by printing values to the output window and testing repeatedly to work out the exact desired result of a render. Just note that the render target size will always be the size of the panel, so the position must be adjusted relative to the size of the panel.

            Best regards,
            -ChrisL

            Chris L.NinjaTrader Customer Service

            Comment


              #7
              thanks for your reply. probably I could not make myself clear. i don't want you to debug it for me. My point was, rendered bitmap is getting hidden behind additional panel. Probably you did not see my edited message at the end. I wanted to keep the bitmap image on the same place regardless additional panel added on the chart due to addition of other indicators. I hope that clarified it further.

              Comment


                #8
                Hello asmmbillah, thanks for your reply.

                That would be due to multiple render targets being on the chart. The render target is the same size of the chart panel, so it's expected for the rendered object to be hidden by the other panels.

                Please let me know if I can assist any further.
                Chris L.NinjaTrader Customer Service

                Comment


                  #9
                  thanks for your reply. but is there anyway I could render it at above all? in attached screenshot 1, it is drawing the rectanngle, but in screenshot 2 it is hiding behind additional panel. is there anyway in nt8 to render it so that it will not hide behind additional panel or not possible. thanks in advance.
                  Attached Files

                  Comment


                    #10
                    Hello asmmbillah, thanks for your reply.

                    I have no supported way of rendering outside of the panel, unfortunately.
                    Chris L.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by guillembm, Yesterday, 11:25 AM
                    2 responses
                    9 views
                    0 likes
                    Last Post guillembm  
                    Started by junkone, 04-21-2024, 07:17 AM
                    9 responses
                    68 views
                    0 likes
                    Last Post jeronymite  
                    Started by trilliantrader, 04-18-2024, 08:16 AM
                    4 responses
                    20 views
                    0 likes
                    Last Post trilliantrader  
                    Started by mgco4you, Yesterday, 09:46 PM
                    1 response
                    11 views
                    0 likes
                    Last Post NinjaTrader_Manfred  
                    Started by wzgy0920, Yesterday, 09:53 PM
                    0 responses
                    10 views
                    0 likes
                    Last Post wzgy0920  
                    Working...
                    X