Voici un indicateur génial trouvé sur un forum francophone mais malheureusement il ne possède pas d'alerte et c'est bien dommage ne trouvez vous pas ?
Ensuite il y a moyen de travailler dessus en d'en faire quelque chose de bien sympathique :)
Il s'agit de l'indicateur waddah attar modifié par quelqu'un de talentueux, il a couplé les trois TF en un indicateur,
la ligne "adaptivesignal" permet de filtrer les signaux, c'est a dire que le signal traverse la ligne que lorsqu'il est validé sur les trois TF définis auparavant dans les paramètre.
le paramètre TFfactor permet de mettre en avant l'importance d'un TF par rapport aux autres, dans l'ordre 1 , 0.4 et 0.1;
Je souhaite avoir une alerte dessus mais pas comme celle de waddah original, vous savez la sonnerie qui retenti 100fois en 10secondes seulement une fois avec une petite fenêtre me disant buy or shell.
Ensuite il y'a d'autre chose que l'on pourrait faire avec ce petit bijou comme un EA mais patience.
Ensuite il y a moyen de travailler dessus en d'en faire quelque chose de bien sympathique :)
Il s'agit de l'indicateur waddah attar modifié par quelqu'un de talentueux, il a couplé les trois TF en un indicateur,
la ligne "adaptivesignal" permet de filtrer les signaux, c'est a dire que le signal traverse la ligne que lorsqu'il est validé sur les trois TF définis auparavant dans les paramètre.
le paramètre TFfactor permet de mettre en avant l'importance d'un TF par rapport aux autres, dans l'ordre 1 , 0.4 et 0.1;
Je souhaite avoir une alerte dessus mais pas comme celle de waddah original, vous savez la sonnerie qui retenti 100fois en 10secondes seulement une fois avec une petite fenêtre me disant buy or shell.
Ensuite il y'a d'autre chose que l'on pourrait faire avec ce petit bijou comme un EA mais patience.
Code
//+------------------------------------------------------------------+
//| AUTOFOREX.FR-MTF-WaddaAttarSynth-HISTO.mq4 |
//| Copyright © 2013, www.autoforex.fr |
//| E-mail: [email protected] |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2013, AUTOFOREX.FR"
#property link "E-mail: [email protected]"
#property indicator_separate_window
#property indicator_buffers 5
#property indicator_color1 MediumSeaGreen
#property indicator_color2 OrangeRed
#property indicator_color3 White
#property indicator_color4 Chartreuse
#property indicator_color5 Yellow
#property indicator_width1 2
#property indicator_width2 2
#property indicator_width3 1
#property indicator_width4 2
#property indicator_width5 2
//---- input parameters
extern int TF1 = 0;
extern int TF2 = 30;
extern int TF3 = 240;
extern double TF1factor = 1;
extern double TF2factor = 0.4;
extern double TF3factor = 0.1;
extern int MaxBars = 2000;
extern bool AdaptiveSignal = true;
extern bool ShowInfo = true;
extern color InfoTextColor = White;
//---- indicator buffers
double Long[];
double Short[];
double MidLong[];
double MidShort[];
double Signal[];
//---- divers
color TF1color,TF2color,TF3color;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
string short_name;
string version;
//---- indicator line
SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexStyle(1,DRAW_HISTOGRAM);
SetIndexStyle(2,DRAW_LINE);
SetIndexStyle(3,DRAW_HISTOGRAM);
SetIndexStyle(4,DRAW_HISTOGRAM);
IndicatorBuffers(5);
SetIndexBuffer(0,Long);
SetIndexBuffer(1,Short);
SetIndexBuffer(2,Signal);
SetIndexBuffer(3,MidLong);
SetIndexBuffer(4,MidShort);
SetIndexEmptyValue(0,0.0);
SetIndexEmptyValue(1,0.0);
SetIndexEmptyValue(2,0.0);
SetIndexEmptyValue(3,0.0);
SetIndexEmptyValue(4,0.0);
IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS));
//---- name for DataWindow and indicator subwindow label
short_name="WWW.AUTOFOREX.FR - MTF-WaddaAttarSynth-HISTO";
version=" v1.1";
IndicatorShortName(short_name+version);
SetIndexLabel(0,"MTF-WaddaAttarExplo_Synth");
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
string short_name="WWW.AUTOFOREX.FR - MTF-WaddaAttarSynth-HISTO";
string version=" v1.1";
int win_idx=WindowFind(short_name+version);
ObjectsDeleteAll(win_idx);
//----
return(0);
}
//+------------------------------------------------------------------+
//| #AF_MTF-WaddaAttarExplo_Synth |
//+------------------------------------------------------------------+
int start()
{
double Explo1, Explo2, Explo3, Explo4, Explo5, Explo6, Signal1, Signal2, Signal3;
//---- main loop
for (int i=MaxBars; i>=0; i--)
{
// LONG
Explo1 = iCustom(NULL,0,"MTF_Waddah_Attar_ExplosionSA",TF1,150,15,15,15,false,20,false,false,false,false,0,i);
Explo2 = iCustom(NULL,0,"MTF_Waddah_Attar_ExplosionSA",TF2,150,15,15,15,false,20,false,false,false,false,0,i);
Explo3 = iCustom(NULL,0,"MTF_Waddah_Attar_ExplosionSA",TF3,150,15,15,15,false,20,false,false,false,false,0,i);
// SHORT
Explo4 = iCustom(NULL,0,"MTF_Waddah_Attar_ExplosionSA",TF1,150,15,15,15,false,20,false,false,false,false,1,i);
Explo5 = iCustom(NULL,0,"MTF_Waddah_Attar_ExplosionSA",TF2,150,15,15,15,false,20,false,false,false,false,1,i);
Explo6 = iCustom(NULL,0,"MTF_Waddah_Attar_ExplosionSA",TF3,150,15,15,15,false,20,false,false,false,false,1,i);
// SIGNAL LINE
Signal1 = iCustom(NULL,0,"MTF_Waddah_Attar_ExplosionSA",TF1,150,15,15,15,false,20,false,false,false,false,2,i);
Signal2 = iCustom(NULL,0,"MTF_Waddah_Attar_ExplosionSA",TF2,150,15,15,15,false,20,false,false,false,false,2,i);
Signal3 = iCustom(NULL,0,"MTF_Waddah_Attar_ExplosionSA",TF3,150,15,15,15,false,20,false,false,false,false,2,i);
if((Explo1>Explo4) && (Explo2>Explo5) && (Explo3>Explo6)) {
Long[i] = Explo1*TF1factor+Explo2*TF2factor+Explo3*TF3factor;
Short[i] = 0;
MidLong[i] = 0;
MidShort[i] = 0;
}
else
{
if((Explo1<Explo4) && (Explo2<Explo5) && (Explo3<Explo6)) {
Long[i] = 0;
Short[i] = Explo4*TF1factor+Explo5*TF2factor+Explo6*TF3factor;
MidLong[i] = 0;
MidShort[i] = 0;
}
else
{
if((Explo1<Explo4) && (Explo2>Explo5) && (Explo3>Explo6)) {
Long[i] = 0;
MidLong[i] = Explo1*TF1factor+Explo2*TF2factor+Explo3*TF3factor;
Short[i] = 0;
MidShort[i] = 0;
}
else
{
if((Explo1>Explo4) && (Explo2<Explo5) && (Explo3>Explo6)) {
Long[i] = 0;
MidLong[i] = Explo1*TF1factor+Explo2*TF2factor+Explo3*TF3factor;
Short[i] = 0;
MidShort[i] = 0;
}
else
{
if((Explo1>Explo4) && (Explo2<Explo5) && (Explo3<Explo6)) {
Long[i] = 0;
MidLong[i] = 0;
MidShort[i] = Explo4*TF1factor+Explo5*TF2factor+Explo6*TF3factor;
Short[i] = 0;
}
else
{
if((Explo1<Explo4) && (Explo2>Explo5) && (Explo3<Explo6)) {
Long[i] = 0;
MidLong[i] = 0;
MidShort[i] = Explo4*TF1factor+Explo5*TF2factor+Explo6*TF3factor;
Short[i] = 0;
}
else
{
Long[i] = 0;
Short[i] = 0;
MidLong[i] = 0;
MidShort[i] = 0;
}
}
}
}
}
}
Signal[i] = Signal1*TF1factor+Signal2*TF2factor+Signal3*TF3factor;
if (AdaptiveSignal) {
if ((Short[i] !=0 || MidShort[i] !=0) && (Explo4 < Signal1 || Explo5<Signal2)) {
Signal[i] = (Explo4*TF1factor+Explo5*TF2factor+Explo6*TF3factor);
}
else
{
if ((Long[i] !=0 || MidLong[i] !=0) && (Explo1 < Signal1 || Explo2<Signal2)) {
Signal[i] = (Explo1*TF1factor+Explo2*TF2factor+Explo3*TF3factor);
}
}
}
}
/////////////////////// informations
if(ShowInfo) {
string short_name="WWW.AUTOFOREX.FR - MTF-WaddaAttarSynth-HISTO";
string version=" v1.1";
int win_idx=WindowFind(short_name+version);
string TF1text = TF1;
string TF2text = TF2;
string TF3text = TF3;
if(Explo1>Explo4) TF1color=Green;
if(Explo2>Explo5) TF2color=Green;
if(Explo3>Explo6) TF3color=Green;
if(Explo1<Explo4) TF1color=Red;
if(Explo2<Explo5) TF2color=Red;
if(Explo3<Explo6) TF3color=Red;
// *** TREND ***
//Trend title
ObjectCreate("trendtext",OBJ_LABEL,win_idx,0,0,0,0);
ObjectSet("trendtext",OBJPROP_CORNER,1);
ObjectSet("trendtext",OBJPROP_XDISTANCE,20+12);
ObjectSet("trendtext",OBJPROP_YDISTANCE,10);
ObjectSetText("trendtext",">TREND",11,"Arial Black",InfoTextColor);
//TF1 trend
ObjectCreate("signal"+TF1,OBJ_LABEL,win_idx,0,0,0,0);
ObjectSet("signal"+TF1,OBJPROP_CORNER,1);
ObjectSet("signal"+TF1,OBJPROP_XDISTANCE,20+12);
ObjectSet("signal"+TF1,OBJPROP_YDISTANCE,40);
ObjectSetText("signal"+TF1,CharToStr(110),20,"Wingdings",TF1color);
ObjectCreate("textPeriod"+TF1,OBJ_LABEL,win_idx,0,0,0,0);
ObjectSet("textPeriod"+TF1,OBJPROP_CORNER,1);
ObjectSet("textPeriod"+TF1,OBJPROP_XDISTANCE,20+12);
ObjectSet("textPeriod"+TF1,OBJPROP_YDISTANCE,30);
ObjectSetText("textPeriod"+TF1,TF1text,8,"Tahoma",TF1color);
//TF2 trend
ObjectCreate("signal"+TF2,OBJ_LABEL,win_idx,0,0,0,0);
ObjectSet("signal"+TF2,OBJPROP_CORNER,1);
ObjectSet("signal"+TF2,OBJPROP_XDISTANCE,40+24);
ObjectSet("signal"+TF2,OBJPROP_YDISTANCE,40);
ObjectSetText("signal"+TF2,CharToStr(110),20,"Wingdings",TF2color);
ObjectCreate("textPeriod"+TF2,OBJ_LABEL,win_idx,0,0,0,0);
ObjectSet("textPeriod"+TF2,OBJPROP_CORNER,1);
ObjectSet("textPeriod"+TF2,OBJPROP_XDISTANCE,40+24);
ObjectSet("textPeriod"+TF2,OBJPROP_YDISTANCE,30);
ObjectSetText("textPeriod"+TF2,TF2text,8,"Tahoma",TF2color);
//TF3 trend
ObjectCreate("signal"+TF3,OBJ_LABEL,win_idx,0,0,0,0);
ObjectSet("signal"+TF3,OBJPROP_CORNER,1);
ObjectSet("signal"+TF3,OBJPROP_XDISTANCE,60+36);
ObjectSet("signal"+TF3,OBJPROP_YDISTANCE,40);
ObjectSetText("signal"+TF3,CharToStr(110),20,"Wingdings",TF3color);
ObjectCreate("textPeriod"+TF3,OBJ_LABEL,win_idx,0,0,0,0);
ObjectSet("textPeriod"+TF3,OBJPROP_CORNER,1);
ObjectSet("textPeriod"+TF3,OBJPROP_XDISTANCE,60+36);
ObjectSet("textPeriod"+TF3,OBJPROP_YDISTANCE,30);
ObjectSetText("textPeriod"+TF3,TF3text,8,"Tahoma",TF3color);
}
return(0);
}
Modifié le 2013-06-13 18:48:03 par
AliX