alekseifx

 
Уровень 8

  Торгую в компаниях:


Группа "Стол заказов MQL"

Рейтинг 2087



РЕКОМЕНДУЮ



Алерт к индикатору

Просьба сделать алерт с комментарием, на следующей свече после смены цвета к индикатору в ex.4
TrillionLine.ex4 (10 Kb)
Спасибо!
  • 0
  • Просмотров: 3413
  • 28 марта 2018, 10:05
  • alekseifx
Понравилcя материал? Не забудьте поставить плюс и поделиться в социальной сети!

Вступите в группу "Стол заказов MQL", чтобы следить за обновлениями
ПРИСОЕДИНИТЬСЯ К ГРУППЕ
присоединиться
  Предыдущая запись в группе
Торгуем объем.
Следующая запись в группе  
прошу модифицировать индикатор
26 марта 2018
28 марта 2018

Комментарии (11)

+
0
нужен файл *.mq4
avatar

  34  AM2 Сообщений: 15878 - Андрей

  • 28 марта 2018, 17:40
+
0
Я знаю! Вы мне уже писали похожий!
zakaz.opentraders.ru/44227.html
у меня нет в mq4
Редактирован: 28 марта 2018, 17:53
avatar

  8  alekseifx Автор Сообщений: 179

  • 28 марта 2018, 17:51
+
0
можно попробовать написать индикатор, который будет только сигналить. но чтобы воспроизвести индикатор визуально, нужно знать алгоритм построения диаграммы.
avatar

  34  AM2 Сообщений: 15878 - Андрей

  • 28 марта 2018, 18:13
+
0
Да не надо воспроизводить индикатор, напишите как прошлый, дополнение к основному, вообщем да, чтоб только сигналил. через функцию iCustom
Я пробывал Ваш подправить, индикатор выводит, но не сигналит!
<code>for(int i=0;i<count;i++)
     {
      up[i]=iCustom(NULL,0,IndName,1,i);
      dn[i]=iCustom(NULL,0,IndName,2,i);
     }
     
   if(t!=time[0])
     {
      if((up[1]>0 && dn[2]<0) || (dn[1]<0 && up[2]>0)) Alert(_Symbol+" Color Change!!!");
      t=time[0];
     }
//--- return value of prev_calculated for next call
   return(rates_total);
  }</code>

Редактирован: 28 марта 2018, 18:58
avatar

  8  alekseifx Автор Сообщений: 179

  • 28 марта 2018, 18:56
+
0
на четверг
avatar

  34  AM2 Сообщений: 15878 - Андрей

  • 28 марта 2018, 20:23
+
0
Хорошо, спасибо!
avatar

  8  alekseifx Автор Сообщений: 179

  • 28 марта 2018, 20:24
+
0
неее с этими играми вслепую не ко мне. можете дальше помучить то что я набросал:


//+------------------------------------------------------------------+
//|                                                    TrillionL.mq4 |
//|                                              Copyright 2018, AM2 |
//|                                      http://www.forexsyatems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2018, AM2"
#property link      "http://www.forexsyatems.biz"
#property version   "1.00"
#property strict
#property indicator_separate_window

#property  indicator_buffers 4

#property  indicator_color1  clrNONE
#property  indicator_color2  clrNONE

#property  indicator_width1  0
#property  indicator_width2  0


input int count=100;
input string IndName="TrillionLine";

double  hi[];
double  lo[];
double  up[];
double  dn[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexStyle(0,DRAW_NONE);
   SetIndexStyle(1,DRAW_NONE);
   SetIndexBuffer(0,hi);
   SetIndexBuffer(1,lo);
   SetIndexStyle(2,DRAW_HISTOGRAM,0,3,Lime);
   SetIndexStyle(3,DRAW_HISTOGRAM,0,3,White);
   SetIndexBuffer(2,up);
   SetIndexBuffer(3,dn);
//---
   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[])
  {
//---
   for(int i=0;i<count;i++)
     {
      hi[i]=iCustom(NULL,0,IndName,0,i);
      lo[i]=iCustom(NULL,0,IndName,1,i);
      up[i]=iCustom(NULL,0,IndName,3,i);
      dn[i]=iCustom(NULL,0,IndName,2,i);
     }

   Comment("\n UP: ",up[1],
           "\n DN: ",dn[1],
           "\n HI: ",hi[1],
           "\n LO: ",lo[1]);
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+

avatar

  34  AM2 Сообщений: 15878 - Андрей

  • 29 марта 2018, 20:11
+
0
можете еще этот вариант доработать:


//+------------------------------------------------------------------+
//|                                                    TrillionL.mq4 |
//|                                              Copyright 2018, AM2 |
//|                                      http://www.forexsyatems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2018, AM2"
#property link      "http://www.forexsyatems.biz"
#property version   "1.00"
#property strict
#property indicator_chart_window

#property  indicator_buffers 2

input int per=6;
input int met=3;
input int pr=0;
input int shift=1;
input int count=111;

input string IndName="TrillionLine";

double  up[];
double  dn[];

datetime t=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   Comment("");
   SetIndexStyle(0,DRAW_NONE);
   SetIndexStyle(1,DRAW_NONE);
   SetIndexBuffer(0,up);
   SetIndexBuffer(1,dn);
//---
   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[])
  {
//---
   double ma=iMA(NULL,0,per,0,met,pr,shift);

   for(int i=0;i<count;i++)
     {
      up[i]=iCustom(NULL,0,IndName,2,i);
      dn[i]=iCustom(NULL,0,IndName,3,i);
     }

   if(t!=time[0])
     {
      if(up[1]>ma && up[2]<ma) Alert(_Symbol+" Color Change!");
      if(up[1]<ma && up[2]>ma) Alert(_Symbol+" Color Change!");
      t=time[0];
     }
     
   Comment("\n UP: ",up[1],
           "\n DN: ",dn[1]);
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+

avatar

  34  AM2 Сообщений: 15878 - Андрей

  • 29 марта 2018, 22:08
+
0
avatar

  34  AM2 Сообщений: 15878 - Андрей

  • 30 марта 2018, 17:45
+
0
Спасибо! Но сдвиг не работает, сигналит сразу как только цвет изменится, а он рисует на открытой свече.
avatar

  8  alekseifx Автор Сообщений: 179

  • 30 марта 2018, 19:35
+
0
сдвиг не работает


сдвига нет в анализируемом паттерне(бары 1,2,3)
вот подчищенный от всего лишнего вариант:


//+------------------------------------------------------------------+
//|                                                    TrillionL.mq4 |
//|                                              Copyright 2018, AM2 |
//|                                      http://www.forexsyatems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2018, AM2"
#property link      "http://www.forexsyatems.biz"
#property version   "1.00"
#property strict
#property indicator_chart_window

#property  indicator_buffers 2

input int count=111;

input string IndName="TrillionLine";

double  up[];
double  dn[];

datetime t=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   Comment("");
   SetIndexStyle(0,DRAW_NONE);
   SetIndexStyle(1,DRAW_NONE);
   SetIndexBuffer(0,up);
   SetIndexBuffer(1,dn);
//---
   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[])
  {
//---
   for(int i=0;i<count;i++)
     {
      up[i]=iCustom(NULL,0,IndName,2,i);
      dn[i]=iCustom(NULL,0,IndName,3,i);
     }

   if(t!=time[0])
     {
      if(dn[1]>dn[2] && dn[2]<dn[3]) Alert(_Symbol+" Color Change!");
      if(dn[1]<dn[2] && dn[2]>dn[3]) Alert(_Symbol+" Color Change!");
      t=time[0];
     }
     
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+

avatar

  34  AM2 Сообщений: 15878 - Андрей

  • 30 марта 2018, 20:04

Зарегистрируйтесь или авторизуйтесь, чтобы оставить комментарий
Начать торговлю с Альпари