Useful features from KimIV - page 41

 
KimIV писал (а) >>

ah... there you go:

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.

Thank you so much! It would have taken me a week to do it myself...!!!

P.S. ...if there's a bust in my lifetime, I'll be the first!

 
KimIV писал (а) >>

For horizontal lines, here:

And for vertical lines, you need fractal bar numbers. I don't have such a function yet. Write it yourself, by analogy with GetExtremumZZBar().

and I mean can I get some help?

 
OZ0 писал (а) >>

and I mean can I get some help?

>> you can...

//+----------------------------------------------------------------------------+
//|  Автор    : Ким Игорь В. aka KimIV,  http://www.kimiv.ru                   |
//+----------------------------------------------------------------------------+
//|  Версия   : 13.08.2008                                                     |
//|  Описание : Возвращает номер бара фрактала по его номеру.                  |
//+----------------------------------------------------------------------------+
//|  Параметры:                                                                |
//|    sy - наименование инструмента        ("" или NULL - текущий символ)     |
//|    tf - таймфрейм                       (    0       - текущий ТФ)         |
//|    nf - номер фрактала                  (    0       - последний)          |
//+----------------------------------------------------------------------------+
int GetFractalBar(string sy="0", int tf=0, int nf=0) {
  if (sy=="" || sy=="0") sy=Symbol();
  double f=0;
  int    i, k=iBars(sy, tf), kf;

  for (i=2; i<k; i++) {
    f=iFractals(sy, tf, MODE_LOWER, i);
    if (f!=0) {
      kf++;
      if (kf>nf) return(i);
    }
    f=iFractals(sy, tf, MODE_UPPER, i);
    if (f!=0) {
      kf++;
      if (kf>nf) return(i);
    }
  }
  Print("GetFractalBar(): Фрактал не найден");
  return(-1);
}
I wouldn't mind if, as a thank you, you could prepare a description of this function in the next post and come up with some examples of how to use it.
 
KimIV писал (а) >>

can...

I wouldn't mind if, as a thank you, you could prepare a description of this function in the next post and come up with examples of how to use it.

>> Thank you very much. I'll try it out now and think about how to describe it intelligently.

 

KimIV
wrote (a) >>

ah... there you go:

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.

Dear KimIV !!!

I tried your script, it seems there are some bugs...

1. At first I tried scripts just laying them on a chart, sometimes trend lines were not drawn following extrema... At first I thought there was a problem with the terminal... Then I drew an expert - trend lines were drawn following each new bar - the same thing happened, it often drew the trend line not following extrema.

COULD YOU PLEASE HELP!

Picture 1 is a script, the rest are Expert Advisors.

 
Tsyrus писал (а) >>
1. at first I tried scripts simply overlaying them on a chart, sometimes trend is not drawn at extremums - I thought at first that the problem was in the terminal...

Here are my drawings:

 
KimIV писал (а) >>

Here are my drawings:

That's what I thought too, now on m5 try the script on the eve ! Bug on the face !!! or my advisor on m15

>> please.

Files:
porkurg1.ex4  37 kb
 
Tsyrus писал (а) >>

That's what I thought too, now on M5 try the script on the eve ! Bug on the face !!! or my EA on m15

...please.

here's an EA...

Files:
porkurn1.mq4  70 kb
 

The thing is, this bug doesn't last long and it needs to be "caught" and the examiner is showing on its face!!!

Please help!

 
Tsyrus писал (а) >>

here's the advisor...

there is a typo on line 554. The variables p and pn.

Here are pictures of your EA after correcting the typo:

Reason: