Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

problem to delete draw.text

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

    problem to delete draw.text

    hi,
    in my indicator i try to delete a text that i draw with command " draw.text "

    Some delete them and others do not...


    RemoveDrawObject(tag)..

    i check it and the tag is correctly..





    the name of tag coincide..(add and delete)....the MtCount is the name of square
    Last edited by turbofib; 08-20-2016, 06:33 PM.

    #2
    Please post the code you are using.

    You could also use something like _______.Dispose()

    Of course, you have to identify the object first, but that method does work.

    Comment


      #3
      i can't to post my code...it's so long..
      it's little part of code (but you don't will undestand it..because is a little part of my code)



      for (int i = tagFc1.Count - 1; i >= 0; i--)
      {
      if (tagFc1[i] != string.Empty) //AGGIUNGI IN VIAGGIO GRECIA
      {
      MT.refIndicator.RemoveDrawObject(tagFc1[i]); //fatto in questo modo per usare qua dentro RemoveDrawObject
      if (countDown > 0)
      {
      countDown--;
      // MT.refIndicator.Print("sto toglienndo @@ " + tagFc1[i]);
      tagFc1.RemoveAt(i);

      i = tagFc1.Count;
      }
      else break;
      }

      }
      i don't understand where i use "dispose"..
      i see

      but it use it in State.Terminated., while i must to delete draw during execution in real time
      Last edited by turbofib; 08-21-2016, 12:21 PM.

      Comment


        #4
        Hello,

        Thank you for the post.

        I would not suggest using Dispose to remove a Draw.Text object but instead use what you are or RemoveDrawObject(tag);

        Can you tell me, if you Print the tags being removed I.E:
        Code:
        if (tagFc1[i] != string.Empty) //AGGIUNGI IN VIAGGIO GRECIA
        {
        [B]Print(tagFc1[i]);[/B]
        MT.refIndicator.RemoveDrawObject(tagFc1[i]);
        Do you see the Tag of the objects that remain? Mainly are the tags that need to be removed being passed into the RemoveDrawObject(tag) method?

        This would be a good first test, you can right click the chart and select Drawing Objects to view which objects are still on the chart and their tags, then compare what is left over against the Prints.

        If the Print did not happen, the logic did not allow for the object to be removed. If the print had happened and it was passed to RemoveDrawObject but it was not removed that is another item we could work though.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          i have to do it and...see pics

          https://gyazo.com/573d8d13d075d4a58db5df1b9be362b8 (my code with print )

          https://gyazo.com/698f3f3b60ea59a1f8097cd7a60f7797 (display output)

          https://gyazo.com/2ba27c381d5177c3661fbe80be1808ea (Drawing Object ..i continue to see the text draw)

          The problem there is

          Comment


            #6
            Hello,

            Thank you for the reply.

            Yes in this case because I can not see the full extent of the logic, I could really not say what may be happening.

            For this I could only suggest to try a more simple approach at what you are currently doing as a test, potentially in a separate file to find the cause. Most likely this is caused by the logic happening, but in the case the object is not being removed it may be due to the objects you are using also. I noted that the variable name for the indicator is MT.refIndicator, it could be due to how this variable was created or is being used in the case the object being removed is not owned by the current script that is executing the command. Without a more refined sample that we could try it would be hard to say.

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by andrewtrades, Today, 04:57 PM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by chbruno, Today, 04:10 PM
            0 responses
            6 views
            0 likes
            Last Post chbruno
            by chbruno
             
            Started by josh18955, 03-25-2023, 11:16 AM
            6 responses
            436 views
            0 likes
            Last Post Delerium  
            Started by FAQtrader, Today, 03:35 PM
            0 responses
            9 views
            0 likes
            Last Post FAQtrader  
            Started by rocketman7, Today, 09:41 AM
            5 responses
            20 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X