• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Detect price on the trend line

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

    Detect price on the trend line

    Imagine there is trend-line drawed by strategy.
    Is there any comfortable way, how to get the price on the trend-line at specific bar?

    #2
    misova, not directly unfortunately - what you could check via the DrawObjects collection and the IDrawObject interface are the anchor points for example as properties.

    :http://www.ninjatrader.com/support/h.../nt7/iline.htm

    A sample script as starting point that works with those tools to give alerts for manual drawn lines could be found here in our sharing - http://www.ninjatrader.com/support/f...d=4&linkid=472
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thank you,
      so as I think about it, then the only way how to calculate price of the trend line
      on specific bar is to:
      1. Calculate a linear function y = Ax + B from those 2 anchor points
      2. and then use this function to calculate y-value (price) for other bars (x) ?


      Do you think this is good direction ?

      Comment


        #4
        You are correct, sounds like a good direction to take to me.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Thank you,
          so as I think about it, then the only way how to calculate price of the trend line
          on specific bar is to:
          1. Calculate a linear function y = Ax + B from those 2 anchor points
          2. and then use this function to calculate y-value (price) for other bars (x) ?


          Do you think this is good direction ?
          May I refer you to my post at:

          http://www.ninjatrader.com/support/f...948#post385948

          where the solution was to find the linear equation of a ray - effectively the same thing.

          It sounds as if you have the math (good old coordinate geometry from high school !) but if you need a hand, please let me know.

          As I said there, I've done precisely this recently and it's extremely effective - I'm able to get the level of the line at any bar.

          Hope it all work out.
          Last edited by arbuthnot; 09-02-2014, 05:57 AM. Reason: edit

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Bionian, Yesterday, 11:47 PM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_PaulH  
          Started by Gerik, Today, 12:14 AM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_PaulH  
          Started by mestril, Today, 06:00 AM
          0 responses
          7 views
          0 likes
          Last Post mestril
          by mestril
           
          Started by Goolden, Today, 05:47 AM
          0 responses
          5 views
          0 likes
          Last Post Goolden
          by Goolden
           
          Started by kujista, Today, 12:59 AM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_PatrickG  
          Working...
          X