Page 1 sur 1

All RSI

Publié : 20 mai 2010, 15:21
par jmrt
Un petit indicateur libre de tous droits.
Si vous aimez, consommez.
Si vous trouvez ce machin correct, dites-le moi , j’en posterai d’autres de temps en temps.

//+------------------------------------------------------------------+
//| All RSI.mq4 |
//| binladen |
//+------------------------------------------------------------------+
#property copyright "binladen"
#property link ""
#define indicatorName "All RSI"
//----
#property indicator_separate_window
#property indicator_minimum 0
#property indicator_maximum 100
#property indicator_buffers 1
#property indicator_color1 Gold
#property indicator_level1 30
#property indicator_level2 70
#property indicator_levelcolor DimGray
//---- input parameters
extern int RSIperiod =14;
extern int AppliedPrice =0;
extern bool showHigherTimeframes=true;
extern int barsPerTimeFrame =35;
extern bool shiftRight =False;
extern color txtColor =Silver;
extern color separatorColor =DimGray;
//---- buffers
double ExtMapBuffer1[];
//----
string shortName;
string labelsShort[] ={"M1","M5","M15","M30","H1","H4","D1"};
string labelsLong[] ={"M15","M30","H1","H4","D1","W1","MN1"};
string labels[];
int periodsShort[]={PERIOD_M1,PERIOD_M5,PERIOD_M15,PERIOD_M30,PERIOD_H1,PERIOD_H4,PERIOD_D1};
int periodsLong[] ={PERIOD_M15,PERIOD_M30,PERIOD_H1,PERIOD_H4,PERIOD_D1,PERIOD_W1,PERIOD_MN1};
int periods[];
int Shift;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
if (shiftRight) Shift=1;
else Shift=0;
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexShift(0,Shift*(barsPerTimeFrame+1));
SetIndexLabel(0,"RSI");
//----
barsPerTimeFrame =MathMax(barsPerTimeFrame,30);
shortName=indicatorName+" ("+RSIperiod+")";
IndicatorShortName(shortName);
if (showHigherTimeframes)
{
ArrayCopy(labels,labelsLong);
ArrayCopy(periods,periodsLong);
}
else
{
ArrayCopy(labels,labelsShort);
ArrayCopy(periods,periodsShort);
}
//----
for(int i=1;i<7;i++)
if (Period()==periods)
{
string tmpLbl=labels;
int tmpPer=periods;
//----
for(int k=i ;k>0; k--)
{
labels[k] =labels[k-1];
periods[k]=periods[k-1];
}
labels[0] =tmpLbl;
periods[0]=tmpPer;
}
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
for(int l=0;l<7;l++)
{
ObjectDelete(indicatorName+l);
ObjectDelete(indicatorName+l+1);
}
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
string on;
int wn=WindowFind(shortName);
int k=0;
//----
for(int p=0; p<7;p++)
{
for(int i=0; i<barsPerTimeFrame;i++,k++)
ExtMapBuffer1[k]=iRSI(NULL,periods[p],RSIperiod,AppliedPrice,i);
ExtMapBuffer1[k]=EMPTY_VALUE; k+=1;
//----
on=indicatorName+p;
if(ObjectFind(on)==-1)
ObjectCreate(on,OBJ_TREND,wn,0,0);
ObjectSet(on,OBJPROP_TIME1,myTime(k-Shift*(barsPerTimeFrame+1)-1));
ObjectSet(on,OBJPROP_TIME2,myTime(k-Shift*(barsPerTimeFrame+1)-1));
ObjectSet(on,OBJPROP_PRICE1, 0);
ObjectSet(on,OBJPROP_PRICE2,100);
ObjectSet(on,OBJPROP_COLOR ,separatorColor);
ObjectSet(on,OBJPROP_WIDTH ,2);
on=indicatorName+p+1;
if(ObjectFind(on)==-1)
ObjectCreate(on,OBJ_TEXT,wn,0,0);
ObjectSet(on,OBJPROP_TIME1,myTime(k-Shift*(barsPerTimeFrame+1)-6));
ObjectSet(on,OBJPROP_PRICE1,100);
ObjectSetText(on,labels[p],9,"Arial",txtColor);
}
//----
SetIndexDrawBegin(0,Bars-k);
return(0);
}
//+------------------------------------------------------------------+
//+ Custom functions and procedures +
//+------------------------------------------------------------------+
int myTime(int a)
{
if(a<0)
return(Time[0]+Period()*60*MathAbs(a));
else return(Time[a]);
}
//+------------------------------------------------------------------+

