You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Bump - Regression and deviation - line slope?
...
I assume the slope of the regression line is LinearRegSlope.
Is there an indicator buffer available to expose the slope of the regression line or are they all consumed?
The regression line slope would be nice to know as it can be used (1) to indicate direction resulting from regression as opposed to moving average, (2) compare against a preset to aid in a decision to take a trade if Price Action has made it to the n-standard deviation, (3) signal a reversal breakout if PA moves back across the line and so forth.
...This is a bump of the previous message.
Two things:
(1) Could you take away the 3rd channel and free up a buffer to expose the slope? or add a switch that does this?
(2) While I was trying to accomplish this, I noticed...
double value = iLRValue(slope,LR.length,i);
double std.dev = 0;
for(int k=0; k<LR.length; k++)
{
double diff = prices-(value-k*slope);It looks like slope is declared, passed as a parameter and then used in a calculation without an assignment - is this correct?
Thanks,
Adeo
Adeo
Just the part about the slope now :
The slope parameter is passed by reference. In the declaration of the function the "&" before LinearRegSlopeparameter means that it is receiving a reference to a parameter, and referenced parameters are accessible from the function itself and can be changed (assigned values that will be "seen" from the calling code). In the iLRValue function slope is calculated as one of the steps of calculating linear regression value, so this manner simply saves calculation time, since the slope parameter is assigned value in the function and after that the function returns the value of the linear regression value. Otherwise it would take 2 functions or 2 function calls with basically same calculationSo don't worry, it is not a mistake, just a little "dirty trick" If you remove the "&" from function declaration then the slope would be a constant 0 all the time and then it would be a mistake.
regards
Mladen
This is a bump of the previous message.
Two things:
(1) Could you take away the 3rd channel and free up a buffer to expose the slope? or add a switch that does this?
(2) While I was trying to accomplish this, I noticed...
[php] double slope;
double value = iLRValue(slope,LR.length,i);
double std.dev = 0;
for(int k=0; k<LR.length; k++)
{
double diff = prices-(value-k*slope);It looks like slope is declared, passed as a parameter and then used in a calculation without an assignment - is this correct?
Thanks,
Adeo...So don't worry, it is not a mistake, just a little "dirty trick" If you remove the "&" from function declaration then the slope would be a constant 0 all the time and then it would be a mistake.
regards
MladenGot it; thanks for the coding lesson.
I deleted the 3rd channel stuff and re-purposed one buffer and tried...
high.1.Buffer = mean.Buffer+(std.channel.1*std.dev);
low.1.Buffer = mean.Buffer-(std.channel.1*std.dev);
high.2.Buffer = mean.Buffer+(std.channel.2*std.dev);
low.2.Buffer = mean.Buffer-(std.channel.2*std.dev);
slope.Buffer = slope;
There were no errors, but nothing displayed either - so, it was based on this that I thought perhaps there was a 0 or null value for slope.
I look forward to seeing how it should really be done...
And the second part
Slope line added and removed the 2 outer regression lines regardsMladen
Adeo
Slope line is calculated as a current linear regression value - slope*count for count = 0 to Linear regression length (it is a difference per bar (not even an angle as some think)) So slope is a small value that did not show on your chart (or better told, it did but it was somewhere around 0 and it was not visible at a normally scaled chart)
Already posted it in the previous post, but made one change in it in the mean time : in the mtf mode there was an unpleasant "down line" at the starting point of the slope line - it is corrected now
regards
Mladen
Adeo
...Already posted it in the previous post, but made one change in it in the mean time : in the mtf mode there was an unpleasant "down line" at the starting point of the slope line - it is corrected now
regards
MladenYowsah! A double, grand slam - slope and mtf! Thanks!
'tis always nice when you know what you're doing.
biddick
Here you go In this one the linear regression value itself is left out (thought that it would be "more readable" this way)
regardsMladen
Mladen, Is it possible for you to code CFP indicator with regression lines since CFP indicator has some interesting features compare to raw price https://www.mql5.com/en/forum/179807/page19 ? Many thanks.
Continuation of the Elliot oscillator - waves indicator
______________________
What has been done : ______________________ Also, as a note : only the last leg of the wave can change if new high or new low is reached. Once it is "opened" it can not (and I repeat) it can not disappear (like in some zigzags or some peak finding indicators), it can only go higher or lower if the price moves in the right direction. Its starting point is always going to stay fixed. So in combination with the oscillator itself I think it can be a useful toolMladen ,
I have found similar work in mql codebase, It may give you additional ideas MACD с адаптивным определением ценовых экстремумов. - MQL4 Code Base , the problem is it is in Russian(google translation is bad) and Macd extreme indicator doesnt show any extreme levels(standart deviation or ATR ) at all.Can you have a look please? Regards.
Thank you for debugging my head Mladen.