Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Drawn Regression Channel in strategy

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

    Drawn Regression Channel in strategy

    Hi everyone

    I'm working on a method for automated trading in which it'll help to have confirmation of trend from a regression channel.

    However, I want to be able to apply the regression channel manually because the eye is far more powerful than anything I can code up!

    Would it be possible in any way for a strategy to have code that could detect whether a regression channel inserted as 'draw tool' is rising or falling.

    (If I was working with a constant period, I could use the RegressionChannel indicator and detect the slope easily but the period will be changing. Yes, I could work out the length of my drawn regression channel and enter that into the strategy but that means enabling and disabling it very frequently.)

    Thanks in advance for any help with this.
    Last edited by arbuthnot; 04-08-2015, 07:11 AM.

    #2
    Hello Arbuthnot,

    Thank you for your post.

    I would recommend the IDrawObject interface for the collection.

    This will allow you to get all the objects on the chart and sort them out and get the Regression channel -
    http://www.ninjatrader.com/support/h...drawobject.htm

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Thanks very much, Cal.

      Can I quite from another thread I started recently:

      Can I make the suggestion that this type of example would be very useful if it appeared in Help, which lacks examples, such as this, in many areas.
      I understand things will be better in future versions

      I've followed the link you gave me but, as before, there isn't a useful example.

      So, Cal, could you be so kind as to give me a coded example of the sort of IDrawObject I'm hoping to create.

      Much obliged.

      Comment


        #4
        Yeah let me something together here later today that will outline this for you
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          Arbuthnot,

          Try this sample out.

          Let me know if you need anything else on it
          Attached Files
          Cal H.NinjaTrader Customer Service

          Comment


            #6
            Cal, thanks so much for doing that.

            For historical analysis, the loop will help enable me to identify the end time of every RC on the chart. Given this approach can't be backtested in the usual way, printing out this data is exactly what I need.

            For live trading, I'll only have one RC on the chart (on the extreme right, of course), so unless I'm greatly mistaken, I won't need the loop.

            The information I need for this RC (or every RC for backtesting) is simply whether it's sloping up or down. Can the:

            Code:
            Print(myTool.EndTime);
            code be altered in any way so that I can extract the y values of the start and end points of the RC midline? (So if y[end] > y[start], then the RC is rising.)

            By the way, I'll be using Renko bars.

            I really appreciate your help and I look forward to hearing from you again.

            Comment


              #7
              Arbuthnot,

              Yeah take a look at the IRegressionChannel from our help guide. It will have all the available properties you can access for the object -
              http://www.ninjatrader.com/support/h...ionchannel.htm
              Cal H.NinjaTrader Customer Service

              Comment


                #8
                Thanks again, Cal.

                Having that loop and the IRegressionChannel data should enable me to get all the information I need for this method.

                I'll try not to, but if I get stuck, I'll post back here.

                Much appreciated.

                Comment

                Latest Posts

                Collapse

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