Re: All RSI

Publié : 20 mai 2010, 17:07
par Jerem
Merci pour le All RSI, je cherchais justement un indic comme ça.
J'ai utilisé ton code pour me faire un All Stochastic aussi ;)

Si d'après les retours l'indicateur est bon, je le posterai ou si ça t'intéresse n'hésite pas ;)

Re: All RSI

Publié : 20 mai 2010, 17:17
par Didger
Jerem a écrit :Merci pour le All RSI, je cherchais justement un indic comme ça.
J'ai utilisé ton code pour me faire un All Stochastic aussi ;)

Si d'après les retours l'indicateur est bon, je le posterai ou si ça t'intéresse n'hésite pas ;)
Merci jmrt pour l'indicateur qui est tres pratique. :lol:
Par contre je suis également preneur pour la version MACD... :wink:

Merci

Re: All RSI

Publié : 20 mai 2010, 17:36
par jmrt
graphique

Re: All RSI

Publié : 20 mai 2010, 17:45
par Jerem
Voilà je viens de faire le All MACD,

J'ai repris le code de jmrt (merci à lui)
alors il y a peut-etre des variables non utilisées (je n'ai pas checké les différences entre variables MACD et RSI)

Dis moi ce que tu en penses ;)

Re: All RSI

Publié : 20 mai 2010, 18:18
par Didger
Jerem a écrit :Voilà je viens de faire le All MACD,

J'ai repris le code de jmrt (merci à lui)
alors il y a peut-etre des variables non utilisées (je n'ai pas checké les différences entre variables MACD et RSI)

Dis moi ce que tu en penses ;)
C'est bizzar, je n'ai pas l'UT sur le graphique

Re: All RSI

Publié : 20 mai 2010, 18:31
par Didger
Il me vient une question :roll:

Est il possible de modifier n'importe quel indicateur,afin l'utiliser en multi Time :?:

Merci

Re: All RSI

Publié : 20 mai 2010, 22:01
par Jerem
l'UT ? désolé je suis débutant... ;)

Je pense que l'on peu modifier tous les indicateurs ouai ;)

Re: All RSI

Publié : 20 mai 2010, 22:24
par Didger
Jerem a écrit :l'UT ? désolé je suis débutant... ;)

Je pense que l'on peu modifier tous les indicateurs ouai ;)
Et bien, pour un débutant c'est un bon début !!!

Merci beaucoup,

et avis aux experts :wink:

Re: All RSI

Publié : 20 mai 2010, 23:09
par Jerem
Je n'ai que 1 semaine d'experience lol
Mais je taff dans l'informatique, et developper forcement, c'est pas compliquer... ;)

tu peux me dire ce que c'est l'UT ? (Ultimate Trade ?? lol) Unité de Temps ?
Didger a écrit :
Jerem a écrit :l'UT ? désolé je suis débutant... ;)

Je pense que l'on peu modifier tous les indicateurs ouai ;)
Et bien, pour un débutant c'est un bon début !!!

Merci beaucoup,

et avis aux experts :wink:

Re: All RSI

Publié : 20 mai 2010, 23:25
par Guntablier
Question candide, comment l'intégrer sur MT4 ? :oops:

Re: All RSI

Publié : 20 mai 2010, 23:58
par jmrt
Jerem
ton indicateur est correct mais il manque une décimale (pas obligatoire)
et maintenant il te reste le stochastique 14, 3, 3, à faire (hehe!)
Je verrai encore ce week end pas le temps maintenant

Re: All RSI

Publié : 21 mai 2010, 00:52
par jmrt
Ne t'acharne pas stp sur le MACD classique qui est beaucoup trop laggy (retard de 2, 3, 4 bougies)
Je n'utilise pas les MACD sous cette forme ni aucune MACD en tant que telle. Il faut un machin très réactif surtout si l'UT est courte. (30, 15, 5 minutes c'est court)
Il vaudrait mieux prendre une MACD jurik ou Zerolag ou Hull ou autre ( je ne sais pas quoi car je n'utilise pas)
par contre je crois une stochastic 14, 3, 3 (paramétrable) pourrait être très intéressante surtout si elle est mise en relation avec les Bollinger adéquates ou les canaux de Donchian corrects.

a+

Re: All RSI

Publié : 21 mai 2010, 01:09
par jmrt
voici une relation Bollinger Stochastic mal construite (imprécise) mais c'est la piste à développer à mon avis sous cette forme ou une autre
Un report de la stochastic sur la courbe des prix serait sans doute à examiner aussi

#property copyright "Copyright © 2007, Matt Edmonds."
#property link "matt.edmonds@gmail.com"
//---- indicator settings
#property indicator_separate_window
#property indicator_buffers 4
#property indicator_color1 Yellow
#property indicator_color2 White
#property indicator_color3 White
#property indicator_color4 White



extern int StochasticPeriod=1;
extern int BollingerPeriod=10; // 20 , 50
extern int BollingerDeviation = 1; // 2
extern int BollingerShift = 0;

//---- indicator buffers
double Stochastic[];
double BollingerUpper[];
double BollingerLower[];
double BollingerMiddle[];


//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- 2 additional buffers are used for counting.
IndicatorBuffers(4);

//---- drawing settings
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,2);
SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,1);
SetIndexStyle(2,DRAW_LINE,STYLE_SOLID,1);
SetIndexStyle(3,DRAW_LINE,STYLE_DOT,1);

SetIndexBuffer(0,Stochastic);
SetIndexLabel(0,"Stochastic Bollinger Bands");
SetIndexBuffer(1,BollingerUpper);
SetIndexBuffer(2,BollingerLower);
SetIndexBuffer(3,BollingerMiddle);
SetIndexLabel(3,"Bollinger Middle");

//---- name for DataWindow and indicator subwindow label
IndicatorShortName("Stochastic Bollinger Bands");

//---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| Calculations |
//+------------------------------------------------------------------+
int start()
{
int limit;
int i;
int counted_bars=IndicatorCounted();
//---- check for possible errors
if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;

//---- main loop
for(i=0; i<Bars; i++)
{
Stochastic= iStochastic(NULL, 0, StochasticPeriod, 1, 3, MODE_SMA, 0, MODE_MAIN, i);
}

//---- done

for(i=0; i<Bars; i++)
{
BollingerLower = iBandsOnArray(Stochastic,0,BollingerPeriod,BollingerDeviation,BollingerShift,MODE_LOWER,i);
BollingerUpper = iBandsOnArray(Stochastic,0,BollingerPeriod,BollingerDeviation,BollingerShift,MODE_UPPER,i);
BollingerMiddle = iBandsOnArray(Stochastic,0,BollingerPeriod,BollingerDeviation,BollingerShift,MODE_MAIN,i);
}

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

Re: All RSI

Publié : 21 mai 2010, 09:11
par Jerem
Voilà le All Stochastic ;)

Re: All RSI

Publié : 21 mai 2010, 16:26
par jmrt
congratulations. Cela me semble correct le all sto.
je regarde à fond ce week-end
thx pour ton travail
on parle interprétation stochastic ce weekend si tu veux bien.
a+

Re: All RSI

Publié : 22 mai 2010, 00:37
par jmrt
es-tu certain que ton all stochastic all renvoie les valeurs exactes ?
comparaison à faire avec le stochastic de mt4
a+

Re: All RSI

Publié : 25 mai 2010, 11:32
par Jerem
Oui je l'ai testé avec le Stochastic de MT4, et les graph coincident.
Mais sur le All Stoch, les courbes sont un peu plus "optues"

Re: All RSI

Publié : 25 mai 2010, 23:19
par jmrt
si tu dis c'est juste , je te crois
thx pour l'indic