Ajuda na codificação - página 555

 
mntiwana:
Caríssimos MLADEN,

obrigado chefe, então, neste caso, o código pode ser assim ? por favor, me corrija,

cumprimentos

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

código original "simples MA cross EA".

//

#define _doNada 0

#define _doBuy 1

#define _doSell 2

int start()

{

int do What = _doNada;

diffc duplo = iMA(NULL,0,Ma1Periodo,0,Ma1Método,Ma1Preço,BarToUse) -iMA(NULL,0,Ma2Periodo,0,Ma2Método,Ma2Preço,BarToUse);

difp duplo = iMA(NULL,0,Ma1Período,0,Ma1Método,Ma1Preço,BarToUse+1)-iMA(NULL,0,Ma2Período,0,Ma2Método,Ma2Preço,BarToUse+1);

se ((difc*diffp)<0)

se (difc>0)

do What = _doBuy;

else do What = _doSell;

se (doWhat===_doNada) retorna(0);

//

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

alterado desta forma

#define _doNada 0

#define _doBuy 1

#define _doSell 2

int start()

{

int do What = _doNada;

diffc duplo = iCustom(NULL,0, "Hull parabolic 2.1",PERÍODO_CURRENTE,PeriodoMa1,Ma1Preço,2,0,0,0,BarToUse)

-iCustom(NULL,0, "Hull parabolic 2.1",PERÍODO_CURRENTE,Ma2Periodo,Ma2Preço,2,0 ,0,BarToUse);

difp duplo = iCustom(NULL,0, "Parabólico de casco 2.1",PERÍODO_CURSO,PeriodoMa1,Ma1Preço,2,0 ,0,BarToUse===2)

-iCustom(NULL,0, "Hull parabolic 2.1",PERÍODO_CURRENTE,Ma2Periodo,Ma2Preço,2,0 ,0,BarToUse===2);

se ((diffc*diffp)<0)

se (difc>0)

do What = _doBuy;

else do What = _doSell;

se (doWhat===_doNada) retorna(0);

//

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

mntiwana

Substitua este :

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);
 

ADX Filtro de ajuda

Olá Pro-Coders,

Gostaria de implementar um filtro ADX que deve filtrar lateralmente as condições de mercado agitadas.

Se o ADX estiver abaixo de 25 não deve abrir negócios, eu codifiquei este filtro simples:

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")

Alguém poderia, por favor, aconselhar? Agradecemos antecipadamente!

 
tfi_markets:
Olá Pró-Codificadores,

Gostaria de implementar um filtro ADX que deve filtrar lateralmente as condições de mercado agitadas.

Se o ADX estiver abaixo de 25 não deve abrir negócios, eu codifiquei este filtro simples:

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")

Alguém poderia, por favor, aconselhar? Agradecemos antecipadamente!

tfi_markets

Sua condição só funcionará quando a adx cruzar o nível 25 em uma barra atual

Use simplesmente isto em seu lugar :

if(CurrentADX>25) ADXfilter=verdadeiro;

 
mladen:
mntiwana

Substitua este :

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);

Caríssimos MLADEN,

Mais uma vez obrigado, essa parte é feita com sua gentil ajuda, você pode por favor aconselhar o que adicionar/substituir em EXTERN (MA1,MA2 método), eu apontei na foto.

cumprimentos

Arquivos anexados:
10.png  128 kb
 
mntiwana:
Caríssimos MLADEN,

Mais uma vez obrigado, essa parte é feita com sua gentil ajuda, você pode por favor aconselhar o que adicionar/substituir em EXTERN (MA1,MA2 método), eu apontei na foto.

cumprimentos

mntiwana

Você pode apagar os métodos ma a partir daí. Eles não são mais necessários

 
mladen:
mntiwana Você pode apagar os métodos de ma a partir daí. Eles não são mais necessários

Caríssimos MLADEN,

muito obrigado BOSS, por hoje lição e melhoria é mais do que suficiente,

cumprimentos

 

Prezados todos,

Estou procurando a função sigmóide em mql4. Foi isto que encontrei até agora:

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

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

duplo sigmóide(duplo x)

{

se (x>50) retornar (1);

se (x<-50) retorna (0);

retorno (1,0/(1,0+MathExp(-x)));

}//sigmoid()

https://www.mql5.com/en/code/9002 e este debate rede neural - Fast sigmoid algoritmo - Stack Overflow

Alguém pode ajudar? Obrigado.

 
nevar:
Prezados todos,

Estou procurando a função sigmóide em mql4. Foi isto que encontrei até agora:

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

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

duplo sigmóide(duplo x)

{

se (x>50) retornar (1);

se (x<-50) retorna (0);

retorno (1,0/(1,0+MathExp(-x)));

}//sigmoid()

https://www.mql5.com/en/code/9002 e este debate rede neural - Fast sigmoid algoritmo - Stack Overflow

Alguém pode ajudar? Obrigado.

nevar

um foi usado aqui : https://www.mql5.com/en/forum/179686/page13

 

oi mladen ....wowwww é melhor que meu indicador..... você é o melhor...muito obrigado sua ajuda.....many muito obrigado.....sinceramente...

 

HI mladen,

vocês encontraram o erro no meu código?

Obrigado