Requests & Ideas - page 103

Abdalla Doleh
1349
Abdalla Doleh  
mladen:
Like this

PS: if you use plot point routine for nrp plotting than you need to add 2 more buffers for each new color, and that is what makes it a bit incomprehensible. Also, the logic of when to draw colors needs to be changed a bit. In this one 3rd color appears on a first bar with different slope (it is technically not a peak, because for strict peaks it would need to color one more bar before it and in 99.99% cases peak would be between those 2 bars, but it is a first bar following the peak). I think it gives the information you are looking for now

regards

Mladen

Mladen,

Thank you for the quick response. Your depiction is close but not quite what I had in mind. I have drawn a picture to give you an idea of what i mean.

The colors provide visual indication of the different phases of the cycle momentum. Particularly useful when using MTF feature on smaller TF where the higher TF cycle is out of frame.

Alternatively, if you are able to plot the cycle in some type of color gradient, that would be even better.

The percentile used to limit the extent of color change (or number of bars before and after flat slope) on tops and bottoms can be an external variable to test for optimum figure.

Note: ignore the gaps between colors, its an artifact while creating wave with different color.

Note 2: i understand that the terminology wave termination and wave initiation do not exactly match the color scheme I am requesting since the entire wave spans top to top or bottom to bottom, but for practicality purpose I am referring to the half cycle as a wave in relation to the direction of the move.

Thanks again for your effort.

Cheers,

Pip

Files:
Mladen Rakic
163390
Mladen Rakic  

Here you go (there are 4 colors on those lines now)

PS: turning into gradient color would require making this an "all objects" indicator, and I really think that it would not be too much use of a "bufferless" indicator

regards

Mladen

Pip:
Mladen,

Thank you for the quick response. Your depiction is close but not quite what I had in mind. I have drawn a picture to give you an idea of what i mean.

The colors provide visual indication of the different phases of the cycle momentum. Particularly useful when using MTF feature on smaller TF where the higher TF cycle is out of frame.

Alternatively, if you are able to plot the cycle in some type of color gradient, that would be even better.

The percentile used to limit the extent of color change (or number of bars before and after flat slope) on tops and bottoms can be an external variable to test for optimum figure.

Note: ignore the gaps between colors, its an artifact while creating wave with different color.

Note 2: i understand that the terminology wave termination and wave initiation do not exactly match the color scheme I am requesting since the entire wave spans top to top or bottom to bottom, but for practicality purpose I am referring to the half cycle as a wave in relation to the direction of the move.

Thanks again for your effort.

Cheers,

Pip
Abdalla Doleh
1349
Abdalla Doleh  
mladen:
Here you go (there are 4 colors on those lines now)

PS: turning into gradient color would require making this an "all objects" indicator, and I really think that it would not be too much use of a "bufferless" indicator

regards

Mladen

Awesome!

Haven't studied at the code in details yet but if I wanted the colored area (yellow and green) to span more bars, is that possible? And if so, which variable do I need to tweak?

Is this the line of code i need to tweak?

drawDot(Time,Time,goertzel,goertzel,PeakEntryColor,PeakLinesWidth);

drawDot(Time,Time,goertzel,goertzel,PeakExitColor ,PeakLinesWidth);

Cheers,

Pip

brax64
158
brax64  

Hi Flytox,

I did what you asked for, now it's possible to choose in which window you want the info panel and with the parameters Pan_X and Pan_Y you can pinpoint the position.

In the meantime, I've add also the possibility to calculate retracement and extension, for that now is version 6.5

This thing is going to be really addictive ...

Please read the instruction in the code and let me know if it match your expectation.

Best Regards

Flytox:
Thank you very much for this smart piece. I was wondering if there is anyway to change the position of the box, like corner left right etc..
Abdalla Doleh
1349
Abdalla Doleh  
mladen:
Here you go (there are 4 colors on those lines now)

PS: turning into gradient color would require making this an "all objects" indicator, and I really think that it would not be too much use of a "bufferless" indicator

regards

Mladen

Hello again MLaden,

Now that I had a chance to review the code in a bit more details. I would like to ask the significance of using Objects instead of two line buffers to draw the top and bottom line color change.

Thanks,

Pip

Mladen Rakic
163390
Mladen Rakic  

In order to draw lines in a non repainting mode (to make sure that under no circumstance there will be no repainting (in this case repainting as in making some 1 bar changes invisible)) we need 2 buffers per color (except for the 1st one - so for 4 colors 7 drawing buffers must be used) As you can see from the code there is already 6 buffers used which would mean that we are 2 buffers short for additional 2 colors.

Sure that there are some other ways, but they are not making sure that some errors in drawing can not happen. And that is why I used objects instead of buffers. They are simulating what metatrader line drawing engine does all the time : it interpolates 2 points with a straight line, and that is exactly what objects used in this indicator do now

To conclude : it was a necessity. I would like that metatrader has something like SetPlotColor() or plot() in tradestation where there is limitless number of colors choice, but not even metatrader5 can do that (64 colors only even there) so all I am left is to nag and do this as objects

Pip:
Hello again MLaden,

Now that I had a chance to review the code in a bit more details. I would like to ask the significance of using Objects instead of two line buffers to draw the top and bottom line color change.

Thanks,

Pip
Abdalla Doleh
1349
Abdalla Doleh  
mladen:
In order to draw lines in a non repainting mode (to make sure that under no circumstance there will be no repainting (in this case repainting as in making some 1 bar changes invisible)) we need 2 buffers per color (except for the 1st one - so for 4 colors 7 drawing buffers must be used) As you can see from the code there is already 6 buffers used which would mean that we are 2 buffers short for additional 2 colors.

Sure that there are some other ways, but they are not making sure that some errors in drawing can not happen. And that is why I used objects instead of buffers. They are simulating what metatrader line drawing engine does all the time : it interpolates 2 points with a straight line, and that is exactly what objects used in this indicator do now

To conclude : it was a necessity. I would like that metatrader has something like SetPlotColor() or plot() in tradestation where there is limitless number of colors choice, but not even metatrader5 can do that (64 colors only even there) so all I am left is to nag and do this as objects

Mladen,

Thank you for the detailed response. Based on your feedback, I attempted to expand the drawdot function to include more bars than just two. The aim is is cover more of the top and the bottom of the cycle with the color. Unfortunately however, when I do that the dots are drawn as straight lines instead of curved lines to cover the curvature of the wave. I realize this is due to the span of the connected dots (more than one bar apart). How can I add more points to make the objects more or less curved looking?

Code change:

drawDot(Time,Time,goertzel,goertzel,PeakEntryColor,PeakLinesWidth);

drawDot(Time,Time,goertzel,goertzel,PeakExitColor ,PeakLinesWidth);

And this is what it looks like

Also, as you can see, the most recent peak is not ploting the color changes as required.

Thanks,

Pip

Files:
Mladen Rakic
163390
Mladen Rakic  

Pip

Here you go Added "PeakSpan" parameter which allows you to have more than one bar colored around the peak

As of that peak on your picture : it is not a peak yet. It is going to become a peak when an opposite direction slope happens for the first time (without opposite direction slope it is still just a clear slope, regardless of its phase (for non-composite value) or apparent phase (of composite value))

PS: it does not check for overlap, so too long span can cause overlapped (single) color

regards

Mladen

Pip:
Mladen,

Thank you for the detailed response. Based on your feedback, I attempted to expand the drawdot function to include more bars than just two. The aim is is cover more of the top and the bottom of the cycle with the color. Unfortunately however, when I do that the dots are drawn as straight lines instead of curved lines to cover the curvature of the wave. I realize this is due to the span of the connected dots (more than one bar apart). How can I add more points to make the objects more or less curved looking?

Code change:

drawDot(Time,Time,goertzel,goertzel,PeakEntryColor,PeakLinesWidth);

drawDot(Time,Time,goertzel,goertzel,PeakExitColor ,PeakLinesWidth);

And this is what it looks like

Also, as you can see, the most recent peak is not ploting the color changes as required.

Thanks,

Pip
Abdalla Doleh
1349
Abdalla Doleh  
mladen:
Pip

Here you go

Added "PeakSpan" parameter which allows you to have more than one bar colored around the peak

As of that peak on your picture : it is not a peak yet. It is going to become a peak when an opposite direction slope happens for the first time (without opposite direction slope it is still just a clear slope, regardless of its phase (for non-composite value) or apparent phase (of composite value))

PS: it does not check for overlap, so too long span can cause overlapped (single) color

regards

Mladen

Thanks Mladen, very close to what I am looking for. The only thing that is not as expected is the timing for color plot. From what I understand, the indicator as is would wait for a peak to have occurred for the color change to plot but that is defeating the purpose because the information would be too late (from a coloring prospective for advance warning). My question is this, since the amplitude of the cycle is known or the combined amplitude is known from goertzel[] and goertzelfuture[] is not possible to put that in consideration to create a logic that looks for the next peak or trough and calculate current position in relation to that peak or trough? I believe by doing so the color change would happen in real time. Please let me know your thoughts.

Cheers,

Pip

caprica
17
caprica  
mladen:
Caprica

Here you go

It is a standalone indicator now (no need for any external indicator) Made some minor changes too (coloring of past bars in multi color mode) and parameters are a bit different for Hodrick Prescott filter : in version 5.4 they were set to 34,69 while I used the 10,50 (simba original default values for those parameters) for default values, so if you are looking for version 5.4 values then set those parameters accordingly (and set the UseSquareAmpsto true) Then they will have exactly the same values


PS: you should check one more thing (for previous version) : maximal number of bars displayed on chart. If it is a big number set it to 5000 bars (it is quite enough for normal usage in trading - I use only 5000 bars all the time and I am not having any problems at all) The thing with Hodrick Prescott filter is that if it is called with default parameters for number of bars it will calculate all the bars all the time (it has to) and it will do that on all new ticks. So if you have a big number of bars on chart, it will be rather slow (this one will be faster but only because in this one I prevented default all bars calculation). So check the previous version with 5000 bars as a maximal number of bars in chart - I think that even that should not have problems then

regards

Mladen

Hi Mladen and Pip

Can I ask what your recommended settings are for maxper? the more I play around with this setting the more I get concerned about the ability for this indicator to find meaningful cycles.

thanks, Caprica