← К каталогу
Исходный код · ID 1007

extreme_spike-123.mq5

Вы автор или правообладатель?

Сообщите нам, если считаете, что материал размещён без разрешения.

Краткий обзор

О программе

Индикатор Extreme Spike предназначен для анализа ценовых движений на графиках MetaTrader 5. Он отображает линии основных и второстепенных ценовых экстремумов (вершин и впадин), помогая визуально отслеживать развороты и значимые ценовые уровни. Индикатор работает в отдельном окне с пятью графическими линиями разного типа и цвета.

Встроенная система уведомлений позволяет получать оповещения при обнаружении ключевых ценовых паттернов: основных и второстепенных вершин и впадин, а также при подтверждении стабильности экстремумов. Поддерживаются всплывающие окна, электронная почта, push-уведомления и звуковые сигналы.

Индикатор предоставляет настройку параметров чувствительности обнаружения экстремумов, а также режим без перерисовки, который фиксирует сигналы без последующей корректировки исторических данных. Для расчёта минимальных высот экстремумов используется средний истинный диапазон (ATR).

Настройки программы

НастройкаОписание
NoRepaint Без перерисовки — Включает режим без перерисовки, при котором сигналы не корректируются ретроспективно.
MinorMinExtremeHeightATRs Минимальная высота второстепенного экстремума (ATR) — Минимальная высота второстепенного экстремума в единицах ATR.
MajorToMinorHeightRatio Соотношение высот основного и второстепенного экстремумов — Коэффициент соотношения высоты основного экстремума к высоте второстепенного.
MinorMinExtremeWidth Минимальная ширина второстепенного экстремума — Минимальная ширина второстепенного экстремума в количествах баров.
MajorMinExtremeWidth Минимальная ширина основного экстремума — Минимальная ширина основного экстремума в количествах баров.
AlertMajorBottomEnabled Оповещение основной впадины — Включает или отключает оповещения при обнаружении основной впадины.
AlertMajorTopEnabled Оповещение основной вершины — Включает или отключает оповещения при обнаружении основной вершины.
AlertMinorTopEnabled Оповещение второстепенной вершины — Включает или отключает оповещения при обнаружении второстепенной вершины.
AlertMinorBottomEnabled Оповещение второстепенной впадины — Включает или отключает оповещения при обнаружении второстепенной впадины.
AlertStableEnabled Оповещение стабильного экстремума — Включает или отключает оповещения при подтверждении стабильности экстремума (отсутствие перерисовки).
== Alerts == (AlertsSection) Раздел оповещений — Текстовый параметр для раздела настроек оповещений.
Popup message (Popup_Alert) Всплывающее оповещение — Включает или отключает всплывающие окна оповещений.
Push notification (Notification_Alert) Push-уведомление — Включает или отключает push-уведомления.
Email (Email_Alert) Email-оповещение — Включает или отключает отправку оповещений по электронной почте.
Play sound on alert (Play_Sound) Звуковое оповещение — Включает или отключает звуковое оповещение при срабатывании сигнала.
Sound file (Sound_File) Звуковой файл — Путь к звуковому файлу для оповещений.
Advanced alert (Advanced_Alert) Расширенное оповещение — Включает или отключает расширенную систему оповещений через внешнюю библиотеку DLL.
Comment2 Комментарий 2 — Информационный текстовый комментарий.
Comment3 Комментарий 3 — Информационный текстовый комментарий.
Comment4 Комментарий 4 — Информационный текстовый комментарий.
Получить полный код

Поиск по коду файла

#property version   "1.1"
#property strict

#property indicator_separate_window

#property indicator_minimum			-1.2
#property indicator_maximum			+1.2
#property indicator_buffers			5

#property indicator_color1			Red
#property indicator_width1			3
#property indicator_style1			STYLE_SOLID

#property indicator_color2			DodgerBlue
#property indicator_width2			3
#property indicator_style2			STYLE_SOLID

#property indicator_color3			DimGray
#property indicator_width3			0

#property indicator_color4			White
#property indicator_width4			1
#property indicator_style4			STYLE_SOLID

#property indicator_color5			White
#property indicator_width5			2
#property indicator_style5			STYLE_SOLID

#define ALERT_TOP		1
#define ALERT_BOTTOM	2
#define ALERT_STABLE	3

#define LINE_MINOR		1
#define LINE_MAJOR		2
#define LINE_SHADOW		3
#define LINE_STABLE		4

#define LINE_VALUE_UP		1.0
#define LINE_VALUE_FLAT		0.0
#define LINE_VALUE_DOWN		-1.0

#define MODE_LOOKING_FOR_BOTTOM	1
#define MODE_LOOKING_FOR_TOP	-1
#define MODE_UNDETERMINED		0

extern bool		NoRepaint					= FALSE;
extern double	MinorMinExtremeHeightATRs	= 2.0;
extern double	MajorToMinorHeightRatio		= 2.5;
extern int		MinorMinExtremeWidth		= 2;
extern int		MajorMinExtremeWidth		= 2;
extern bool		AlertMajorBottomEnabled		= FALSE;
extern bool		AlertMajorTopEnabled		= FALSE;
extern bool		AlertMinorTopEnabled		= FALSE;
extern bool		AlertMinorBottomEnabled		= FALSE;
extern bool		AlertStableEnabled			= FALSE;

extern string   AlertsSection            = ""; // == Alerts ==
extern bool     Popup_Alert              = true; // Popup message
extern bool     Notification_Alert       = false; // Push notification
extern bool     Email_Alert              = false; // Email
extern bool     Play_Sound               = false; // Play sound on alert
extern string   Sound_File               = ""; // Sound file
extern bool     Advanced_Alert           = false; // Advanced alert
extern string   Advanced_Key             = ""; // Advanced alert key
extern string   Comment2                 = "- You can get a advanced alert key by starting a dialog with @profit_robots_bot Telegram bot -";
extern string   Comment3                 = "- Allow use of dll in the indicator parameters window -";
extern string   Comment4                 = "- Install AdvancedNotificationsLib.dll -";

