Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawTextFixed with Position as a parameter

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

    DrawTextFixed with Position as a parameter

    Hi,

    My NT7 indicator would display a simple clock showing bar time using DrawTextFixed.

    I created a blank indicator through the wizard and then implemented the folowing snippets to start.

    Code:
            #region Properties
            [Category("Parameters")]
    		[Gui.Design.DisplayName("Clock Position")]
    		public TextPosition pubTextPosition
    		{
    			get { return parTextPosition; }
    			set { parTextPosition = value; }
    		}
    		
    
            #endregion
    In my OnBarUpdate():
    Code:
    DrawTextFixed("Clock", Time[0].ToLongTimeString(), parTextPosition);
    In my Dispose():
    Code:
    RemoveDrawObjects();
    or 
    RemoveDrawObject("Clock");
    Also I tried a number of flags in my Initialize() but am currently using:
    Code:
    ChartOnly			= true;
    Overlay				= true;
    My problem is that if user changes the position parameter I start getting several simultaneus labels on several corners.

    Also I added some Prints and my Outputs show as if the indicator is still running even after I removed it from the chart. The draw objects never disappear.

    Any help would be much appreciated. Thanks!
    Last edited by PedroLucas.net; 08-11-2017, 02:29 PM.

    #2
    Hello,

    Thank you for the post.

    I wanted to check, you said you are using a dispose method, could you instead try using the OnTermination override for removing the object?

    Code:
    protected override void OnTermination()
    {
        // Clean up your resources here
    }


    Otherwise, I would likely need to see a sample I can compile to see what syntax was used in total. I am unable to see from this why multiple objects would be listed.

    I look forward to being of further assistance.

    Comment


      #3
      Hi Jesse,

      Thanks for your quick reply.

      Here is the full code.
      Attached Files

      Comment


        #4
        Hello,

        Thank you for providing the file.

        I am unable to see several instances appearing when changing the Position property, I wanted to check what are the exact steps you are following to see this happening?

        Also, have you removed the indicator from the chart and re added it since adding the OnTermination override?

        I look forward to being of further assistance.

        Comment


          #5
          Hi,

          Ok, it's wierd that you don't see it (as attached). I tried closing chart window, restarting NT7 etc.

          I suppose it was something to do with the way it was 'compiled'. Maybe because I started it trough the wizard. Don't think I'll be able to grasp why it was happening.

          Anyway, I ported the useful bits of my code into a copy of one of the NT7 standard indicators, and it runs fine now.

          Thanks anyway for the triage.
          Attached Files

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          603 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          349 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          104 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          560 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          560 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X