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 sjsj2732, 03-23-2026, 04:31 AM
          0 responses
          77 views
          0 likes
          Last Post sjsj2732  
          Started by NullPointStrategies, 03-13-2026, 05:17 AM
          0 responses
          313 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          314 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          149 views
          1 like
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          114 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Working...
          X