Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Drawing multiple lines...

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

    Drawing multiple lines...

    Hi,

    I´m building a strategy which has multiple levels of interest, the number of levels depends on the number of contracts the strategy is allowed to trade (cross a level = buy/sell one contract).
    How can I draw these levels without hardcoding them? (since how many there are can change)

    I tried storing them in an array and made a for-loop, but it only draws the last one...

    Thanks
    /nyrn2k

    #2
    Hello nyrn2k,

    Welcome to the NinjaTrader support forums.

    You had the right idea with an array, if you needed multiple values that is generally best as an array or collection. You can later update the collection or loop over it to do actions.

    My guess would be that you either did not change the tag on each loop iteration to create new objects or that there is a problem with the way the loops being executed. Tags need to be unique so if you are not doing something like "Tag" + i then it would just draw the last iteration.

    If you can attach what you started that would help me to understand the problem better.

    I look forward to being of further assistance.

    Comment


      #3
      Of course, "Tag" + i, that will probably do it!

      Thanks for the quick reply!
      /nyrn2k

      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