Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Polynomial Regression Channel

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

    #16
    Originally posted by scjohn View Post
    This a port from MQL4 to NinjaTrader. This was requested in a post in the Indicator Development forum.

    A very limited description can be found at http://codebase.mql4.com/4332 .

    PolynomialRegressionChannel.zip (2.9 KB, 84 views)
    scjohn,
    Thanks for the effort on this port.

    I am not sure if it is the intention of this indicator but it will recalculate and redraw the plots. See the image included.
    Attached Files

    Comment


      #17
      Hi TAJTrades,redraw is correct.

      Comment


        #18
        Does this indicator repaint in real-time? I'll try to see because yesterday I tested it using market replay data.

        Comment


          #19
          As coded, the indicator will recalculate/repaint the last 'Period' bars. So if you you set Period to 21 then the last 21 bars will show the polynomial fit. In other words, the last 21 bars will show the 'perfect' fit. Is you scroll past the last 21 bars you will see that the lines become more jagged. You could change the code so that only the most recent/current bar value is plotted which would result in a much more jagged presentation.

          Comment


            #20
            i see - Thank you !

            Comment


              #21
              Any way to remove the redraw code lines?

              Comment


                #22
                For those of you who only want to plot the current values of the Polynomial Channels. There is a new version. I have added a parameter: PlotOnlyCurrentBar. The default setting is false so that this version acts just like the original version. Setting this parameter to True will NOT change/repaint the historical values of the polynomial channels.

                Edit: New version uploaded with some minor code changes.
                Attached Files
                Last edited by scjohn; 04-22-2009, 10:01 AM.

                Comment


                  #23
                  John,

                  Thanks, its working as you said. BUT it is now plotting a total different channel than before. (Not a smooth, parapolic one)

                  Comment


                    #24
                    With parameter: PlotOnlyCurrentBar = True, you are only seeing the the last bar plotted using the current polynomial equation. There is no way you can expect to see a nice smooth line(s) when you are only plotting the last bar of each individual polynomial equation. Each bar, in effect, has it's unique individual polynomial equation and you are only seeing the last bar value of that equation

                    Comment


                      #25
                      Some guys were plotting this twice to get a OB/OS type channel so I modified this to show a channel if you want, fill it if you want and have sound alerts if you want.
                      Attached Files
                      eDanny
                      NinjaTrader Ecosystem Vendor - Integrity Traders

                      Comment


                        #26
                        What are the rules for porting the PRC indicator to c++?

                        I am interested in porting this indicator to the c++ language and then making it available to others.

                        Can you please tell me what rules apply when doing this? Can I do it?

                        Thanks

                        Comment


                          #27
                          ScJohn. Thanks for your post. Any help is great... some day I will be the one helping others... for now, I rely on the kindness of strangers.

                          I have tries using this indicator in an EA but can't figure how. I tried using a simple Rising command for entry and Falling command for exit and possibly a reverse, but it won't compile... How would something like that be coded correctly.... I even tried the Wizard but still can't.....

                          Comment


                            #28
                            Hi Mike,

                            See you got the v2 indicator from this forum member scjohn and posted it on your own website/forum. Why lock these indicators on your site while they are free on this original forum? To get paid members? Think supporting opensource en free downloads is in your favor. Dont get me wrong, your site gets great hits and has tremendous information for traders but people often can't find the free ones on this 'open forum'...

                            Scjohn, thanks for your contribution!! Great tool!

                            Btw, it it possible to leave all lines as they are visible . In other words, not a repaint, but another paint of the lines at every new bar. At positions where it almost does not move afterwards, it will show less lines cause, but where is moved much it will show many lines...
                            Last edited by Creamers; 12-28-2011, 07:36 AM.

                            Comment


                              #29
                              New version

                              For those of you interested in performing a Polynomial Regression a new set of indicators are available.

                              These indicator(s) are intended for intermediate to advanced users.

                              The heart and soul of this new group of indicators is PolyUserDefinedMethods. This indicator contains methods that calculate a RegressPolynomial, EvaluatePolynomial and calculate the Pearson coefficient. The underlying code that supports these calculations are also in this indicator. The underlying code is covered by Microsoft Public License and The Code Project Open License. Details are provided in this indicator.

                              The indicator - PolyTest exercises the methods contained in PolyUserDefinedMethods. This indicator validates that the code will compile with out errors and generates the correct results using a simple example(s) from Microsoft Excel. All output is shown in the NT Output Window using the Ninja Script Print function. After running this indicator, one could delete this indicator.

                              The indicator - PolyInd is real world example for use in NT. This indicator is set up for use on the Price Panel. You can calculate a polynomial of n-degree on the Close, and then plot the forecast x bars into the future using the polynomial that was calculated. The forecast can be drawn as a line (default) or as a diamond(s) in the right margin of the chart. You will need to expand the size of the right margin to be able to see the forecast. The Pearson coefficient along with the forecast values will be displayed in the lower left hand corner of the chart (default on).

                              There is a problem of drawing forecasts into the future when using Bar Types that are variable (Tick, Volume, Range, Renko. etc.). One can not 100% calculate an accurate forecast of future time periods because one does not know the time when the current bar will end. For the current bar, time is always approaching the future bar(s) and can over take the future time(s) in real time. When this happens, one or more of the future forecasts will disappear off the chart. If someone at NT knows how to prevent this, please let me know. Just do not be surprised to forecast disappear from the right margin.

                              Note(s):
                              This is a dynamic indicator, not static. For each new bar a brand new polynomial will be plotted.

                              The zip file - PolyIndicator contains 3 files: PolyTest, PolyInd and PolyUserDefinedMethods.
                              Attached Files

                              Comment


                                #30
                                Can this be used with "non-time" based candlesticks like Renko's?


                                Thanks!

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Kaledus, Today, 01:29 PM
                                3 responses
                                9 views
                                0 likes
                                Last Post NinjaTrader_Jesse  
                                Started by frankthearm, Yesterday, 09:08 AM
                                14 responses
                                47 views
                                0 likes
                                Last Post NinjaTrader_Clayton  
                                Started by gentlebenthebear, Today, 01:30 AM
                                2 responses
                                13 views
                                0 likes
                                Last Post gentlebenthebear  
                                Started by PaulMohn, Today, 12:36 PM
                                2 responses
                                17 views
                                0 likes
                                Last Post PaulMohn  
                                Started by Conceptzx, 10-11-2022, 06:38 AM
                                2 responses
                                56 views
                                0 likes
                                Last Post PhillT
                                by PhillT
                                 
                                Working...
                                X