Здравствуйте учитель! Спасибо за ответ. Теперь у меня есть другое просьба. Пожалуйста помогите с кодом?! Пожалуйста посмотрите на этот картинок: Индикатор должен показать только первую стрелки (1-2-1-2-1-2). Остальное между 1 и 2 не надо показать. Как я могу кодироваться?!
индикаторы Код:
//+-------------------------------------------------------------------+
//| Стрелка.mq4 |
//+-------------------------------------------------------------------+
#property copyright "NEW"
#property link "NEW"
#property version "1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 12
#property indicator_color1 Lime
#property indicator_color2 Red
#property indicator_color3 Lime
#property indicator_color4 Red
#property indicator_color5 Lime
#property indicator_color6 Red
#property indicator_color7 Lime
#property indicator_color8 Red
double CrossUp[];
double CrossDown[];
input string Parmetrs_indicator = "-------------------< SETTINGS >-------------------";//INDICATORS PARAMETERS
input string _________________________="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";//____________Slope Direction Indicator
input int period = 34; //Period
input int method = 3; //Method
input int price = 0; //Price
input string ________________________="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";//____________Average MACD Indicator
input int Price2 = 8; //Price
input int method2 = 5; //Fast Period
input int price2 = 13; //Slow Period
input int period2 = 7; //Signal Period
input int method3 = 1; //Method
input string __________________="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";//_______Heiken Ashi Oscillator Indicator
input int Averageperiod = 2; //Average Period
input string ________________="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";//_________________Arrow settings
input bool ShowArrows = 1; //Show Arrows
input int arrowsUpCode = 233; //Arrows Up Code
input int arrowsDnCode = 234; //Arrows Dn Code
input int arrowsUpSize = 4; //Arrows Up Size
input int arrowsDnSize = 4; //Arrows Dn Size
input int gap = 5; //Gap
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
int PipValue = 1,buy=0,sell=0;
double point; int Zap;
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init(){
if((Bid<10 && _Digits==5)||(Bid>10 && _Digits==3)) {PipValue=10;}
if((Bid<10 && _Digits==4)||(Bid>10 && _Digits==2)) {PipValue= 1;}
point = PipValue * Point;
SetIndexStyle(0, DRAW_ARROW, EMPTY,arrowsUpSize);
SetIndexArrow(0, arrowsUpCode);
SetIndexBuffer(0, CrossUp);
SetIndexStyle(1, DRAW_ARROW, EMPTY,arrowsDnSize);
SetIndexArrow(1, arrowsDnCode);
SetIndexBuffer(1, CrossDown);
return(0);}
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
return(0);
}
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start(){
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
int limit,i;
double RSI,RSI1,RSI2,RSI12,RSI11,RSI3,
RSI6,RSI7,RSI10,RSI0,RSI8,RSI9,RSI20,RSI30,Slop,Slop2;
int counted_bars=IndicatorCounted();
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
for(i = 0; i <= limit; i++){
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Slop = iCustom(NULL,0,"SlopeDirection",period,method,price,0,0,0,i+1);
Slop2 = iCustom(NULL,0,"SlopeDirection",period,method,price,0,0,0,i+2);
RSI = iCustom(NULL,0,"SlopeDirection",period,method,price,0,0,1,i+1);
RSI0 = iCustom(NULL,0,"SlopeDirection",period,method,price,0,0,1,i+2);
RSI1 = iCustom(NULL,0,"SlopeDirection",period,method,price,0,0,2,i+1);
RSI10 = iCustom(NULL,0,"SlopeDirection",period,method,price,0,0,2,i+2);
RSI11 = iCustom(NULL,0,"SlopeDirection",period,method,price,0,0,1,i+2);
RSI12 = iCustom(NULL,0,"SlopeDirection",period,method,price,0,0,2,i+2);
RSI2 = iCustom(NULL,0,"average_MACD_-_mtf_u_alerts2divergence"," ",Price2,method2,price2,period2,method3,0,0,0,LimeGreen,OrangeRed," ",1,1,0.005,0.0025,0.001,-0.001,-0.0025,-0.005,0,4,i+1);
RSI3 = iCustom(NULL,0,"average_MACD_-_mtf_u_alerts2divergence"," ",Price2,method2,price2,period2,method3,0,0,0,LimeGreen,OrangeRed," ",1,1,0.005,0.0025,0.001,-0.001,-0.0025,-0.005,0,4,i+2);
RSI20 = iCustom(NULL,0,"average_MACD_-_mtf_u_alerts2divergence"," ",Price2,method2,price2,period2,method3,0,0,0,LimeGreen,OrangeRed," ",1,1,0.005,0.0025,0.001,-0.001,-0.0025,-0.005,0,5,i+1);
RSI30 = iCustom(NULL,0,"average_MACD_-_mtf_u_alerts2divergence"," ",Price2,method2,price2,period2,method3,0,0,0,LimeGreen,OrangeRed," ",1,1,0.005,0.0025,0.001,-0.001,-0.0025,-0.005,0,5,i+2);
RSI6 = iCustom(NULL,0,"HeikenAshiOscillator",Averageperiod,0,i+2);
RSI7 = iCustom(NULL,0,"HeikenAshiOscillator",Averageperiod,0,i+1);
RSI8 = iCustom(NULL,0,"HeikenAshiOscillator",Averageperiod,1,i+2);
RSI9 = iCustom(NULL,0,"HeikenAshiOscillator",Averageperiod,1,i+1);
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
if (ShowArrows && (Slop < iClose(NULL,0,i+1) && RSI7 != 0.0 && RSI2 < 0.0 && RSI20 < RSI2 &&
((((iHigh(NULL,0,i+1) - iLow(NULL,0,i+1))*70)/100) + iLow(NULL,0,i+1)) < iClose(NULL,0,i+1)) && !(Slop2 < iClose(NULL,0,i+2) && RSI6 != 0.0 &&
RSI3 < 0.0 && RSI30 < RSI3 && ((((iHigh(NULL,0,i+2) - iLow(NULL,0,i+2))*70)/100) + iLow(NULL,0,i+2)) < iClose(NULL,0,i+2)))
{
CrossUp[i+1] = (iLow(NULL,0,i) - gap * point);
}
if (ShowArrows && (Slop > iClose(NULL,0,i+1) && RSI9 != 0.0 && RSI2 > 0.0 && RSI20 > RSI2 &&
((((iHigh(NULL,0,i+1) - iLow(NULL,0,i+1))*30)/100) + iLow(NULL,0,i+1)) > iClose(NULL,0,i+1)) && !(Slop2 > iClose(NULL,0,i+2) && RSI8 != 0.0 &&
RSI3 > 0.0 && RSI30 > RSI3 && ((((iHigh(NULL,0,i+2) - iLow(NULL,0,i+2))*30)/100) + iLow(NULL,0,i+2)) > iClose(NULL,0,i+2)))
{
CrossDown[i+1] = (iHigh(NULL,0,i) + gap * point);
}}
return(0);
}