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

"Tagging" Graphics g DrawRecangle() in Plot()...

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

    "Tagging" Graphics g DrawRecangle() in Plot()...

    When using DrawRectangle with NinjaScript the signature allows for a "tag" to give the rectangle a unique id, so after it draws, it can remain on the chart. However, when overriding Plot() and using the "Graphics.DrawRectangle()" there is NO tag param. So consequently, my rectangle disappears and redisplays in another location OnBarUpdate(). How can I get my indicator to keep adding rectangles when overriding Plot()?

    NinjaScript signature:
    DrawRectangle("tag1", 10, Low[10] - TickSize, 5, High[5] + Ticksize, Color.Blue);

    Graphics g DrawRectangle() (C#) signature (notice no "tag1" - unique id param):
    public void DrawRectangle(
    Pen pen,
    int x,
    int y,
    int width,
    int height
    )
    Last edited by funk101; 03-13-2011, 01:32 PM.

    #2
    Hello,

    Unfortunately when you override plot you loss this functionality. So you would need to create your own tag ID method to do what you are looking to do.

    Unfortunately since this is unsupported I cannot give further information then the above.

    I look forward to assisting you further.

    Comment


      #3
      Repaint or Invalidate...

      Does this happen globally when resizing the chart? Specifically in Plot()?

      Comment


        #4
        Hello,

        Unfortunaley would only have to have you test to see if it gets called as this is what I would have to do.

        Plot() override is there is a sandbox for you to play in to customize and do virtually anything your looking to do. Because of this it is fully unsupported. If you have any questions on the NinjaScript functions I would be happy to answer these no problem.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by pechtri, 06-22-2023, 02:31 AM
        9 responses
        122 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by frankthearm, 04-18-2024, 09:08 AM
        16 responses
        66 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by habeebft, Today, 01:18 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by benmarkal, Today, 12:52 PM
        2 responses
        14 views
        0 likes
        Last Post benmarkal  
        Started by f.saeidi, Today, 01:38 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Working...
        X