Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Drawing Rectangles

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

    Drawing Rectangles

    I have a strategy that generates about 4 signals in 1 week of backtesting in Strategy Analyzer.
    Each signal is supposed to draw a rectangle.
    But usually what happens it that only the last rectangle appears.
    (I think once, I saw all the rectangles)

    I am using unique tags.
    I'm using

    Code:
    Random random = new Random();
    int randomNumber = random.Next(0, 1000);
    Draw.Rectangle(this, "tag" + randomNumber, widthBars, High[widthBars] - TickSize, 0, Low[0] + TickSize, Brushes.Blue);
    How can I get all the rectangles to draw?​

    #2
    Figured it out - I was not using

    Random random = new Random();

    correctly

    Comment


      #3
      Hello reynoldsn,

      If you are attempting to use unique tag names, I recommend adding CurrentBar to the tag name.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Great idea - thank you. I think I did see this recently.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by kinfxhk, 07-13-2026, 10:18 AM
        0 responses
        57 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-13-2026, 09:50 AM
        0 responses
        39 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-13-2026, 07:21 AM
        0 responses
        45 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-11-2026, 02:11 AM
        0 responses
        35 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        153 views
        0 likes
        Last Post SalmaTrader  
        Working...
        X