
double ProFX07Green=iCustom(Symbol(),0,"ProFX07",1,1); // на предыдущей свече зеленый
double ProFX07Gray=iCustom(Symbol(),0,"ProFX07",0,1); // на предыдущей свече серый
//--- sell conditions
if(ProFX06Gray<0 && ProFX04Gray<0 && ProFX07Gray>0)/**/
{
res=OrderSend(Symbol(),OP_SELL,Lots,Bid,Slip,Bid+StopLoss*Point,Bid-TakeProfit*Point,"",MAGIC,0,Red);
return;
}
//--- buy conditions
if(ProFX04Green>0 && ProFX06Green>0 && ProFX07Green>0)/**/
{
res=OrderSend(Symbol(),OP_BUY,Lots,Ask,Slip,Ask-StopLoss*Point,Ask+TakeProfit*Point,"",MAGIC,0,Blue);
return;
}
//+------------------------------------------------------------------+
//| ProjectName |
//| Copyright 2012, CompanyName |
//| http://www.companyname.net |
//+------------------------------------------------------------------+
#property indicator_separate_window
#property indicator_minimum 0.0
#property indicator_maximum 1.0
#property indicator_buffers 4
#property indicator_color1 Gray
#property indicator_color2 Green
#property indicator_color3 Black
#property indicator_color4 Black
extern int Minutes=30;
double buf1[];
double buf2[];
double buf3[];
double buf4[];
double sar;
double adx;
double adx1;
string per;
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int init()
{
SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,3);
SetIndexBuffer(0,buf1);
SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,3);
SetIndexBuffer(1,buf2);
SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_SOLID,2);
SetIndexBuffer(2,buf3);
SetIndexStyle(3,DRAW_HISTOGRAM,STYLE_SOLID,2);
SetIndexBuffer(3,buf4);
switch(Minutes)
{
case 1:
per="Period_M1";
break;
case 5:
per="Period_M5";
break;
case 15:
per="Period_M15";
break;
case 30:
per="Period_M30";
break;
case 60:
per="Period_H1";
break;
case 240:
per="Period_H4";
break;
case 1440:
per="Period_D1";
break;
case 10080:
per="Period_W1";
break;
case 43200:
per="Period_MN1";
break;
default:
per="Current Timeframe";
Minutes=0;
}
IndicatorShortName("ProFx07("+per+")");
return (0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int deinit()
{
return (0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
int l_ind_counted_4=IndicatorCounted();
for(int i=0; i<7000; i++)
{
buf1[i] = 0;
buf2[i] = 0;
buf3[i] = 0;
buf4[i] = 0;
adx=iADX(NULL,Minutes,14,PRICE_CLOSE,MODE_PLUSDI,i);
adx1= iADX(NULL,Minutes,14,PRICE_CLOSE,MODE_MINUSDI,i);
sar = iSAR(NULL,Minutes,0.02,0.2,i);
if(sar < iClose(NULL, Minutes, i) && adx > adx1) buf2[i] = 1;//стандартный параболик меньше закрытия 30 минутки и плюс adx больше минуса
if(sar < iClose(NULL, Minutes, i) && adx1 > adx) buf4[i] = 1;
if(sar > iClose(NULL, Minutes, i) && adx1 > adx) buf1[i] = 1;//стандартный параболик больше закрытия 30 минутки и плюс adx больше минуса
if(sar > iClose(NULL, Minutes, i) && adx > adx1) buf3[i] = 1;
if(buf1[i]==0.0 && buf2[i]==0.0)
{
}
}
return (0);
}
//+------------------------------------------------------------------+
AM2