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

Place a picture on a chart

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

    Place a picture on a chart

    Hi, I would like to add a picture (i.e. a logo) to a chart.

    Are there in code samples that illustrate how this is done?

    #2
    Hello AnotherTrader,

    There are no samples we can give out at this time. You will have to use built in C# classes and methods such as the Image class. I am including a publicly available link to Microsoft's documentation for the Image class.

    https://msdn.microsoft.com/en-us/lib...ing.image.aspx

    In order to use classes such as the Image class, you will need to know where on the screen you are drawing to. NinjaTrader 8 will provide support for this. I am including a link to the NinjaTrader 8 Help Guide documentation for GetYByValue()

    http://ninjatrader.com/support/helpG...etybyvalue.htm

    Please let us know if there are any other ways we can help.
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Many thanks.

      A further question... is there a programmatic means to tell how many bars are shown on a chart?

      Comment


        #4
        Originally posted by AnotherTrader View Post
        Many thanks.

        A further question... is there a programmatic means to tell how many bars are shown on a chart?

        OK, looks like I can use the following members to get what I need:

        Code:
        this.FirstBarIndexPainted 
        this.LastBarIndexPainted

        Comment


          #5
          Correct, the difference between those two values will give you the number of bars on the screen. Please let us know if we can be of further assistance.
          Jessica P.NinjaTrader Customer Service

          Comment


            #6
            Thanks.

            Is there a member giving highest and lowest prices shown on the price axis of a chart?

            Comment


              #7
              One method that comes to mind would be to trust users to auto-scale Y values to fit the chart's data, and then to use the MAX and MIN indicators with the known period you have just discovered how to calculate. I am providing help guide documentation for the MAX and MIN indicators.

              http://ninjatrader.com/support/helpG...aximum_max.htm
              http://ninjatrader.com/support/helpG...inimum_min.htm
              Jessica P.NinjaTrader Customer Service

              Comment


                #8
                Originally posted by NinjaTrader_JessicaP View Post
                One method that comes to mind would be to trust users to auto-scale Y values to fit the chart's data, and then to use the MAX and MIN indicators with the known period you have just discovered how to calculate. I am providing help guide documentation for the MAX and MIN indicators.

                http://ninjatrader.com/support/helpG...aximum_max.htm
                http://ninjatrader.com/support/helpG...inimum_min.htm
                Nah ... no good for what I need; what if user has an indicator overlaying price that autoscales and which has values that are different from price? The y axis will show prices above or below the prices obtained using MAX() or MIN().

                Or what if user autoscales not just to get min and max of price right but to get say a specific pivot line on the chart? Again, the min and max of the y axis won't correspond to the values obtained with MAX() and MIN().
                Last edited by AnotherTrader; 04-12-2016, 07:38 AM.

                Comment


                  #9
                  I was also able to find this solution on the forums, and I believe it is the best answer to your question available. You would then want to store the retrieved pass by reference values outside of the overridden method. This solution is time sensitive; you will need to ensure that GetMinMaxValues has been called before you may trust any stored values you have.

                  http://ninjatrader.com/support/forum...ad.php?t=73383

                  NinjaTrader 7 does not support this directly. However, this discussion from 2011 has a lot of good discussion generally on converting NinjaTrader 7 data into bounding rectangles for graphics.

                  http://ninjatrader.com/support/forum...627#post216627

                  In NinjaTrader 8, this will be officially supported in the documentation. I am providing a link.

                  http://ninjatrader.com/support/helpG...properties.htm
                  Jessica P.NinjaTrader Customer Service

                  Comment


                    #10
                    Originally posted by AnotherTrader View Post
                    Hi, I would like to add a picture (i.e. a logo) to a chart.

                    Are there in code samples that illustrate how this is done?
                    There's an indicator for sale that does this:

                    http://www.ninjatools.somee.com/

                    All the way at the bottom, "CustomCanvas"

                    NT_ChelseaB provided this code example:

                    http://ninjatrader.com/support/forum...ckground+image

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by JTizz, Today, 03:32 PM
                    1 response
                    35 views
                    0 likes
                    Last Post NinjaTrader_ChrisL  
                    Started by ebaydan777, Today, 02:41 PM
                    1 response
                    28 views
                    0 likes
                    Last Post NinjaTrader_ChrisL  
                    Started by aligator, Today, 02:28 PM
                    1 response
                    27 views
                    0 likes
                    Last Post NinjaTrader_ChristopherJ  
                    Started by daniel_weber8, Today, 01:21 PM
                    1 response
                    45 views
                    0 likes
                    Last Post NinjaTrader_ChristopherS  
                    Started by jungsoohuh, Today, 12:07 PM
                    1 response
                    37 views
                    0 likes
                    Last Post NinjaTrader_PaulH  
                    Working...
                    X