
Необходимо создать отправку этих сигналов(текст алерта) через сокет в сторонную программу
//+------------------------------------------------------------------+
//| Gisto.mq5 |
//| Copyright 2022, AM2 |
//| https://www.forexsystems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2022, AM2"
#property link "https://www.forexsystems.biz"
#property version "1.00"
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_plots 1
#property indicator_type1 DRAW_COLOR_HISTOGRAM
#property indicator_color1 Red,Lime
#property indicator_style1 STYLE_SOLID
#property indicator_width1 2
int ind=0;
double gi[],col[],ac[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- indicator buffers mapping
SetIndexBuffer(0,gi,INDICATOR_DATA);
SetIndexBuffer(1,col,INDICATOR_COLOR_INDEX);
SetIndexBuffer(2,ac,INDICATOR_CALCULATIONS);
ind=iAC(NULL,0);
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int Count(int k)
{
int n=0;
ArraySetAsSeries(ac,true);
CopyBuffer(ind,0,0,111,ac);
for(int i=k; i<111; i++)
{
double ac1=ac[i];
double ac2=ac[i+1];
n++;
if((ac1>0 && ac2<0) || (ac1<0 && ac2>0))
break;
}
return(n);
}
//+------------------------------------------------------------------+
//| 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[])
{
//---
ArraySetAsSeries(gi,true);
for(int i=0; i<=rates_total-1; i++)
{
if(ac[i]>0)
{
col[i]=0;
gi[i]=Count(i);
}
if(ac[i]<0)
{
col[i]=1;
gi[i]=-Count(i);
}
}
Comment("\n Count: ",Count(0));
//--- return value of prev_calculated for next call
return(rates_total);
}
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//| Gisto.mq5 |
//| Copyright 2022, AM2 |
//| https://www.forexsystems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2022, AM2"
#property link "https://www.forexsystems.biz"
#property version "1.00"
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_plots 1
#property indicator_type1 DRAW_COLOR_HISTOGRAM
#property indicator_color1 Red,Lime
#property indicator_style1 STYLE_SOLID
#property indicator_width1 2
int ind=0;
double gi[],col[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- indicator buffers mapping
SetIndexBuffer(0,gi,INDICATOR_DATA);
SetIndexBuffer(1,col,INDICATOR_COLOR_INDEX);
ind=iAC(NULL,0);
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int Count()
{
int n=0;
for(int i=ArraySize(gi); i>=0; i--)
{
double ac1=gi[i];
double ac2=gi[i+1];
n++;
if((ac1>0 && ac2<0) || (ac1<0 && ac2>0))
break;
}
return(n);
}
//+------------------------------------------------------------------+
//| 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[])
{
//---
//ArraySetAsSeries(gi,true);
CopyBuffer(ind,0,0,rates_total-1,gi);
for(int i=0; i<=rates_total-1; i++)
{
if(gi[i]>0)
{
col[i]=0;
//gi[i]=Count(i);
}
if(gi[i]<0)
{
col[i]=1;
//gi[i]=-Count(i);
}
}
Comment(Count());
//--- return value of prev_calculated for next call
return(rates_total);
}
//+------------------------------------------------------------------+
это цена от момента установки ордеров до +- (700) дельта пунктов. например есть 3 ордера с шагом 200 и дельта 700, все тейки будут на цене бид+-700пунктов
AM2