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

Рейтинг 2129



РЕКОМЕНДУЮ



Прикрутите, пжлст, алерт

Если есть возможность, сделайте, пжлст, алерт на индюк, чтобы срабатывал, когда часовой и дневной сигнал совпадают. Алерт должен звонить раз в час, но не на открытии свечи, а в СЕРЕДИНЕ ЧАСUFX TREND multiMeter 1.01.ex4 (22 Kb)А.

Сам индюк — UFX TREND
  • 0
  • Просмотров: 1554
  • 10 ноября 2021, 10:06
  • walter8319
Понравилcя материал? Не забудьте поставить плюс и поделиться в социальной сети!

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

Брокер для ваших роботов, 15 лет на рынке

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

+
0
исходник бы
avatar

  23  igrun Сообщений: 1629 - igrun

  • 10 ноября 2021, 10:29
+
0
Я бы с радостью. Всё, что есть. Есть еще одна версия без выборочного таймфрейма
avatar

  3  walter8319 Автор Сообщений: 92

  • 10 ноября 2021, 10:45
+
0
На этой странице посмотрите www.mql5.com/en/forum/173574/page1137
avatar

  12  Slava78 Сообщений: 598

  • 10 ноября 2021, 11:48
комментарий был удален 2021-11-10 20:12:08 walter8319

+
0
Добрый вечер. Спасибо за ссылку, но к сожалению UFC с Аллертом не нашёл. Мне сделали аллерт на этот индикатор, но там не указана пара, на которую он кинут) не знаю, как в коментариях сбросить сюда сам инди


Редактирован: 10 ноября 2021, 20:10
avatar

  3  walter8319 Автор Сообщений: 92

  • 10 ноября 2021, 20:10
+
0
индикатор от индикатора с алертом можно сделать в таком случае.

самый простой способ скинуть так с тегом код:


... код ...
avatar

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

  • 10 ноября 2021, 20:20
+
0
#property strict
#property indicator_chart_window
#property indicator_plots 0

input ENUM_TIMEFRAMES i_eOlderTF = PERIOD_D1; // Older TF
input ENUM_TIMEFRAMES i_eYoungerTF = PERIOD_H1; // Younger TF
input uint i_uMinutes = 30; // Minutes from the opening

enum ENUM_BAR_TYPE
{
BAR_TYPE_DODG,
BAR_TYPE_BULL,
BAR_TYPE_BEAR
};

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
if (i_uMinutes > uint(Period()))
{
Alert(«Wrong value of parameter \»Minutes from the opening\". Indicator is turned off.");
return INIT_FAILED;
}

return(INIT_SUCCEEDED);
}
//+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
//| Expert deinitialization function |
//+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
void OnDeinit(const int reason)
{
}
//+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
//| 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 (!IsTesting())
if (!IsTFDataReady(i_eOlderTF) || !IsTFDataReady(i_eYoungerTF))
return rates_total;

datetime dtYoungerTFTime = iTime(NULL, i_eYoungerTF, 0);
if (TimeCurrent() — dtYoungerTFTime < i_uMinutes * 60)
return rates_total;
static datetime dtPrevBar = 0;
if (dtPrevBar == dtYoungerTFTime)
return rates_total;
dtPrevBar = dtYoungerTFTime;

ENUM_BAR_TYPE eOlderBar = GetBarType(0, i_eOlderTF);
ENUM_BAR_TYPE eYoungerBar = GetBarType(0, i_eYoungerTF);
if (eOlderBar == BAR_TYPE_DODG || eYoungerBar == BAR_TYPE_DODG || eOlderBar != eYoungerBar)
return rates_total;
Alert(«Coincidence of readings for », (eOlderBar == BAR_TYPE_BEAR)? «sell.»: «buy.»);

