Aide au codage - page 555

 
mntiwana:
Très chère MLADEN,

merci patron, donc dans ce cas, le code pourrait être comme ceci ? merci de me corriger,

salutations

===================================================================

code original "simple MA cross EA

//

#define _doNothing 0

#define _doBuy 1

#define _doSell 2

int start()

{

int doWhat = _doNothing ;

double diffc = iMA(NULL,0,Ma1Period,0,Ma1Method,Ma1Price,BarToUse) -iMA(NULL,0,Ma2Period,0,Ma2Method,Ma2Price,BarToUse) ;

double diffp = iMA(NULL,0,Ma1Period,0,Ma1Method,Ma1Price,BarToUse+1)-iMA(NULL,0,Ma2Period,0,Ma2Method,Ma2Price,BarToUse+1) ;

si ((diffc*diffp)<0)

si (diffc>0)

doWhat = _doBuy ;

sinon doWhat = _doSell ;

si (doWhat==_doNothing) return(0) ;

//

================================================

modifié de cette façon

#define _doNothing 0

#define _doBuy 1

#define _doSell 2

int start()

{

int doWhat = _doNothing ;

double diffc = iCustom(NULL,0, "Hull parabolic 2.1",PERIOD_CURRENT,Ma1Period,Ma1Price,2,0 ,0,BarToUse)

-iCustom(NULL,0, "Coque parabolique 2.1",PERIOD_CURRENT,Ma2Period,Ma2Price,2,0 ,0,BarToUse) ;

double diffp = iCustom(NULL,0, "Hull parabolic 2.1",PERIOD_CURRENT,Ma1Period,Ma1Price,2,0 ,0,BarToUse==2)

-iCustom(NULL,0, "Coque parabolique 2.1",PERIOD_CURRENT,Ma2Period,Ma2Price,2,0 ,0,BarToUse==2) ;

si ((diffc*diffp)<0)

si (diffc>0)

doWhat = _doBuy ;

sinon doWhat = _doSell ;

si (doWhat==_doNothing) return(0) ;

//

=====================================

mntiwana

Remplacez ceci :

double diffp = iCustom(NULL,0,"Hull parabolic 2.1",PERIOD_CURRENT,Ma1Period,Ma1Price,2,0 ,0,BarToUse==2)

-iCustom(NULL,0,"Hull parabolic 2.1",PERIOD_CURRENT,Ma2Period,Ma2Price,2,0 ,0,BarToUse==2);[/PHP]

with this :

[PHP]double diffp = iCustom(NULL,0,"Hull parabolic 2.1",PERIOD_CURRENT,Ma1Period,Ma1Price,2,0 ,0,BarToUse+1)

-iCustom(NULL,0,"Hull parabolic 2.1",PERIOD_CURRENT,Ma2Period,Ma2Price,2,0 ,0,BarToUse+1);
 

Aide sur le filtre ADX

Bonjour Pro-Coders,

Je voudrais implémenter un filtre ADX qui filtrerait les conditions de marché latéral et agité.

Si l'ADX est inférieur à 25, il ne doit pas ouvrir de transactions. J'ai codé ce filtre simple :

extern int ADXPeriod=14;

double CurrentADX = iADX(Symbol(),0,ADXPeriod,PRICE_CLOSE,MODE_MAIN,0);

double PreviousADX = iADX(Symbol(),0,ADXPeriod,PRICE_CLOSE,MODE_MAIN,1);

bool ADXfilter=false;

if(CurrentADX>25&&PreviousADX<25)

{

ADXfilter=true;

}

if(ADXfilter=true)

{

BUY();

.

.

SELL();

}

[/CODE]

For some reason the filer is not working. I have put the ADX filter before placing the buy / sell order.

Also putting it to the entry conditions signal is not working.

[CODE]

if(ADXfilter=true && MAFIB=="true" && BUY=="true")

Quelqu'un pourrait-il me conseiller ? Merci d'avance !

 
tfi_markets:
Salut Pro-Coders,

Je voudrais mettre en place un filtre ADX qui filtrera les conditions de marché latéral et agité.

Si l'ADX est inférieur à 25, il ne doit pas ouvrir de transactions. J'ai codé ce filtre simple :

extern int ADXPeriod=14;

double CurrentADX = iADX(Symbol(),0,ADXPeriod,PRICE_CLOSE,MODE_MAIN,0);

double PreviousADX = iADX(Symbol(),0,ADXPeriod,PRICE_CLOSE,MODE_MAIN,1);

bool ADXfilter=false;

if(CurrentADX>25&&PreviousADX<25)

{

ADXfilter=true;

}

if(ADXfilter=true)

{

BUY();

.

.

SELL();

}

[/CODE]

For some reason the filer is not working. I have put the ADX filter before placing the buy / sell order.

Also putting it to the entry conditions signal is not working.

[CODE]

if(ADXfilter=true && MAFIB=="true" && BUY=="true")

Quelqu'un pourrait-il me conseiller ? Merci d'avance !

tfi_markets

Votre condition ne fonctionnera que si l'ADX traverse le niveau 25 sur une barre courante.

Utilisez simplement ceci à la place :

if(CurrentADX>25) ADXfilter=true ;

 
mladen:
mntiwana

Remplacez ceci :

double diffp = iCustom(NULL,0,"Hull parabolic 2.1",PERIOD_CURRENT,Ma1Period,Ma1Price,2,0 ,0,BarToUse==2)

-iCustom(NULL,0,"Hull parabolic 2.1",PERIOD_CURRENT,Ma2Period,Ma2Price,2,0 ,0,BarToUse==2);[/PHP]

with this :

[PHP]double diffp = iCustom(NULL,0,"Hull parabolic 2.1",PERIOD_CURRENT,Ma1Period,Ma1Price,2,0 ,0,BarToUse+1)

-iCustom(NULL,0,"Hull parabolic 2.1",PERIOD_CURRENT,Ma2Period,Ma2Price,2,0 ,0,BarToUse+1);

Très cher MLADEN,

Encore une fois merci, cette partie est faite avec votre aide, pouvez-vous me dire ce qu'il faut ajouter/remplacer dans EXTERN (méthode MA1,MA2) ,j'ai indiqué dans l'image.

Salutations

Dossiers :
10.png  128 kb
 
mntiwana:
Très cher MLADEN,

Merci encore, cette partie est faite avec votre aide, pouvez-vous s'il vous plaît me conseiller ce qu'il faut ajouter/remplacer dans EXTERN (méthode MA1, MA2) ,j'ai indiqué dans l'image.

Salutations

mntiwana

Vous pouvez supprimer les méthodes ma de là. Elles ne sont plus nécessaires du tout

 
mladen:
mntiwana Vous pouvez supprimer les méthodes ma de là. Elles ne sont plus du tout nécessaires

Très cher MLADEN,

merci beaucoup BOSS, pour la leçon et l'amélioration d'aujourd'hui, c'est plus que suffisant,

salutations

 

Bonjour à tous,

Je suis à la recherche de la fonction sigmoïde dans mql4, voici ce que j'ai trouvé jusqu'à présent :

//--------------------------- sigmoid() ---------------------------------

// 1/(1+exp(-x))

double sigmoïde(double x)

{

si (x>50) retourne (1) ;

si (x<-50) retour (0) ;

retourne (1.0/(1.0+MathExp(-x)) ;)

}//sigmoïde()

https://www.mql5.com/en/code/9002 et ce réseau neuronal de débat - Algorithme sigmoïde rapide - Stack Overflow

Quelqu'un peut-il m'aider ?

 
nevar:
Chers tous,

Je cherche la fonction sigmoïde dans mql4, voici ce que j'ai trouvé jusqu'à présent :

//--------------------------- sigmoid() ---------------------------------

// 1/(1+exp(-x))

double sigmoïde(double x)

{

si (x>50) retourne (1) ;

si (x<-50) retour (0) ;

retourne (1.0/(1.0+MathExp(-x)) ;)

}//sigmoïde()

https://www.mql5.com/en/code/9002 et ce débat réseau neuronal - Algorithme sigmoïde rapide - Stack Overflow

Quelqu'un peut-il m'aider ? Merci.

nevar

Un algorithme a été utilisé ici : https://www.mql5.com/en/forum/179686/page13

 

Bonjour mladen ....wowww c'est mieux que mon indicateur..... vous êtes le meilleur..merci beaucoup pour votre aide..... beaucoup de merci beaucoup.....sincèrement...

 

HI mladen,

avez-vous trouvé le bug dans mon code ?

Merci

Raison: