Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to increment string?

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

    How to increment string?

    I am trying to draw multiple vertical lines on a chart using DrawVerticalLine. This requires providing a string tag which must be unique each time used. I can't figure out how to increment a string.

    I've tried this:

    In the variable section:

    int TagNbr = 1;

    In the code:

    string myTag = string "myTag" + TagNgr.ToString;
    TagNbr = TagNbr +1;

    The error says I can't use the + operator in this context.

    I'm sure this is awkward and there must be a better way.

    #2
    string myTag = "myTag" + TagNgr.ToString();
    RayNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Noobie2B, Today, 09:14 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by bosajin, Today, 09:15 AM
    0 responses
    9 views
    0 likes
    Last Post bosajin
    by bosajin
     
    Started by Zombie, Yesterday, 06:23 PM
    1 response
    17 views
    0 likes
    Last Post NinjaTrader_Kate  
    Started by EquityTrader, Today, 09:05 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by torch2k, Yesterday, 06:55 PM
    1 response
    23 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Working...
    X