return rates_total;
}
//+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
//| Определение типа свечи |
//+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
ENUM_BAR_TYPE GetBarType(const int nBar, const ENUM_TIMEFRAMES eTF)
{
double fWholeHeight = iHigh(NULL, eTF, nBar) — iLow(NULL, eTF, nBar);
if (fWholeHeight <= 0.0)
return BAR_TYPE_DODG;

if (fabs(iOpen(NULL, eTF, nBar) — iClose(NULL, eTF, nBar)) / fWholeHeight < 2 * DBL_EPSILON)
return BAR_TYPE_DODG;
if (iOpen(NULL, eTF, nBar) > iClose(NULL, eTF, nBar))
return BAR_TYPE_BEAR;
return BAR_TYPE_BULL;
}
//+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
//| Проверка обновления данных указанного ТФ |
//+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
bool IsTFDataReady(ENUM_TIMEFRAMES eTF)
{
ResetLastError();
iTime(NULL, eTF, 1);
return GetLastError() == ERR_NO_ERROR;
}
avatar

  3  walter8319 Автор Сообщений: 92

  • 11 ноября 2021, 09:28
+
0
вот этот код с указанием пары:




//+------------------------------------------------------------------+
//|                                                   MultiMeter.mq4 |
//|                                              Copyright 2021, AM2 |
//|                                     https://www.forexsystems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2021, AM2"
#property link      "https://www.forexsystems.biz"
#property version   "1.00"
#property strict
#property indicator_chart_window
#property strict
#property indicator_chart_window
#property indicator_plots 0

input ENUM_TIMEFRAMES i_eOlderTF = PERIOD_D1; // Older TF
input ENUM_TIMEFRAMES i_eYoungerTF = PERIOD_H1; // Younger TF
input uint i_uMinutes = 30; // Minutes from the opening

enum ENUM_BAR_TYPE
  {
   BAR_TYPE_DODG,
   BAR_TYPE_BULL,
   BAR_TYPE_BEAR
  };

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
  {
   if(i_uMinutes > uint(Period()))
     {
      Alert("Wrong value of parameter \"Minutes from the opening\". Indicator is turned off.");
      return INIT_FAILED;
     }

   return(INIT_SUCCEEDED);
  }
//+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
//| Expert deinitialization function |
//+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
  }
//+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
//| 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(!IsTesting())
      if(!IsTFDataReady(i_eOlderTF) || !IsTFDataReady(i_eYoungerTF))
         return rates_total;

   datetime dtYoungerTFTime = iTime(NULL, i_eYoungerTF, 0);
   if(TimeCurrent() - dtYoungerTFTime < i_uMinutes * 60)
      return rates_total;
   static datetime dtPrevBar = 0;
   if(dtPrevBar == dtYoungerTFTime)
      return rates_total;
   dtPrevBar = dtYoungerTFTime;

   ENUM_BAR_TYPE eOlderBar = GetBarType(0, i_eOlderTF);
   ENUM_BAR_TYPE eYoungerBar = GetBarType(0, i_eYoungerTF);
   if(eOlderBar == BAR_TYPE_DODG || eYoungerBar == BAR_TYPE_DODG || eOlderBar != eYoungerBar)
      return rates_total;
   Alert(_Symbol+" Coincidence of readings for ", (eOlderBar == BAR_TYPE_BEAR)? "sell.": "buy.");

   return rates_total;
  }
//+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
//| Определение типа свечи |
//+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
ENUM_BAR_TYPE GetBarType(const int nBar, const ENUM_TIMEFRAMES eTF)
  {
   double fWholeHeight = iHigh(NULL, eTF, nBar) - iLow(NULL, eTF, nBar);
   if(fWholeHeight <= 0.0)
      return BAR_TYPE_DODG;

   if(fabs(iOpen(NULL, eTF, nBar) - iClose(NULL, eTF, nBar)) / fWholeHeight < 2 * DBL_EPSILON)
      return BAR_TYPE_DODG;
   if(iOpen(NULL, eTF, nBar) > iClose(NULL, eTF, nBar))
      return BAR_TYPE_BEAR;
   return BAR_TYPE_BULL;
  }
//+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
//| Проверка обновления данных указанного ТФ |
//+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
bool IsTFDataReady(ENUM_TIMEFRAMES eTF)
  {
   ResetLastError();
   iTime(NULL, eTF, 1);
   return GetLastError() == ERR_NO_ERROR;
  }
//+------------------------------------------------------------------+

avatar

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

  • 11 ноября 2021, 20:35
+
0
воспроизвел индикатор с алертом: www.opentraders.ru/downloads/3177/

avatar

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

  • 11 ноября 2021, 21:30

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