6th Degree Poly Help! - page 4

 
dennisj2:


Gooly, took me awhile but, you are spot on! Coefficient a from the above example is the Y-intercept defined as "the value of y when x = 0" or the coordinate (0,a). Further, the quadratic (2nd degree) form you suggest does create a "cup" aka a parabola which doesn't have much practical application other then  to solve the binomial question "up" or "down".

1) The cup is a well defined chart pattern: http://stockcharts.com/school/doku.php?id=chart_school:chart_analysis:chart_patterns:cup_with_handle_continuation
2) the 2nd derivation (y") gives you the information whether a trend fades (up: y'>0 & y"<0) out or strengthens (up: y'>0 & y">0)
 
gooly:
1) The cup is a well defined chart pattern: http://stockcharts.com/school/doku.php?id=chart_school:chart_analysis:chart_patterns:cup_with_handle_continuation
2) the 2nd derivation (y") gives you the information whether a trend fades (up: y'>0 & y"<0) out or strengthens (up: y'>0 & y">0)

Interesting read! Thanks!
 
graziani:


Yes it uses Gauss-Jordan, but it is completely irrelevant which method is used, as all of them (Gauss-Jordan, least squares, Gram-Schmidt or perhaps some other?) offer unique solutions. You can verify this through attached file, the results are printed in expert tab, and the input from your excel is hard coded in source.

However what is to be examined is how other factors affect the curve: applied price,  x-axis starting point, x-axis growth, number of points, TF etc.

And your way of using P6 is definitively innovative in a positive way, and in agreement with my critics of the standard approaches. 


Grazi -

Amazing! That nailed it - I noticed you put some changes into the code (not sure to what extent) - these were not the results I got from the original source. I guess I I'll call this the Graziani-Gauss-Jordan indicator? I can't believe how close the coefficients are! Thanks for all those that contributed - I will certainly keep you all in mind after I've modified my EA to incorporate the changes! For those interested, I've attached an updated sheet. Now, back to work.

Grazi-Gauss

Files:
linest2.zip  18 kb
 
graziani:


Yes it uses Gauss-Jordan, but it is completely irrelevant which method is used, as all of them (Gauss-Jordan, least squares, Gram-Schmidt or perhaps some other?) offer unique solutions. You can verify this through attached file, the results are printed in expert tab, and the input from your excel is hard coded in source.

However what is to be examined is how other factors affect the curve: applied price,  x-axis starting point, x-axis growth, number of points, TF etc.

And your way of using P6 is definitively innovative in a positive way, and in agreement with my critics of the standard approaches. 


I tested the indicator you attached, it draws a single vertical line...
 

point was to show to Dennis that this indicator will calculate same values as LIVEST function, so this indicator takes inputs from his table (table is hardcoded in source) and calculates the same polynomial coefficients as LIVEST in Dennis's example, and prints them out in expert tab.

You should have read what i wrote before testing :P 

it is just slightly changed i-reg.mq4 to allow for variable x-axis beginning point. 

 

Oh I see, maybe I should have read the rest of what you wrote before I downloaded it :)

I downloaded the code base version it really is a very nice curve. I wish I understood the math behind it though.

I haven't monitored it to see how it behaves but, I have my doubts already, it looks to me as though the more recent bars carry more weight and as the entire line is redrawn every tick its apparent curve history could be entirely false, I'm going to recode it as a standard indicator to draw only the bar zero value each time so we can see what it would really do.

 

OK, lets push this a little further.

I will try to get the maximum out of this with goal of cooperating with other users who are coders, programmers or mathematicians.
You can try out anything, you are only obliged to present results and method.

For start, the code base version of i-regr will be used. It works good, later it will be expanded to allow fine tuning of all relevant parameters. Warning: 8 is the largest polynomial degree.

This will be a trend catching advisor. Curve fitting will be avoided by adjusting all components to minimal drawdown, as this parameter shows for 'natural adjustment' as opposed to best fit.

So here are the first results, optimization on EURUSD, H1 on 2014, degree vs. pattern length:

V1.2

 Results clearly show that i-regr offers prediction capability on all polynomial degrees when adjusted for proper pattern length (number of bars).

 Entry criteria is direction of regression curve.

Files:
regr.zip  13 kb
 

Grazi - what does the pic above show? Degrees on the bottom, bars on the y-axis(?) -

This poly6 indicator is gorgeous! I finalized the indicator and am now integrating it with my triggers - poly6 is giving me a 4-5 period >hint< on trend changes - truly amazing.

Poly6

 
dennisj2:

Grazi - what does the pic above show? Degrees on the bottom, bars on the y-axis(?) -

yes, degree vs. pattern length

 

This poly6 indicator is gorgeous! I finalized the indicator and am now integrating it with my triggers - poly6 is giving me a 4-5 period >hint< on trend changes - truly amazing.

i wish i could share your optimism, but i got nothing... it didn't mix well with other inidicators i tried out, on short period it would even be OK, but long periods - nothing. OK, i always get it to have profit, but inconsistent...

i guess i could get something with averaging, but i got no time for experiments now.... 

 
graziani:

yes, degree vs. pattern length

 

i wish i could share your optimism, but i got nothing... it didn't mix well with other inidicators i tried out, on short period it would even be OK, but long periods - nothing. OK, i always get it to have profit, but inconsistent...

i guess i could get something with averaging, but i got no time for experiments now.... 

 


Grazi -

Thanks to you, I've got this nailed. The first iteration of the poly6 EA should be ready to go live for Sunday's open. Plan is to open it up on the EURUSD pair, although, there probably won't be much action until we get some degree of a correction - I'm pretty conservative and don't like adding positions after a major slide or rally. But, who knows? The EA will decide. And, I use real money on a live account. I hate when an EA performs well in the backtester, then performs well in a live demo, then fails miserably in real life.

My testing methodology has always been to thoroughly execute as many backtests as it takes until I am confident. Then, I run both a demo and a live account side-by-side and compare the results. As soon as I am ready with backtest results, I'll post them here -  if you are interested - I'll keep you posted every step of the go live. And, if any one else is interested, I'll post the read only password to the demo account here (is this allowed?).  I expect the first week to be slow - the EA collects a lot of data before actively engaging the market - however, once the initial data collection is complete - it actively trades and will almost always have open positions based on the overall trend.

My EA now does a meager 5% a week. In the event I take a loss, I successfully dollar-cost-average out around 80% of the time. With this new enhancement, I am expecting at least 12-15% per week, if not more.

Remember, the poly6 is not an entry/exit indicator - but a trend analyzer; I use Fibonacci and pattern recognition off of the poly6 to determine the strength of the trend and a completely separate trigger for entry/exits. This outlines the issue with my prior attempts - using an MA whether smoothed, logarithmic, exponential - gave too many directional changes. Poly6 smooths this data out and removes the noise. Put simply, the MAs have now been degaussed - (grazi-gaussed!).

This is going to be hoot!

Reason: