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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        142 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        81 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        125 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        120 views
        1 like
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        98 views
        0 likes
        Last Post CarlTrading  
        Working...
        X