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 Hwop38, 05-04-2026, 07:02 PM
        0 responses
        151 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        304 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        244 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        345 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        175 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Working...
        X