Slow moving average

 

I've a EA that trades on MA crossover. But it doesn't place trades exactly at crossover.

It places orders 1 or 2 bars late. Is there any way to make it work faster?i.e excactly when the crossover is made.

I use the following logic:

if(FMA<=SMA && PFMA>=PSMA && buycond==true)

{

//Open BUY ;

}

if(FMA>=SMA && PFMA<=PSMA && sellcond==true)

{

//Open SELL;

}

Regards,

Rohit

 

i was wondering how this code opens an order at all

 
qjol:

i was wondering how this code opens an order at all


?????????????

I'm using reverse logic!

Fast MA crosses Slow MA == SELL and vice-a-versa.

The functions used are as given in the Mql book. I just want to know how to place orders faster!

 

show your code

 

Can you tell me how can i open a trade at a crossover itself and not delayed.

thank you in advance.

 

because your conditon is:

if(FMA<SMA && PFMA>PSMA && buycond==true)

& PFMA PSMA r = 2 candles shift (PFMA=iMA(NULL,0,MPeriod1,0,MODE_SMA,PRICE_OPEN,2); PSMA=iMA(NULL,0,MPeriod2,0,MODE_SMA,PRICE_OPEN,2))

for the current candle u should use

FMA=iMA(NULL,0,MPeriod1,0,MODE_SMA,PRICE_OPEN,0);
SMA=iMA(NULL,0,MPeriod2,0,MODE_SMA,PRICE_OPEN,0);

 

thank you sir!!!

Ha so silly of me.. i tried to change many conditions but for to change this only...

Thank you.

 

Sir, I also want to ask you how can we change the trades?

e.g. A BUY trade is ON and after say 2-3 bars the trade runs into loss!

Then how can we change the current trade to SELL so that the initial profit is booked and even the loss is avoided....

And if yes then how can we do this?

thank you in advance

 
ksrohit2712:

Sir, I also want to ask you how can we change the trades?

e.g. A BUY trade is ON and after say 2-3 bars the trade runs into loss!

Then how can we change the current trade to SELL so that the initial profit is booked and even the loss is avoided....

And if yes then how can we do this?

thank you in advance


u want to regret or u mean hedging or u want to change the position?

ho & BTW my father is sir

Reason: