Requests & Ideas - page 52

 

sweet spot mod

Hello guys,

should be possible for somebody of you guys, to code a variation of the classical "sweet spot" indicator to mark the 00 and 50 levels on the chart using colored rectangles instead of lines?

So to have a sort of background on the chart without lines that can clutter the view.

Looks at the picture to have an idea how it should looks like...

The indi should have the following options (aka external input...):

rectangles' color;

to write or not value labels with optional colors and the possibility to set their position;

to plot on the chart 500/600pips above and below current price;

audio and pop up alert (up/down) when price break trough the levels, but only at candle close otherwise when the price is struggling around the levels it will "rings the bell" continuously.

Thanks in advance!!!

brax64

Files:
sweet_spot.gif  38 kb
 

Hi Mladen/ MrTools,

please don't forget this, I'm really interested in how you code it:

can you make a version of the JMA that I can place on other indicators by simply modifying an iCustom function inside its code? So in the code fill in i.e. externIndiBuffer=iCustom(0,0,"",..,0,i); where I can plug in whatever indicator I have and then this would display the JMA-smoothed version of the indicator. (with JMA length & phase still external variables).
 

Well

These are what Odysseus and me were cooking

According to Dennis Meyers description (Posted by Odysseus at this post : https://www.mql5.com/en/forum/179807/page34 ) of Repeated median calculation made 2 new indicators : Repeated median slope (which would correspond to Meyers' velocity indicator, but I preferred the slope n the name since it tells more exactly what it actually is), and a Repeated median line

Will describe them in reverse order (the slope is the basis for both, but I think better to describe the line first

__________________________

The Repeated median line can be treated as an alternative to Linear regression line (and Meyers is showing a comparison of the 2 in the document that can be downloaded from Odysseus' post) The repeated median line should be less sensitive to "bad data" and hence should reflect the price better. Here is a comparison of linear regression line (dotted lines) and Repeated median line (violet line)
There is a rather good description of why the difference happen and what is "omitted" (the so called "bad data") when applying repeated median calculation. What is added is one option that Dennis Meyers did not talk about : when drawing the line he uses current price as the starting point. I felt that it is misleading in some cases and decided to add an option which allows you to "anchor" the beginning of the line somewhere else. That way you can get something like this and that way the line is not moving with the current price as it changes but is anchored to a price that was valid on the "anchor" bar (so it is fixed until a new bar is opened)

__________________________

Repeated median slope can be treated as an equivalent for linear regression slope but you will find out that it is a "beast of it's own". Here is an example of a 20 bar repeated median slope on a 1 hour chart
Dennis Meyers describes a system where he uses the slope values from 0.02 to 0.4 and -0.2 to -0.4 as entries : that system can work only on some symbols (JPY crosses mostly) since the slope values for other symbols are much smaller so I think that the entries should be cheeked for around 0 value, but the system description is showing us something else to : we should treat each and every symbol as a "separate story" and no general rule should be applied to any system

__________________________

What is still pending (will be finished very soon) : right now I am making a dll for the slope version. If you use large Length in slope calculation you will find out that it is a rather slow calculation for large values and that will be corrected by dll, but did not want to make some "secrets" so the mql code shows exactly what is done and how the calculation is done

 

MrM

Here you go Depending on what you want to do you have to change 1 or 2 lines. If you want it on a main chart, you have to change only the line that receives the value to smooth from Ima(...) to whatever you want. If you want to smooth an indicator that goes into separate window you have to change the line where it is saying #property indicator_chart_window to #property indicator_separate_window

Commented out in those lines what is to be done.That is all

regards

Mladen

MrM:
Hi Mladen/ MrTools, please don't forget this, I'm really interested in how you code it:
Files:
 
mladen:
Here you go

I know what you think of JMA but thanks anyway

update: now I see why: it jumps and updates a whole bunch of values in the past. (reminds me of that eptf HMA Hodrick-Prescott version you made: that also updated more values than it logically speaking should: further back than FiltPer/2). I can assure you that the original Tradestation version does not do this!

 

WOW - JUST WOW!

Thanks Mladen, awaiting the DLL slope version...

Odysseus

mladen:
Well

These are what Odysseus and me were cooking

According to Dennis Meyers description (Posted by Odysseus at this post : https://www.mql5.com/en/forum/179807/page34 ) of Repeated median calculation made 2 new indicators : Repeated median slope (which would correspond to Meyers' velocity indicator, but I preferred the slope n the name since it tells more exactly what it actually is), and a Repeated median line

Will describe them in reverse order (the slope is the basis for both, but I think better to describe the line first

__________________________

The Repeated median line can be treated as an alternative to Linear regression line (and Meyers is showing a comparison of the 2 in the document that can be downloaded from Odysseus' post) The repeated median line should be less sensitive to "bad data" and hence should reflect the price better. Here is a comparison of linear regression line (dotted lines) and Repeated median line (violet line)
There is a rather good description of why the difference happen and what is "omitted" (the so called "bad data") when applying repeated median calculation. What is added is one option that Dennis Meyers did not talk about : when drawing the line he uses current price as the starting point. I felt that it is misleading in some cases and decided to add an option which allows you to "anchor" the beginning of the line somewhere else. That way you can get something like this and that way the line is not moving with the current price as it changes but is anchored to a price that was valid on the "anchor" bar (so it is fixed until a new bar is opened)

__________________________

Repeated median slope can be treated as an equivalent for linear regression slope but you will find out that it is a "beast of it's own". Here is an example of a 20 bar repeated median slope on a 1 hour chart
Dennis Meyers describes a system where he uses the slope values from 0.02 to 0.4 and -0.2 to -0.4 as entries : that system can work only on some symbols (JPY crosses mostly) since the slope values for other symbols are much smaller so I think that the entries should be cheeked for around 0 value, but the system description is showing us something else to : we should treat each and every symbol as a "separate story" and no general rule should be applied to any system

__________________________

What is still pending (will be finished very soon) : right now I am making a dll for the slope version. If you use large Length in slope calculation you will find out that it is a rather slow calculation for large values and that will be corrected by dll, but did not want to make some "secrets" so the mql code shows exactly what is done and how the calculation is done
 

customizable FIR on iCustom pls

Mladen,

Instead of the JMA, maybe it's better to try it with this one: it's a customizable FIR filter. With some DSP-software I'll be able to tune the MA's better to each specific oscillator. I'm being lazy now but could you do the same for the filter: enable it to be put on any iCustom that you fill in in the code? Thank you.

 

This is an update of the Repeated median line indicator

_______________________

I really was unsatisfied with the way how the line starting point (or ending point, depends on how you look on it - coding wise or user wise) was determined in the previous version and, after some digging, found a formula how an intercept for Repeated median is calculated. So this one is using that correct intercept calculation and now it is really highly comparable to Linear regression line (and channel) with the ability of repeated median calculation to resist to "bad points" still intact

This one does not depend so much on the power of the CPU and it does not need the dll (calculation is done only for one point actually and it makes it a light weight compared to the slope indicator) so posting it in mql form since it really is usable now. Left the anchor possibility but you can freely use 0-th bar now since it will not jump around like a goat

Here is one example on an 1 hour chart
 

Mladen ,

Can you adjust :

1- Starting date to the median line ?

2-Slope info like you did with the auto channel in the elite section?

Many thanks.

 

biddick

Here is the one with slope information (added some other options so now you can have multiple indicators showing info for every instance - something like on the picture) Will make a version which will be able to anchor to a specific time later (I would like to finish some other steps in the Repeated median before it)

regards

Mladen

biddick:
Mladen ,

Can you adjust :

1- Starting date to the median line ?

2-Slope info like you did with the auto channel in the elite section?

Many thanks.
Reason: