Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Draw a line forward

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

    Draw a line forward

    Hi,

    using the stretgy tool, i'd like to draw a line from a new high 3 candles back and 3 candles in the future. how can i manage this with the strategy tool? (setting "end bars ago" to 3 isn't working)

    i have see this thread: http://www.ninjatrader.com/support/f...nd+line+future

    attached the actuell settings and the result
    thanks for any assistance!
    Attached Files

    #2
    Originally posted by Tradexxx View Post
    Hi,

    using the stretgy tool, i'd like to draw a line from a new high 3 candles back and 3 candles in the future. how can i manage this with the strategy tool? (setting "end bars ago" to 3 isn't working)

    i have see this thread: http://www.ninjatrader.com/support/f...nd+line+future

    attached the actuell settings and the result
    thanks for any assistance!
    Please try setting "end bars ago" to -3.
    ninZa
    NinjaTrader Ecosystem Vendor - ninZa.co

    Comment


      #3
      Thanks a lot ninZa!

      additional question: i guess it's not possible with the strategy-tool to extend the line, until it's broken by a higher high, or?
      (at the end of the day: the idea is to draw a line on relative highs - no that easy for a newbie)

      Comment


        #4
        Not sure I understand your additional question Tradexxx.
        ninZa
        NinjaTrader Ecosystem Vendor - ninZa.co

        Comment


          #5
          hope a picture tells you more than my explanation
          Attached Files

          Comment


            #6
            Originally posted by Tradexxx View Post
            hope a picture tells you more than my explanation
            The problem seems that when new bars form but they are not higher highs, the line will NOT be extended in sync with the new bars, right? It just extends when a higher-high bar appears. Right?

            If that is the case, you have to re-draw the line for each bar update, so the line will extend with every new bar. However, I think it's done programmatically (write codes).
            Last edited by ninZa; 02-22-2015, 07:41 AM.
            ninZa
            NinjaTrader Ecosystem Vendor - ninZa.co

            Comment


              #7
              Originally posted by Tradexxx View Post
              hope a picture tells you more than my explanation
              I thought this was an interesting problem. So I've coded up an indicator - LineBacktoPivot - which seems to work.

              Please see attached image.

              It depends on a parameter 'Period' for the number of bars you need to look back for your line to be drawn. The default is 100.

              When importing, say no to importing any auxiliary files (MIN and MAX).

              Hope this helps.

              Ed
              Attached Files

              Comment


                #8
                Originally posted by Tradexxx View Post
                Thanks a lot ninZa!

                additional question: i guess it's not possible with the strategy-tool to extend the line, until it's broken by a higher high, or?
                (at the end of the day: the idea is to draw a line on relative highs - no that easy for a newbie)
                You cannot do that with the wizard. Unlock the code and write it.

                Comment


                  #9
                  hi!

                  first of all: thank you very much for your input!!
                  i suspected it wouldn't be easy :-)

                  @arbuthnot: thanks for the indicator. I'll have a look at it and in addition try to understand the code and learn, learn learn

                  Comment


                    #10
                    another additional question:
                    drawing 2 parallel lines and:
                    i won't to avoid that the indicator is going to draw another line (between the 2 lines), untill the first lines are broken by price - how do i have to mange this with code?
                    thanks for your assistance !!

                    Comment


                      #11
                      Originally posted by Tradexxx View Post
                      another additional question:
                      drawing 2 parallel lines and:
                      i won't to avoid that the indicator is going to draw another line (between the 2 lines), untill the first lines are broken by price - how do i have to mange this with code?
                      thanks for your assistance !!
                      Your question is not very clear. You may have to post a screenshot, so that I or other people can understand your idea and give a help.

                      Thanks.
                      Pi
                      ninZa
                      NinjaTrader Ecosystem Vendor - ninZa.co

                      Comment


                        #12
                        hi pi,

                        pls. have in mind i'm newbee in creating a indicator.
                        after having read hundreds of threads / tutorial etc,. i walked through the indicator from arbuthnot.
                        -> it looks like he's using a kind of "counter" to extend the drawn line and i'm wondering if there's no easier way to do that. something like: draw a line untill it's broken by price?
                        -> i can't find any description how to use the counter?
                        -> everything starts with a "period" - why is this neccessary?
                        -> even if i change the period, the indicator isn't working in the right way - some highs are not recognised by the indicator.

                        perhaps you can assist me?
                        probably i have to change my mind...

                        (my additional question is the result of going two steps back and start in another way - but if there's no other way to create a horizontal line - it's invalid....)
                        thanks a lot

                        Comment


                          #13
                          Originally posted by Tradexxx View Post
                          hi pi,

                          pls. have in mind i'm newbee in creating a indicator.
                          after having read hundreds of threads / tutorial etc,. i walked through the indicator from arbuthnot.
                          -> it looks like he's using a kind of "counter" to extend the drawn line and i'm wondering if there's no easier way to do that. something like: draw a line untill it's broken by price?
                          -> i can't find any description how to use the counter?
                          -> everything starts with a "period" - why is this neccessary?
                          -> even if i change the period, the indicator isn't working in the right way - some highs are not recognised by the indicator.

                          perhaps you can assist me?
                          probably i have to change my mind...

                          (my additional question is the result of going two steps back and start in another way - but if there's no other way to create a horizontal line - it's invalid....)
                          thanks a lot
                          Thanks Trade and Ninza

                          I coded that ind up very quickly and it's not necessarily the most efficient way of doing it. Moreover, the one I posted may not be as 'efficient' as was the case when I did the graphic, as I may have changed it after that.

                          Trade - you're asking very intelligent and appropriate questions for someone who's new to Ninja and wants to find out the best way of doing things. I think it's great you're going about things the right way. So many Forum users aren't as systematic as you are. It took me a long time to find out however much - or little - I know now.

                          Thanks also for your others messages.

                          I'm very busy at the moment but will try to have another look at this indicator at the weekend and try to explain why I did what I did - and maybe improve it in light of your suggestions.

                          Till then

                          Happy trading!

                          Ed

                          P.S. Remind me if I forget to do this!
                          Last edited by arbuthnot; 02-25-2015, 07:55 AM.

                          Comment


                            #14
                            I see. I think the stage should be left to arbuthnot because only he can understand his codes best to explain them to you.

                            By the way, the pseudo approach to draw a line until the line breaks it is:

                            1. You take the bar where the line starts.
                            2. For every bar update, you redraw the line from the start bar to the current bar with a unique line tag
                            3. If the price breaks the line, don't draw that line any more.
                            4. Instead, you have a new line with a new start bar, and a new unique tag, and the steps above repeat

                            I know it's pretty complicated for a new programmer, but I don't have much time right now.

                            Thanks.
                            Pi
                            ninZa
                            NinjaTrader Ecosystem Vendor - ninZa.co

                            Comment


                              #15
                              Originally posted by ninZa View Post
                              I see. I think the stage should be left to arbuthnot because only he can understand his codes best to explain them to you.

                              By the way, the pseudo approach to draw a line until the line breaks it is:

                              1. You take the bar where the line starts.
                              2. For every bar update, you redraw the line from the start bar to the current bar with a unique line tag
                              3. If the price breaks the line, don't draw that line any more.
                              4. Instead, you have a new line with a new start bar, and a new unique tag, and the steps above repeat

                              I know it's pretty complicated for a new programmer, but I don't have much time right now.

                              Thanks.
                              Pi
                              Thanks, Ninza. We posted at just about the same time.

                              Thanks for explaining how you'd approach this and I'll look to see - when I've got a free moment - how it differs from mine and will post back here.

                              Cheers, Ed

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Barry Milan, Yesterday, 10:35 PM
                              6 responses
                              18 views
                              0 likes
                              Last Post Barry Milan  
                              Started by DanielSanMartin, Yesterday, 02:37 PM
                              2 responses
                              13 views
                              0 likes
                              Last Post DanielSanMartin  
                              Started by DJ888, 04-16-2024, 06:09 PM
                              4 responses
                              13 views
                              0 likes
                              Last Post DJ888
                              by DJ888
                               
                              Started by terofs, Today, 04:18 PM
                              0 responses
                              12 views
                              0 likes
                              Last Post terofs
                              by terofs
                               
                              Started by nandhumca, Today, 03:41 PM
                              0 responses
                              8 views
                              0 likes
                              Last Post nandhumca  
                              Working...
                              X