Professional Documents
Culture Documents
Engulf
Engulf
#property indicator_buffers 2
#property indicator_width1 2
#property indicator_width2 2
double BufferUP[];
double BufferLOW[];
int candle[];
//+------------------------------------------------------------------+
int init()
SetIndexStyle(0,DRAW_ARROW);
SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(0,233);
SetIndexArrow(1,234);
SetIndexBuffer(0,BufferUP);
SetIndexBuffer(1,BufferLOW);
SetIndexLabel(0,"UP");
SetIndexLabel(1,"DOWN");
SetIndexEmptyValue(0,0.0);
IndicatorShortName("FiguresCandle");
return(0);
//+------------------------------------------------------------------+
int deinit()
ObjectsDeleteAll(0,OBJ_TREND);
//ObjectsDeleteAll(0,OBJ_RECTANGLE);
return(0);
//+------------------------------------------------------------------+
int start()
int counted_bars=IndicatorCounted();
int S;
string NameFigur;
if(counted_bars>0) counted_bars--;
int limit=Bars-counted_bars;
S=Figura(i);
switch(S)
{
case 1:BufferUP[i]=Low[i];
break;
case -1:BufferLOW[i]=High[i];
break;
return(0);
//-------------------------------------------------------------------
if(!DrawCandle) return(0);
name=StringConcatenate(name," ",TimeToStr(Time[bar],TIME_DATE|TIME_SECONDS));
ObjectCreate(name,OBJ_TREND,0,Time[bar],High[bar],Time[bar],Low[bar]);
ObjectSet(name,OBJPROP_COLOR,col);
ObjectSet(name,OBJPROP_STYLE,STYLE_SOLID);
ObjectSet(name,OBJPROP_BACK,false);
ObjectSet(name,OBJPROP_RAY,false);
ObjectSet(name,OBJPROP_WIDTH,2);
name=StringConcatenate(name," o");
ObjectCreate(name,OBJ_TREND,0,Time[bar+1],Open[bar],Time[bar],Open[bar]);
ObjectSet(name,OBJPROP_COLOR,col);
ObjectSet(name,OBJPROP_STYLE,STYLE_SOLID);
ObjectSet(name,OBJPROP_BACK,false);
ObjectSet(name,OBJPROP_RAY,false);
ObjectSet(name,OBJPROP_WIDTH,2);
name=StringConcatenate(name," c");
ObjectCreate(name,OBJ_TREND,0,Time[bar],Close[bar],Time[bar]+Period()*60,Close[bar]);
ObjectSet(name,OBJPROP_COLOR,col);
ObjectSet(name,OBJPROP_STYLE,STYLE_SOLID);
ObjectSet(name,OBJPROP_BACK,false);
ObjectSet(name,OBJPROP_RAY,false);
ObjectSet(name,OBJPROP_WIDTH,2);
return(0);
//
return(-1); //return(-1)
{
return(1); //return(1);
return(0);
//-------------------------------------------------------------------