Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Advanced dynamic drawing

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

    Advanced dynamic drawing

    for my current project i need something that is a little bit different than anything ive used so far and it puts my in a bit of a problem.

    to describe the general problem in a simple way (outside of what im actually tryin to do) ....

    lets assume i have an int value(n) that is calculated and potentially changed for every bar update. the value it can have is pretty much random and isn bound in a specific range. so it can essentailly be any real number.

    i now wanna dynamicly draw as many (for example) horizontal lines as n is big. so for n=5 it should draw 5 lines. for n=46 46 lines and so on.

    has anyone an idea how to even get started with this?

    would be great.

    #2
    Originally posted by BigRo View Post
    for my current project i need something that is a little bit different than anything ive used so far and it puts my in a bit of a problem.

    to describe the general problem in a simple way (outside of what im actually tryin to do) ....

    lets assume i have an int value(n) that is calculated and potentially changed for every bar update. the value it can have is pretty much random and isn bound in a specific range. so it can essentailly be any real number.

    i now wanna dynamicly draw as many (for example) horizontal lines as n is big. so for n=5 it should draw 5 lines. for n=46 46 lines and so on.

    has anyone an idea how to even get started with this?

    would be great.
    A for loop, using the number as the limit for the index?

    Comment


      #3
      i googled what that is and it indeed looks quite fitting. i will take a look into that and if i run into a problem i will come back here. thanks.

      Comment


        #4
        Hello,
        Koganam is correct that a for loop could do this.
        You could use the following for loop:
        Code:
        private int numberOfHorizontal = 5;
        for(int i = numberOfHorizontal = 5; i > 0; i--) 
        {
            DrawHorizontalLine("stringtag" + Time[0], double, Color);
        }
        You can view the NinjaTrader documentation on For lopps and other looping commands at the following link: http://ninjatrader.com/support/helpG...g_commands.htm
        Cody B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        571 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        330 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        549 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        549 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X