Need help for code MA filter

 

Hi expert members,

Please help to code MA filter for this source code!

int CalculaSignal(int aux_range, double aux_price, double aux_index, int aux_shift)

{

int aux=0;

double f1=iCustom(Symbol(),0,"Fisher M11",aux_range,aux_price,aux_index,0,aux_shift);

double f2=iCustom(Symbol(),0,"Fisher M11",aux_range,aux_price,aux_index,0,aux_shift+1) ;

// Valores de retorno

// 1. Compra

// 2. Compra Señal

// 3. Venta

// 4. Venta Señal

if (f1>0 && f2<0) aux=1;

if (f10) aux=2;

return(aux);

}

The buy order should be triggering above SMA(varies), and sell order triggered below SMA oppositely.

This EA is from lifesdream.net, I found out the Fisher M11 indicator is good, and was playing a period of time, but in order of avoiding bad trade, use MA filter could be a good solution.

I will share both setting and FT, after somebody help to the MA filtering.

Thanks in advance!

zero9898.

 
zero9898:
Hi expert members,

Please help to code MA filter for this source code!

int CalculaSignal(int aux_range, double aux_price, double aux_index, int aux_shift)

{

int aux=0;

double f1=iCustom(Symbol(),0,"Fisher M11",aux_range,aux_price,aux_index,0,aux_shift);

double f2=iCustom(Symbol(),0,"Fisher M11",aux_range,aux_price,aux_index,0,aux_shift+1) ;

// Valores de retorno

// 1. Compra

// 2. Compra Señal

// 3. Venta

// 4. Venta Señal

if (f1>0 && f2<0) aux=1;

if (f10) aux=2;

return(aux);

}

The buy order should be triggering above SMA(varies), and sell order triggered below SMA oppositely.

This EA is from lifesdream.net, I found out the Fisher M11 indicator is good, and was playing a period of time, but in order of avoiding bad trade, use MA filter could be a good solution.

I will share both setting and FT, after somebody help to the MA filtering.

Thanks in advance!

zero9898.

Hi, I'm sure that I can help you in coding. Only problem is that I dont understand wht you exactly want ?

Can you explain it more precisly ?

Cheers

grzesiek

 
g.pociejewski:
Hi, I'm sure that I can help you in coding. Only problem is that I dont understand wht you exactly want ?

Can you explain it more precisly ?

Cheers

grzesiek

Hi,

Thanks for your prompt reply.

The MA filtering which I intend to use here is to avoid triggering for a false/bad signal like the snapshot attached.

Cheers!

zero9898

Files:
fisher_m11.jpg  199 kb
 
zero9898:
Hi,

Thanks for your prompt reply.

The MA filtering which I intend to use here is to avoid triggering for a false/bad signal like the snapshot attached.

Cheers!

zero9898

[lang=pl]I will contact you tommorow

cheers,

Grzesiek[/lang]

 

may i can put in my 2 cents

try it, i can be wrong, because i dont know the code in full...

if (f1>0 && f2<0) aux=1;

if !(f1>0 && f2<0) aux=2;

if (f10) aux=2;

if !(f10) aux=1;

 
ixbone:
may i can put in my 2 cents

try it, i can be wrong, because i dont know the code in full...

if (f1>0 && f2<0) aux=1;

if !(f1>0 && f2<0) aux=2;

if (f10) aux=2;

if !(f10) aux=1;

Hi,

Thanks for your comments.

But where is the MA filter line code?

Should it be like;

double ima_8 =iMA(Symbol(),Period(),_SMaPeriod,0,MODE_SMA,PRICE_CLOSE,i);

if ((f1>0 && f2 ima_8) aux=1;

if ((f10) < ima_8) aux=2;

But the problem, when I add this code, the triggering only with 1 direction??

Here attach the whole EA source code.

Thanks

zero9898

Files: