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 NullPointStrategies, Today, 05:17 AM
        0 responses
        50 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        126 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        69 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        42 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        46 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X