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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      88 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      134 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      119 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      67 views
      0 likes
      Last Post PaulMohn  
      Working...
      X