Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unique Tags for Drawing/Text Objects

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

    Unique Tags for Drawing/Text Objects

    Do you have a function for creating these? If not, I would like to recommend adding one to the API. I created this one which works for me:

    Code:
     
    private string GetUniqueTag()
    {
         return Guid.NewGuid().ToString();
    }

    #2
    You can create unique tags just by adding CurrentBar to your tag string.

    "name" + CurrentBar
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Unique Tags

      Actually, the whole point of my request is for things that I don't care to name. For those mundane text and objects that I don't care to track, I prefer to just set it to something guaranteed to be unique. Your suggestion makes me have to "think" and it convolutes the code. It creates additional complexity because in an indicator/strategy that has a lot of drawings/text, I could inadvertently use the same "name" + currentbar and create some debugging headaches. Something like a simple method guaranteed to be unique is "fire and forget".

      Frankly, I would prefer you to overload all your methods and drop the tag, but I thought that was asking for too much. That is why I suggested something simpler.

      Hopefully you see the difference.
      Last edited by moflaherty; 11-29-2008, 11:50 AM. Reason: typo

      Comment


        #4
        Thank you for the suggestion. I will forward it to development.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          You already answered your question, just using GUID, no even need to wrap it in a method...

          DrawLine(Guid.NewGuid().ToString()....)
          RayNinjaTrader Customer Service

          Comment


            #6
            ?

            It wasn't a question--just a suggestion.

            {sigh}

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by jxs_xrj, 01-12-2020, 09:49 AM
            6 responses
            3,290 views
            1 like
            Last Post jgualdronc  
            Started by Touch-Ups, Today, 10:36 AM
            0 responses
            8 views
            0 likes
            Last Post Touch-Ups  
            Started by geddyisodin, 04-25-2024, 05:20 AM
            8 responses
            61 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by Option Whisperer, Today, 09:55 AM
            0 responses
            8 views
            0 likes
            Last Post Option Whisperer  
            Started by halgo_boulder, 04-20-2024, 08:44 AM
            2 responses
            24 views
            0 likes
            Last Post halgo_boulder  
            Working...
            X