#import "AdvancedNotificationsLib.dll"
void AdvancedAlert(string key, string text, string instrument, string timeframe);
#import

#define ENTER_BUY_SIGNAL 1
#define ENTER_SELL_SIGNAL -1
#define EXIT_BUY_SIGNAL 2
#define EXIT_SELL_SIGNAL -2

class Signaler
{
   string _symbol;
   ENUM_TIMEFRAMES _timeframe;
   datetime _lastDatetime;
public:
   Signaler(const string symbol, ENUM_TIMEFRAMES timeframe)
   {
      _symbol = symbol;
      _timeframe = timeframe;
   }

   void SendNotifications(const int direction)
   {
      if (direction == 0)
         return;

      datetime currentTime = iTime(_symbol, _timeframe, 0);
      if (_lastDatetime == currentTime)
         return;

      _lastDatetime = currentTime;
      string tf = GetTimeframe();
      string alert_Subject;
      string alert_Body;
      switch (direction)
      {
         case ENTER_BUY_SIGNAL:
            alert_Subject = "Buy signal on " + _symbol + "/" + tf;
            alert_Body = "Buy signal on " + _symbol + "/" + tf;
            break;
         case ENTER_SELL_SIGNAL:
            alert_Subject = "Sell signal on " + _symbol + "/" + tf;
            alert_Body = "Sell signal on " + _symbol + "/" + tf;
            break;
         case EXIT_BUY_SIGNAL:
            alert_Subject = "Exit buy signal on " + _symbol + "/" + tf;
            alert_Body = "Exit buy signal on " + _symbol + "/" + tf;
            break;
         case EXIT_SELL_SIGNAL:
            alert_Subject = "Exit sell signal on " + _symbol + "/" + tf;
            alert_Body = "Exit sell signal on " + _symbol + "/" + tf;
            break;
      }
      SendNotifications(alert_Subject, alert_Body, _symbol, tf);
   }

   void SendNotifications(const string subject, string message = NULL, string symbol = NULL, string timeframe = NULL)
   {
      if (message == NULL)
         message = subject;
      if (symbol == NULL)
         symbol = _symbol;
      if (timeframe == NULL)
         timeframe = GetTimeframe();

      if (Popup_Alert)
         Alert(message);
      if (Email_Alert)
         SendMail(subject, message);
      if (Play_Sound)
         PlaySound(Sound_File);
      if (Notification_Alert)
         SendNotification(message);
      if (Advanced_Alert && Advanced_Key != "" && !IsTesting())
         AdvancedAlert(Advanced_Key, message, symbol, timeframe);
   }

private:
   string GetTimeframe()
   {
      switch (_timeframe)
      {
         case PERIOD_M1: return "M1";
         case PERIOD_M5: return "M5";
         case PERIOD_D1: return "D1";
         case PERIOD_H1: return "H1";
         case PERIOD_H4: return "H4";
         case PERIOD_M15: return "M15";
         case PERIOD_M30: return "M30";
         case PERIOD_MN1: return "MN1";
         case PERIOD_W1: return "W1";
      }
      return "M1";
   }
};

double line1[];	// lineMajorUp	
double line2[];	// lineMajorDown
double line3[];	// lineShadowUp, lineShadowDown	
double line4[];	// lineStableUp,  lineStableDown	
double line5[];	// lineMinorUp, lineMinorDown	

int		MinorLowExtremeIdx		= 1;
bool	MinorFirstLow			= TRUE;
int		MinorHiExtremeIdx		= 1;
bool	MinorFirstHigh			= TRUE;
int		MinorExtremeMode		= 0;
double	MinorLowExtremePrice;
double	MinorHiExtremePrice;

int		MajorLowExtremeIdx		= 1;
bool	MajorFirstLow			= TRUE;
int		MajorHiExtremeIdx		= 1;
bool	MajorFirstHigh			= TRUE;
int		MajorExtremeMode		= 0;
double	MajorLowExtremePrice;
double	MajorHiExtremePrice;

double	MinorMinExtremeHeight;
double	MajorMinExtremeHeight;

datetime AlertMinorTopIdx;
datetime AlertMinorBottomIdx;
datetime AlertMajorTopIdx;
datetime AlertMajorBottomIdx;
datetime AlertStableIdx;

string	periodName;
int		BarNumber;

#define RANGE_AVERAGING_PERIOD 250

Signaler *signaler;

int init() {
      // код доступен только после оплаты
   }

int deinit() {
   delete signaler;
	return(0);
}

int start() {
      // код доступен только после оплаты
   }

void processBar() {

	switch( BarNumber ) { 
		case 0:
			break;
		case 1:
			periodName				= getPeriodName();
			AlertMinorTopIdx		= Time[Bars-1];
			AlertMinorBottomIdx		= Time[Bars-1];
			AlertMajorTopIdx		= Time[Bars-1];
			AlertMajorBottomIdx		= Time[Bars-1];
			MinorLowExtremePrice	= getLow();
			MinorHiExtremePrice		= getHigh();
			MajorLowEx

Показано первые 50% кода (символов: 11147)

Открыть по тарифу

Купите тариф с пакетом открытий или войдите, если тариф уже есть. Открытый файл останется в вашем кабинете навсегда.

Разовая покупка файла

На этой странице откроется полный исходный код файла вместо ознакомительного фрагмента.

Чтобы оформить заказ, введите email и перейдите к оплате.

Стоимость полного кода
1 114,70₽ ≈ $13.62