//+------------------------------------------------------------------+
//| CoreWinTT æåëàåò Âàì óñïåõîâ è óäà÷è! :)
//+------------------------------------------------------------------+
#property link "CoreWinTT"
#property indicator_chart_window
#property indicator_buffers 6
#property indicator_color1 Aqua
#property indicator_width1 2
#property indicator_color2 Aqua
#property indicator_width2 2
#property indicator_color3 Magenta
#property indicator_width3 2
#property indicator_color4 Magenta
#property indicator_width4 2
#property indicator_color5 MediumPurple
#property indicator_width5 2
#property indicator_color6 MediumPurple
#property indicator_width6 2
extern int ElderEMA= 13;
extern int FastEMA = 12;
extern int SlowEMA = 26;
extern int SignalEMA=9;
extern int PozzX = 10;
extern int PozzY = 30;
extern int Font_Size = 9;
extern bool ShowInfo =False;
string Label="ImpulseMACD_Xopen_Shadow";
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
double ExtMapBuffer5[];
double ExtMapBuffer6[];
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,1);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,1);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_SOLID,1);
SetIndexBuffer(2,ExtMapBuffer3);
SetIndexStyle(3,DRAW_HISTOGRAM,STYLE_SOLID,1);
SetIndexBuffer(3,ExtMapBuffer4);
SetIndexStyle(4,DRAW_HISTOGRAM,STYLE_SOLID,1);
SetIndexBuffer(4,ExtMapBuffer5);
SetIndexStyle(5,DRAW_HISTOGRAM,STYLE_SOLID,1);
SetIndexBuffer(5,ExtMapBuffer6);
//----
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
int i=Bars-counted_bars;
if(counted_bars==0) i--;
while(i>=0)
{
double L_1 = iCustom(NULL,0,"Bestmacd_v3",ElderEMA,FastEMA,SlowEMA,SignalEMA,1,2,i); //buy
double L_2 = iCustom(NULL,0,"Bestmacd_v3",ElderEMA,FastEMA,SlowEMA,SignalEMA,1,1,i); //sell
if(L_1!=0.0){ExtMapBuffer1[i]=High[i];ExtMapBuffer2[i]=Low[i];}
else
{
if(L_2!=0.0){ExtMapBuffer3[i]=High[i];ExtMapBuffer4[i]=Low[i];}
else{ExtMapBuffer5[i]=High[i];ExtMapBuffer6[i]=Low[i];}
}
i--;
}
//----
if(ShowInfo==True)
{
double Lk_1 = iCustom(NULL,0,"Bestmacd_v3",ElderEMA,FastEMA,SlowEMA,SignalEMA,1,2,0); //buy
double Lk_2 = iCustom(NULL,0,"Bestmacd_v3",ElderEMA,FastEMA,SlowEMA,SignalEMA,1,1,0); //sell
if(Lk_1!=0.0)
{
ObjectCreate(Label, OBJ_LABEL, 0, 0, 0);// Ñîçäàíèå îáú.
ObjectSet(Label, OBJPROP_CORNER, 1); // Ïðèâÿçêà óãîë
ObjectSet(Label, OBJPROP_XDISTANCE, PozzX);// Êîîðäèíàòà Õ
ObjectSet(Label, OBJPROP_YDISTANCE, PozzY);// Êîîðäèíàòà y
ObjectSetText(Label,"MA("+ElderEMA+")MACD("+FastEMA+","+SlowEMA+","+SignalEMA+")",Font_Size,"Arial Black",Aqua); // ("MACD("+FastEMA+","+SlowEMA+","+SignalEMA+")");
WindowRedraw();
}
else
{
if(Lk_2!=0.0)
{
ObjectCreate(Label, OBJ_LABEL, 0, 0, 0);// Ñîçäàíèå îáú.
ObjectSet(Label, OBJPROP_CORNER, 1); // Ïðèâÿçêà óãîë
ObjectSet(Label, OBJPROP_XDISTANCE, PozzX);// Êîîðäèíàòà Õ
ObjectSet(Label, OBJPROP_YDISTANCE, PozzY);// Êîîðäèíàòà y
ObjectSetText(Label,"MA("+ElderEMA+")MACD("+FastEMA+","+SlowEMA+","+SignalEMA+")",Font_Size,"Arial Black",Magenta);
WindowRedraw();
}
else
{
ObjectCreate(Label, OBJ_LABEL, 0, 0, 0);// Ñîçäàíèå îáú.
ObjectSet(Label, OBJPROP_CORNER, 1); // Ïðèâÿçêà óãîë
ObjectSet(Label, OBJPROP_XDISTANCE, PozzX);// Êîîðäèíàòà Õ
ObjectSet(Label, OBJPROP_YDISTANCE, PozzY);// Êîîðäèíàòà y
ObjectSetText(Label,"MA("+ElderEMA+")MACD("+FastEMA+","+SlowEMA+","+SignalEMA+")",Font_Size,"Arial Black",Purple);
WindowRedraw();
}
}
}
return(0);
}
//+------------------------------------------------------------------+
Comments