I will write the indicator for free - page 34

 
Yurij Izyumov:
You can't get the data from the fibo, it is mathematically calculated using 0 and 100 levels.

Can the numbers be taken from the horizontal lines drawn ?

For example: blue - high, red - low (100% and 0% for Fibo)


 

Good afternoon!

Please help me to understand how prices are displayed and used in MQL4

I wanted to write a simple arrow indicator that would output when the price goes over the bolinger line.

 #property indicator_buffers 2
 //---- цвета индикатора
 #property  indicator_color1 Blue
 #property  indicator_color2 Red
 //---- индикаторные буфферы
 double buf_1[];
 double buf_2[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
//---- 2 индикаторных буффера использованы для счёта
 SetIndexBuffer(0, buf_1);
 SetIndexBuffer(1, buf_2);
 //---- Стиль исполнения графика 
 //---- DRAW_ARROW - стрелки(символы)
 SetIndexStyle (0, DRAW_ARROW, STYLE_SOLID, 3);
 SetIndexStyle (1, DRAW_ARROW, STYLE_SOLID, 3);
 SetIndexArrow (0, 233);
 SetIndexArrow (1, 234);
 //---- установка значений индикатора, которые не будут видимы на графике
 SetIndexEmptyValue(0,0.0);
 SetIndexEmptyValue(1,0.0);
 //---- установка номера бара, начиная с которого будет отрисовываться индикатор 
 //SetIndexDrawBegin(0,MA_Slow);
 //SetIndexDrawBegin(1,MA_Slow);
 //---- завершение инициализации
 return (0);

//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
//---
 //---- проверка количества баров на достаточность для расчёта
 if (Bars <= 30) return (0);
 //---- получение уже посчитанных баров
 int ExtCountedBars = IndicatorCounted();
 //---- проверка на возможные ошибки
 if (ExtCountedBars < 0) return (-1);
 //---- последний посчитанный бар должен быть пересчитан 
 if (ExtCountedBars > 0) ExtCountedBars--;
 //---- основной цикл расчёта индиатора
 for (int i=Bars - ExtCountedBars-1;i>=0; i--)
 { 
 //---- получение значений индикатора в переменные
 double Bolinger_HIGH = iBands(NULL,0,20,2.5,0,PRICE_CLOSE,MODE_UPPER,0);
 double Bolinger_LOW = iBands(NULL,0,20,2.5,0,PRICE_CLOSE,MODE_LOWER,0);
 
 //---- проверка условий по вашим правилам и отрисовка стрелки
 if (Bolinger_LOW > Low[i]) {
 buf_1[i] = Low[i] - 10 * Point;
 Print("BolLOW = ",Bolinger_LOW,", Low = ",Low[i],".");
 }
 if (Bolinger_HIGH < High[i]) buf_2[i] = High[i] + 10 * Point;
 }
 //---- завершение основной функции
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+

The result is that the arrows don't appear where I would like them to.

I suspect it has to do with the OHLC price display on the chart.

Please help me sort this out.

 
MMM1972:

Can the numbers be taken from the horizontal lines drawn ?

For example blue - high, red - low (respectively 100% and 0% for Fibo)



I have a free indicator that draws two lines and uses them for fibo and alert

 

Good people, tell me why when I want to write #property indicator_type1 DRAW_COLOR_LINE it gives an error constant expected???

 
sviter-pro:

Good people tell me why when I want to write #property indicator_type1 DRAW_COLOR_LINE it gives error constant expected???


BecauseDRAW_COLOR_LINE is only for MT5

 
Yurij Izyumov:

I have a free indicator that draws two lines and uses them for Fibo and Alert

Yuri, you haven't forgotten about me.)

 

Hello! Can you rewrite the code for the indicator in the attachment, instead of creating objects, use buffer lines. Indicator Market Profile .

Files:
 

Afternoon!

Looking for ILAN with rollover, i.e. Ilan works in normal mode, gets into a drawdown and then you press the button and Ilan rolls all current trades with TP exactly backwards and continues to work in the opposite direction.


If you have one of these Ilan will be very grateful ))




P.S. Maybe at least this bastard will work

 

Good afternoon. I read your post about creating a free indicator and decided to write to you. I have an idea of creating a HIGHLY REVERSE INDICATOR.

I have a FORMULA and Technology of "Formula Optimization". An example of the result is on the Screenshot below:

 
Septimus7:

Good afternoon. I read your post about creating a free indicator and decided to write to you. I have an idea to create a HIGHLY REVERSE INDICATOR.

I have a FORMULA and Technology of "Formula Optimization". An example of the result in the screenshot below:


Well, if you read it, it seems to say - write and will be you, while I do not see anything