
min — ниже линии
max — выше линии
после закрытия свечи — стрелка, звук, оповещение
СИГНАЛ НА БАЙ
это был первый скрин, но в индикаторе только open и close
//+------------------------------------------------------------------+
//| BBStoh.mq5 |
//| Copyright 2024, AM2. |
//| http://www.forexsystems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2024, AM2."
#property link "http://www.forexsystems.biz"
#property version "1.00"
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_plots 3
//---- indicator parameters
input int K=5;
input int D=3;
input int S=3;
input int BB=7;
input double Dev=2.0;
int h1=0,h2=0;
double b1[],b2[],b3[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- indicator buffers mapping
h1=iStochastic(NULL,0,K,D,S,0,0);
h2=iBands(NULL,0,BB,0,Dev,0);
ArraySetAsSeries(b1,true);
ArraySetAsSeries(b2,true);
ArraySetAsSeries(b3,true);
SetIndexBuffer(0,b1,INDICATOR_DATA);
SetIndexBuffer(1,b2,INDICATOR_DATA);
SetIndexBuffer(2,b3,INDICATOR_DATA);
PlotIndexSetInteger(0,PLOT_DRAW_TYPE,DRAW_LINE);
PlotIndexSetInteger(0,PLOT_LINE_STYLE,2);
PlotIndexSetInteger(0,PLOT_LINE_COLOR,clrRed);
PlotIndexSetInteger(0,PLOT_LINE_WIDTH,1);
PlotIndexSetInteger(0,PLOT_DRAW_BEGIN,0);
PlotIndexSetInteger(1,PLOT_DRAW_TYPE,DRAW_LINE);
PlotIndexSetInteger(1,PLOT_LINE_STYLE,STYLE_SOLID);
PlotIndexSetInteger(1,PLOT_LINE_COLOR,clrBlue);
PlotIndexSetInteger(1,PLOT_LINE_WIDTH,2);
PlotIndexSetInteger(1,PLOT_DRAW_BEGIN,0);
PlotIndexSetInteger(2,PLOT_DRAW_TYPE,DRAW_LINE);
PlotIndexSetInteger(2,PLOT_LINE_STYLE,STYLE_SOLID);
PlotIndexSetInteger(2,PLOT_LINE_COLOR,clrBlue);
PlotIndexSetInteger(2,PLOT_LINE_WIDTH,2);
PlotIndexSetInteger(2,PLOT_DRAW_BEGIN,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[])
{
//---
CopyBuffer(h1,0,0,rates_total,b1);
CopyBuffer(h2,1,0,rates_total,b2);
CopyBuffer(h2,2,0,rates_total,b3);
//--- return value of prev_calculated for next call
return(rates_total);
}
//+------------------------------------------------------------------+
вам нужен усреднитель по тренду!
AM2