Useful features from KimIV - page 39

 

Holy crap... give me two...

 
KimIV писал (а) >>

Thanks for the reply, it is very interesting if it is possible to calculate the angle of intersection of two iMAs (moving average) ? And even more interesting how to do it, since the angles are not straight? The obtained values may be useful for many Expert Advisors. >> Help please.

 
AlexDub писал (а) >>

very interesting is it possible to calculate the angle of intersection of two iMAs (moving average) ?

it is possible...

AlexDub wrote (a) >>
And even more interesting how to do it, because the angles are not straight?

1. Draw tangents to both iMAs.

2. Calculate the value of the angle between them.

 
KimIV писал (а) >>

maybe...

1. Draw tangents to the two scales.

2. Calculate the value of the angle between the tangents.

Let's say I can calculate the angle, but how to draw the tangents, I need a code:)
 
AlexDub писал (а) >>
need code:)

write... Then you can post it here, if you don't feel bad about it :)

 
Dear Igor!
I am trying your Expert Advisor e-TFL_v2, it runs and writes a message that upper and lower price levels are undefined, please advise what I am doing wrong or I need to configure something else. Thanks in advance for the answer!
 
Starik писал (а) >>
I don't know what upper and lower price levels are, can you please tell me what I'm doing wrong or should I tweak something else?

The lines you put on the chart must be given the "correct" names, which must match the names in the NameUpLine and NameDnLine parameters of the EA.

 

GetExtremumZZZPrice() function.

This function searches for an extremum of the standard custom ZigZag indicator and returns its price level. The function accepts the following optional parameters:

  • sy - Name of the instrument. "" or NULL - current symbol. Default value is NULL.
  • tf - Timeframe. Default value 0 - current symbol.
  • ne - Extreme number. 0 - last, 1 - previous, 2 - previous, etc.
  • dp, dv, bs - ZigZaga parameters: ExtDepth, ExtDeviation, ExtBackstep.
//+----------------------------------------------------------------------------+
//|  Автор    : Ким Игорь В. aka KimIV,  http://www.kimiv.ru                   |
//+----------------------------------------------------------------------------+
//|  Версия   : 07.10.2006                                                     |
//|  Описание : Возвращает экстремум ЗигЗага по его номеру.                    |
//+----------------------------------------------------------------------------+
//|  Параметры:                                                                |
//|    sy - наименование инструмента   (NULL или "" - текущий символ)          |
//|    tf - таймфрейм                  (      0     - текущий ТФ)              |
//|    ne - номер экстремума           (      0     - последний)               |
//|    dp - ExtDepth                                                           |
//|    dv - ExtDeviation                                                       |
//|    bs - ExtBackstep                                                        |
//+----------------------------------------------------------------------------+
double GetExtremumZZPrice(string sy="", int tf=0, int ne=0, int dp=12, int dv=5, int bs=3) {
  if (sy=="" || sy=="0") sy=Symbol();
  double zz;
  int    i, k=iBars(sy, tf), ke=0;

  for (i=1; i<k; i++) {
    zz=iCustom(sy, tf, "ZigZag", dp, dv, bs, 0, i);
    if (zz!=0) {
      ke++;
      if (ke>ne) return(zz);
    }
  }
  Print("GetExtremumZZPrice(): Экстремум ЗигЗага номер ",ne," не найден");
  return(0);
}
 

Examples of how to use GetExtremumZZZPrice() function.

  • The price level of the last ZigZag extremum on the current chart.
    Message(GetExtremumZZPrice());
  • The price level of the last ZigZag break on the H4 chart of the current symbol.
    Message(GetExtremumZZPrice(NULL, PERIOD_H4, 1));
  • Find the price level of the last ZigZag break on the current chart and draw a horizontal line through it.
    double p=GetExtremumZZPrice(NULL, 0, 1);
    SetHLine(Magenta, "", p);

SZU. Attached is a script for testing the GetExtremumZZZPrice() function.

 
KimIV писал (а) >>

Examples of using the GetExtremumZZZPrice() function.

  • The price level of the last ZigZag extremum on the current chart.
  • The price level of the last ZigZag break on the H4 chart of the current symbol.
  • Find the price level of the last ZigZag break on the current chart and draw a horizontal line through it.

And how do you draw a vertical dashed line as a background at all such points?