Easy Trading
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
Le Deal du moment : -34%
-34% LG OLED55B3 – TV OLED 4K 55″ 2023 ...
Voir le deal
919 €

Aller en bas
avatar
Gaspar1
membres
membres
Messages : 3
Date d'inscription : 08/11/2009

Cycles.mq4 Empty Cycles.mq4

11/11/2009, 5:45 pm
Cycles sous mt4 :

//+------------------------------------------------------------------+
//| Cycles.mq4 |
//| FCognet |
//| |
//+------------------------------------------------------------------+
#property copyright "Eric Lefort"
#property link "http://www.pro-at.com"
#property indicator_separate_window
#property indicator_buffers 7
#property indicator_color7 Yellow
//---- buffers
double Cycle[];
double Buffer1[];
double Buffer2[];
double Buffer3[];
double Buffer4[];
double STPMT[];
double STPMT_MA[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init() {
string short_name;
short_name="Cycles";
IndicatorShortName(short_name);
//---- indicators
IndicatorBuffers(7);
SetIndexBuffer(0, Buffer1);
SetIndexBuffer(1, Buffer2);
SetIndexBuffer(2, Buffer3);
SetIndexBuffer(3, Buffer4);
SetIndexBuffer(4, STPMT);
SetIndexBuffer(5, STPMT_MA);
SetIndexBuffer(6, Cycle);
SetIndexStyle(0, DRAW_NONE);
SetIndexStyle(1, DRAW_NONE);
SetIndexStyle(2, DRAW_NONE);
SetIndexStyle(3, DRAW_NONE);
SetIndexStyle(4, DRAW_NONE);
SetIndexStyle(5, DRAW_NONE);
SetIndexStyle(6, DRAW_LINE, EMPTY, 1);
//----
return(0);
}
//+------------------------------------------------------------------+
//| iteration function |
//+------------------------------------------------------------------+
int start() {
int index = 0;
int counted_bars=IndicatorCounted();
int limit = Bars - counted_bars;
for(index=0;index<limit;index++) {
Buffer1[index] = iStochastic( NULL, 0, 5, 3, 3, MODE_SMA, 0, MODE_SIGNAL, index);
Buffer2[index] = iStochastic( NULL, 0, 14, 3, 3, MODE_SMA, 0, MODE_SIGNAL, index);
Buffer3[index] = iStochastic( NULL, 0, 45, 14, 3, MODE_SMA, 0, MODE_SIGNAL, index);
Buffer4[index] = iStochastic( NULL, 0, 75, 20, 3, MODE_SMA, 0, MODE_SIGNAL, index);
STPMT[index] = (4.1 * Buffer1[index] + 2.5 * Buffer2[index] + Buffer3[index] + 4 * Buffer4[index]) / 11.6;
}
for(index=0;index<limit;index++) {
STPMT_MA[index] = iMAOnArray(STPMT, 0, 9, 0, MODE_SMA, index);
Cycle[index] = STPMT[index] - STPMT_MA[index];
}
return(0);
}
avatar
Gaspar1
membres
membres
Messages : 3
Date d'inscription : 08/11/2009

Cycles.mq4 Empty Re: Cycles.mq4

11/11/2009, 10:14 pm
Repulse:


//+------------------------------------------------------------------+
//| Repulse.mq4 |
//| FCognet |
//| |
//+------------------------------------------------------------------+
#property copyright "Eric Lefort"
#property link "http://www.pro-at.com"

#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Gray
#property indicator_color2 Yellow
#property indicator_color3 Cyan

//---- input parameters
extern int RepulsePeriod1=1;
extern int RepulsePeriod2=5;
extern int RepulsePeriod3=15;
//---- buffers
double RepulseBuffer1[];
double RepulseBuffer2[];
double RepulseBuffer3[];
double PosBuffer[];
double NegBuffer[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init() {
string short_name;
short_name="Repulse("+RepulsePeriod1+", "+RepulsePeriod2+", "+RepulsePeriod3+")";
IndicatorShortName(short_name);
//---- indicators
IndicatorBuffers(5);
SetIndexBuffer(0,RepulseBuffer1);
SetIndexBuffer(1,RepulseBuffer2);
SetIndexBuffer(2,RepulseBuffer3);
SetIndexBuffer(3,PosBuffer);
SetIndexBuffer(4,NegBuffer);

SetIndexStyle(0,DRAW_LINE);
SetIndexStyle(1,DRAW_LINE);
SetIndexStyle(2,DRAW_LINE);
SetIndexStyle(3,DRAW_NONE);
SetIndexStyle(4,DRAW_NONE);

SetLevelValue(0,0);
SetLevelStyle(STYLE_DOT,0,DimGray);

//----
return(0);
}

//+------------------------------------------------------------------+
//| iteration function |
//+------------------------------------------------------------------+
int start() {
double forceHaussiere, forceBaissiere;

int index = 0;
int counted_bars=IndicatorCounted();

int limit = Bars - counted_bars;

// Repulse1
for(index=0;indexPosBuffer[index] = ((((3*Close[index])-(2*getLow(index, RepulsePeriod1))-Open[index])/Close[index])*100);
NegBuffer[index] = (((Open[index]+(2*getHigh(index, RepulsePeriod1))-(3*Close[index]))/Close[index])*100);
}
for(index=0;indexforceHaussiere=iMAOnArray(PosBuffer, 0, RepulsePeriod1 * 5, 0, MODE_EMA, index);
forceBaissiere=iMAOnArray(NegBuffer, 0, RepulsePeriod1 * 5, 0, MODE_EMA, index);
RepulseBuffer1[index]=forceHaussiere-forceBaissiere;
}

// Repulse2
for(index=0;indexPosBuffer[index] = ((((3*Close[index])-(2*getLow(index, RepulsePeriod2))-Open[index+RepulsePeriod2])/Close[index])*100);
NegBuffer[index] = (((Open[index+RepulsePeriod2]+(2*getHigh(index, RepulsePeriod2))-(3*Close[index]))/Close[index])*100);
}
for(index=0;indexforceHaussiere=iMAOnArray(PosBuffer, 0, RepulsePeriod2 * 5, 0, MODE_EMA, index);
forceBaissiere=iMAOnArray(NegBuffer, 0, RepulsePeriod2 * 5, 0, MODE_EMA, index);
RepulseBuffer2[index]=forceHaussiere-forceBaissiere;
}

// Repulse3
for(index=0;indexPosBuffer[index] = ((((3*Close[index])-(2*getLow(index, RepulsePeriod3))-Open[index+RepulsePeriod3])/Close[index])*100);
NegBuffer[index] = (((Open[index+RepulsePeriod3]+(2*getHigh(index, RepulsePeriod3))-(3*Close[index]))/Close[index])*100);
}
for(index=0;indexforceHaussiere=iMAOnArray(PosBuffer, 0, RepulsePeriod3 * 5, 0, MODE_EMA, index);
forceBaissiere=iMAOnArray(NegBuffer, 0, RepulsePeriod3 * 5, 0, MODE_EMA, index);
RepulseBuffer3[index]=forceHaussiere-forceBaissiere;
}
return(0);
}

//+------------------------------------------------------------------+
double getLow(int from, int period) {
double low = 9999999999;
for (int index=from; index<=from+period; index++) {
if (low > Low[index]) {
low = Low[index];
}
}
return (low);
}

double getHigh(int from, int period) {
double high = 0;
for (int index=from; index<=from+period; index++) {
if (high < High[index]) {
high = High[index];
}
}
return (high);
}
avatar
Gaspar1
membres
membres
Messages : 3
Date d'inscription : 08/11/2009

Cycles.mq4 Empty Re: Cycles.mq4

11/11/2009, 10:16 pm
Supports résistances :


//+------------------------------------------------------------------+
//| #MTF SR.mq4 |
//| Copyright ©️ 2006, Eli hayun |
//| http://www.elihayun.com |
//+------------------------------------------------------------------+
#property copyright "Copyright ©️ 2006, Eli hayun"
#property link "http://www.elihayun.com"
//----
#property indicator_chart_window
#property indicator_buffers 8
#property indicator_color1 Red
#property indicator_color2 Blue
#property indicator_color3 Red
#property indicator_color4 Blue
#property indicator_color5 Red
#property indicator_color6 Blue
#property indicator_color7 Red
#property indicator_color8 Blue
//---- buffers
double buf_up1D[];
double buf_down1D[];
double buf_up4H[];
double buf_down4H[];
double buf_up1H[];
double buf_down1H[];
double buf_up30M[];
double buf_down30M[];
//----
extern int Period_1=PERIOD_M1;
extern int Period_2=PERIOD_M5;
extern int Period_3=PERIOD_M15;
extern int Period_4=PERIOD_M30;
//----
extern bool display_Period_1=true;
extern bool display_Period_2=true;
extern bool display_Period_3=true;
extern bool display_Period_4=true;
extern bool Play_Sound=true;
//----
int UniqueNum=2284;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
int draw=DRAW_LINE; if (!display_Period_4) draw=DRAW_NONE;
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0,169);
SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(1,169);
//
SetIndexBuffer(0,buf_up1D);
SetIndexBuffer(1,buf_up1D);
SetIndexBuffer(1,buf_down1D);
SetIndexLabel(0, tf2txt(Period_4)); SetIndexLabel(1, tf2txt(Period_4));
//
draw=DRAW_LINE; if (!display_Period_3) draw=DRAW_NONE;
SetIndexStyle(2,DRAW_ARROW);
SetIndexArrow(2,170);
SetIndexStyle(3,DRAW_ARROW);
SetIndexArrow(3,170);
//
SetIndexBuffer(2,buf_up4H);
SetIndexBuffer(3,buf_down4H);
SetIndexLabel(2, tf2txt(Period_3)); SetIndexLabel(3, tf2txt(Period_3));
//
draw=DRAW_LINE; if (!display_Period_2) draw=DRAW_NONE;
SetIndexStyle(4,DRAW_ARROW);
SetIndexArrow(4,171);
SetIndexStyle(5,DRAW_ARROW);
SetIndexArrow(5,171);
//
SetIndexBuffer(4,buf_up1H);
SetIndexBuffer(5,buf_down1H);
SetIndexLabel(4, tf2txt(Period_2)); SetIndexLabel(5, tf2txt(Period_2));
//
draw=DRAW_LINE; if (!display_Period_1) draw=DRAW_NONE;
SetIndexStyle(6,DRAW_ARROW);
SetIndexArrow(6,172);
SetIndexStyle(7,DRAW_ARROW);
SetIndexArrow(7,172);
//
SetIndexBuffer(6,buf_up30M);
SetIndexBuffer(7,buf_down30M);
SetIndexLabel(6, tf2txt(Period_1)); SetIndexLabel(7, tf2txt(Period_1));
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
int i=0, y1d=0, y4h=0, y1h=0, y30m=0;
int limit=Bars-counted_bars;
//----
double pd_1=0, pd_2=0, pd_3=0, pd_4=0;
double pu_1=0, pu_2=0, pu_3=0, pu_4=0;
datetime TimeArray_1D[] ,TimeArray_4H[], TimeArray_1H[], TimeArray_30M[];
//----
ArrayCopySeries(TimeArray_1D,MODE_TIME,Symbol(),Period_4);
ArrayCopySeries(TimeArray_4H,MODE_TIME,Symbol(),Period_3);
ArrayCopySeries(TimeArray_1H,MODE_TIME,Symbol(),Period_2);
ArrayCopySeries(TimeArray_30M,MODE_TIME,Symbol(),Period_1);
//----
for(i=0, y1d=0, y4h=0, y1h=0, y30m=0;i {
if (Time[i] if (Time[i] if (Time[i] if (Time[i]//----
double fh=iFractals( NULL, Period_4, MODE_HIGH, y1d);
buf_up1D[i]=fh;
buf_down1D[i]=iFractals( NULL, Period_4, MODE_LOW, y1d);
buf_up4H[i]=iFractals( NULL, Period_3, MODE_HIGH, y4h);
buf_down4H[i]=iFractals( NULL, Period_3, MODE_LOW, y4h);
buf_up1H[i]=iFractals( NULL, Period_2, MODE_HIGH, y1h);
buf_down1H[i]=iFractals( NULL, Period_2, MODE_LOW, y1h);
buf_up30M[i]=iFractals( NULL, Period_1, MODE_HIGH, y30m);
buf_down30M[i]=iFractals( NULL, Period_1, MODE_LOW, y30m);
}
for(i=limit; i>=0; i--)
{
if(buf_up1D[i]==0) buf_up1D[i]=pu_1; else pu_1=buf_up1D[i];
if(buf_down1D[i]==0)buf_down1D[i]=pd_1; else pd_1=buf_down1D[i];
if(buf_up4H[i]==0) buf_up4H[i]=pu_2; else pu_2=buf_up4H[i];
if(buf_down4H[i]==0)buf_down4H[i]=pd_2; else pd_2=buf_down4H[i];
if(buf_up1H[i]==0) buf_up1H[i]=pu_3; else pu_3=buf_up1H[i];
if(buf_down1H[i]==0)buf_down1H[i]=pd_3; else pd_3=buf_down1H[i];
if(buf_up30M[i]==0) buf_up30M[i]=pu_4; else pu_4=buf_up30M[i];
if(buf_down30M[i]==0)buf_down30M[i]=pd_4; else pd_4=buf_down30M[i];
}
//----
return(0);
}
//+------------------------------------------------------------------+
string tf2txt(int tf)
{
if (tf==PERIOD_M1) return("M1");
if (tf==PERIOD_M5) return("M5");
if (tf==PERIOD_M15) return("M15");
if (tf==PERIOD_M30) return("M30");
if (tf==PERIOD_H1) return("H1");
if (tf==PERIOD_H4) return("H4");
if (tf==PERIOD_D1) return("D1");
if (tf==PERIOD_W1) return("W1");
if (tf==PERIOD_MN1) return("MN1");
//----
return("??");
}
//+------------------------------------------------------------------+
Contenu sponsorisé

Cycles.mq4 Empty Re: Cycles.mq4

Revenir en haut
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum