Useful features from KimIV - page 40

 
OZ0 писал (а) >>

How do you draw a vertical dotted line as a background at all such points?

Not at all of them... no need for that :-) ... but in the last 9, no problem:

for (int n, i=1; i<10; i++) {
  n=GetExtremumZZBar(NULL, 0, i);
  SetVLine(Magenta, "vLine"+i, Time[n], 2);
}

 
KimIV писал (а) >>

In all of them we won't... There's no point :-) ... but in the last 9, no problem:

Great!!! and the last 2 functions, but not by zigzag, but by two adjacent fractals? i.e. 2 horizontal and two vertical lines with point coordinates and that the first line coordinates in bars could be limited to 40 bars for example. Are you not offended that I am straining?

 
OZ0 писал (а) >>

but for two neighbouring fractals? i.e. 2 horizontal lines and two vertical lines with point coordinates and so that the first line coordinates in bars could be limited to, say, 40 bars.

For horizontal lines here:

double up=FindNearFractal(NULL, 0, MODE_UPPER);
double dn=FindNearFractal(NULL, 0, MODE_LOWER);
SetHLine(Blue, "HLine1", up, 2);
SetHLine(Red , "HLine2", dn, 2);

And for the vertical lines, I need fractal bar numbers. I do not have such function yet. Write it yourself like GetExtremumZZBar().

 

Many thanks to KimIV !!!! So many useful functions!!!

And to the point: Is it possible to make a function that determines the point-projection of the zero bar on the trend line plotted on the last 2 bottom/upper breaks of the ZigZaga ? (trend lines are yellow in the picture)

 
Tsyrus писал (а) >>
Is it possible to make a function that determines the point-projection of the zero bar on the trend line plotted against the last 2 bottom/upper ZigZaga breaks ?
>> It is possible...
 
KimIV писал (а) >>
you can...
I mean help :)
 

Hello KimIV.

Do you have a function similar to the "Frequency" function in Excel? Or something like that, only the distribution function can be obtained by Bulashev (in terms of elimination of anomalous outliers, selection of optimal number of intervals...). Practical goal is to superimpose 2 functions of probability distribution of parameters of event A and sob. B, not only the probabilities are important, but also the intervals into which the series is divided, these probabilities... Do you have something similar?

 
Tsyrus писал (а) >>
I mean help :)

ah... there you go:

double p, p1=0, p2=0;
int    b1, b2, i=1;

p=GetExtremumZZPrice(NULL, 0, i);
if (p>Bid) {
  p1=p;
  b1=GetExtremumZZBar(NULL, 0, i);
  i+=2;
  p2=GetExtremumZZPrice(NULL, 0, i);
  b2=GetExtremumZZBar(NULL, 0, i);
} else {
  i++;
  b1=GetExtremumZZBar(NULL, 0, i);
  p1=GetExtremumZZPrice(NULL, 0, i);
  i+=2;
  b2=GetExtremumZZBar(NULL, 0, i);
  p2=GetExtremumZZPrice(NULL, 0, i);
}

if (b1>0 && b2>0 && p1>0 && p2>0) {
  SetTLine(Gold, "TLine", Time[b2], p2, Time[b1], p1, True);
  SetVLine(Red, "VLine", Time[0]);
  p=EquationDirect(b2, p2, b1, p1, 0);
  SetArrow(6, DarkViolet, "Arrow", Time[0], p, 2);
} else Message("Не удалось определить экстремумы ZigZag'a!");

I did this for the upper extrema.

For the lower ones, try it yourself by analogy.

ZS. Attached is a script with all the necessary functions.

Files:
test.mq4  12 kb
 
StatBars писал (а) >>
Don't you have function similar to "Frequency" function in Excel? Or something like that, but the distribution function can be obtained by Bulashev (in terms of elimination of anomalous outliers, selection of optimal number of intervals...). Practical goal is to superimpose 2 functions of probability distribution of parameters of event A and sob. B, not only the probabilities are important, but also the intervals into which the series is divided, these probabilities... Do you have something similar?

nope

 
StatBars писал (а) >>

Hello KimIV.

Do you have a function similar to the "Frequency" function in Excel? Or something like that, only the distribution function can be obtained by Bulashev (in terms of elimination of anomalous outliers, selection of optimal number of intervals...). Practical goal is to superimpose 2 functions of probability distribution of parameters of event A and sob. B, not only the probabilities are important, but also the intervals into which the series is divided, these probabilities... Do you have something similar?

The optimal (recommended) number of intervals can be determined from the formula 1+1.41*ln(n) - where n is the size of the array. Exclude abnormal - sort the array and exclude the N maximum and minimum values, there is no recommendation here anymore it is up to the researcher's choice.

I can talk to you on Skype, so as not to litter the thread. There is no ready-made program in MQL, most likely there are analogues of what you need in Matcad.