//+------------------------------------------------------------------+
//| Pointer9.mq4 |
//| Copyright 2020, AM2 |
//| http://www.forexsystems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2020, AM2"
#property link "http://www.forexsystems.biz"
#property version "1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 2
extern int Count=111;
extern string IndName1="SonicR VSA (Black)";
extern string IndName2="BetterVolume 1.4";
extern string IndName3="BB_Alert Arrows";
extern string IndName4="MBFX Timing";
extern string IndName5="Star-Profit-Channel";
double up[];
double dn[];
datetime t=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- indicator buffers mapping
SetIndexStyle(0,DRAW_ARROW,0,3,Blue);
SetIndexArrow(0,233);
SetIndexBuffer(0,up);
SetIndexStyle(1,DRAW_ARROW,0,3,Red);
SetIndexArrow(1,234);
SetIndexBuffer(1,dn);
Comment("");
//---
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 blu1=0,
blu2=0,
bbup=0,
bbdn=0,
gre=0,
red=0,
greup=0,
gredn=0,
redup=0,
reddn=0;
for(int i=1; i<Count; i++)
{
blu1=iCustom(NULL,0,IndName1,2,i);
blu2=iCustom(NULL,0,IndName2,1,i);
bbup=iCustom(NULL,0,IndName3,1,i);
bbdn=iCustom(NULL,0,IndName3,0,i);
gre=iCustom(NULL,0,IndName4,1,i);
red=iCustom(NULL,0,IndName4,2,i);
greup=iCustom(NULL,0,IndName5,4,i);
gredn=iCustom(NULL,0,IndName5,6,i);
redup=iCustom(NULL,0,IndName5,3,i);
reddn=iCustom(NULL,0,IndName5,1,i);
if(blu1>0 && blu2>0 && bbdn<1000 && red<1000 && Bid<redup && Bid>reddn)
{
dn[i]=high[i];
}
if(blu1>0 && blu2>0 && bbup<1000 && gre<1000 && Bid>gredn && Bid<greup)
{
up[i]=low[i];
}
}
if(t!=time[0])
{
if(up[1]>0)
{
Alert(_Symbol+" Buy!");
}
if(dn[1]>0)
{
Alert(_Symbol+" Sell!");
}
t=time[0];
}
Comment(iCustom(NULL,0,IndName4,1,1));
//--- return value of prev_calculated for next call
return(rates_total);
}
//+------------------------------------------------------------------+
2-3 в одном это еще другое дело
AM2