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

Removing Text

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

    Removing Text

    I have an indicator that places text below the bar. I have a condition statement that if true it places the word "buy" below the bar. However later in the code if a different condition is true, I want to ERASE the word "buy" and print "major buy" instead. (this indicator is a CalculateOnBarClose false)

    Problem: How do I erase the word "buy". Here is my code for the "buy":

    DrawText(
    "Text11"+ CurrentBar, "buy", 0, Low[0] - 4 * TickSize, Color.Black);

    Here is how I am trying to remove it:

    RemoveDrawObject(
    "Text11");

    Is the text an actual DrawObject?

    Thanks



    Last edited by velocity; 12-21-2009, 07:46 AM.

    #2
    Originally posted by velocity View Post
    DrawText("Text11"+ CurrentBar, "buy", 0, Low[0] - 4 * TickSize, Color.Black);
    Try it:
    DrawText ("Text11", "buy", 0, Low [0] - 4 * TickSize, Color.Black);

    Comment


      #3
      Thanks for the suggestion, but that did not do it.

      Support, Any other Ideas?

      thanks

      Comment


        #4
        Originally posted by velocity View Post
        Thanks for the suggestion, but that did not do it.
        Velocity,

        I think that you are using the (example) "Text11288" object, but the "Text11" object you want to remove.

        Check:

        Print ( "Text11" + CurrentBar);
        Last edited by tamas; 12-21-2009, 08:06 AM.

        Comment


          #5
          I don't think that's the problem.

          Comment


            #6
            velocity,

            That is the problem. Your objects are uniquely named, just use a static name and instead of drawing new objects all the time, it will just modify the preexisting object. Remove the + CurrentBar from your tag name.
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by cmtjoancolmenero, Yesterday, 03:58 PM
            11 responses
            39 views
            0 likes
            Last Post cmtjoancolmenero  
            Started by FrazMann, Today, 11:21 AM
            0 responses
            5 views
            0 likes
            Last Post FrazMann  
            Started by geddyisodin, Yesterday, 05:20 AM
            8 responses
            52 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by DayTradingDEMON, Today, 09:28 AM
            4 responses
            26 views
            0 likes
            Last Post DayTradingDEMON  
            Started by George21, Today, 10:07 AM
            1 response
            22 views
            0 likes
            Last Post NinjaTrader_ChristopherJ  
            Working...
            X