Need help in MA based EA!!

 

Hi all,

I have got a wonderful EA from this forum which works very gr8 on longer timeframe.. I am testing it on 1 hr timeframe..

its simply a EA which takes position when price crosses Exponential moving average (12) with a new candle opening..

it books partial profit (variable) in 5 parts.

Everything is working fine but I want this EA to work on SIMPLE moving average rather than exponential moving average..

Can someone please do this for me ?? I have tried changing the settings MA mode from 1 to 0 but then orders are not at all executing. thr are some anchors (I dont know for what reason?) but may be it needs MQL expert to solve the issue..

looking for the reply and feedback on this EA..

Happy tradingma_cross_advanced_fixedkkk_gbpusd.mq4

 

...

ketan_one,

Simply set the MAMode in parameters to 0 instead of default 1. No need to change anything in the code

ketan_one:
Hi all,

I have got a wonderful EA from this forum which works very gr8 on longer timeframe.. I am testing it on 1 hr timeframe..

its simply a EA which takes position when price crosses Exponential moving average (12) with a new candle opening..

it books partial profit (variable) in 5 parts.

Everything is working fine but I want this EA to work on SIMPLE moving average rather than exponential moving average..

Can someone please do this for me ?? I have tried changing the settings MA mode from 1 to 0 but then orders are not at all executing. thr are some anchors (I dont know for what reason?) but may be it needs MQL expert to solve the issue..

looking for the reply and feedback on this EA..

Happy tradingma_cross_advanced_fixedkkk_gbpusd.mq4
 
mladen:
ketan_one, Simply set the MAMode in parameters to 0 instead of default 1. No need to change anything in the code

I have already tried but when I change it to 0 EA order execution stops..(dont know why!! ) it wont work..

please help

 

...

U tried it (in back test - tested it on EURUSD and GBPUSD 1 minute) and these are the orders it took (it was only a very short test to see if the SMA mode works at all, disregard the results)

Attached are the report files (along with the settings used - as you can see MAMode is set to 0 in these tests) so it works on my PC in SMA mode too. It should work on your PC to since the moving average is a built in average and you can not "lack" it ... Check if some error is written out at the experts tab, maybe that way you will find what is going on on your PC

ketan_one:
I have already tried but when I change it to 0 EA order execution stops..(dont know why!! ) it wont work.. please help
Files:
back.gif  46 kb
ma_cross.zip  23 kb
back_gbpusd.gif  25 kb
 
mladen:
U tried it (in back test - tested it on EURUSD and GBPUSD 1 minute) and these are the orders it took (it was only a very short test to see if the SMA mode works at all, disregard the results)

Attached are the report files (along with the settings used - as you can see MAMode is set to 0 in these tests) so it works on my PC in SMA mode too. It should work on your PC to since the moving average is a built in average and you can not "lack" it ... Check if some error is written out at the experts tab, maybe that way you will find what is going on on your PC

i am sorry...its getting signal and trades after changing MA mode to 0 from 1.... but the signal or trades not getting according to SMA... and not according to EMA as well... dont know wht happens exactly but trades excute somwhere else..

plese help

 

ketan_one;

It is SMA. iMA() can not calculate any other average type except SMA if the MAmode is set to 0 (it is simply not able to) Check what the parameters you are using but with default parameters and MAmode set to 0 it uses SMA 12 of open and close for crosses

ketan_one:
i am sorry...its getting signal and trades after changing MA mode to 0 from 1.... but the signal or trades not getting according to SMA... and not according to EMA as well... dont know wht happens exactly but trades excute somwhere else.. plese help
 

See what I am looking for is

1. EA buys on new candle opening after price cross SMA 12 and

sells when new candle open below SMA 12 .

2. sma parameter should be there so that it will be variable..

3. partial profit booking option should be there

4. once position is created candle close below/above SMA 12 will act as a stoploss and reverse position..

5. if tp is hit in the same candle where the long/short position is created new position should not create automatically by EA.

(attached EA do the same i.e. if short position is created @ 1.31500 and tp is 1.31400 and tp got hit in the same candle so EA opens anothe short position at 1.31400)

6. a single sound alert after trade/order execution.

if anyone have the same EA please paste it here or mql expert can write the same for mt4 in five min.. (its so easy for them i guess!!)

guys please help me

thank you

 

...

ketan_one

As far as I see the EA that you attached has all those things already (except that it does not alert when an order is opened).

ketan_one:
See what I am looking for is

1. EA buys on new candle opening after price cross SMA 12 and

sells when new candle open below SMA 12 .

2. sma parameter should be there so that it will be variable..

3. partial profit booking option should be there

4. once position is created candle close below/above SMA 12 will act as a stoploss and reverse position..

5. if tp is hit in the same candle where the long/short position is created new position should not create automatically by EA.

(attached EA do the same i.e. if short position is created @ 1.31500 and tp is 1.31400 and tp got hit in the same candle so EA opens anothe short position at 1.31400)

6. a single sound alert after trade/order execution.

if anyone have the same EA please paste it here or mql expert can write the same for mt4 in five min.. (its so easy for them i guess!!)

guys please help me

thank you
 
mladen:
ketan_one As far as I see the EA that you attached has all those things already (except that it does not alert when an order is opened).

this EA works on 12 sma open crossing 12 sma closed.. but I want a EA which works on price and 12 sma cross..

thanks for replying!!

 

...

In my experience if you use the "raw" price at the times when there us a cross you are going to have a lot of "false" signals (simply because moving average is crossing over a couple of bars) Here is one example that might clarify that :

See how many times times the price crosses 12 period SMA in the period marked by rectangle

ketan_one:
this EA works on 12 sma open crossing 12 sma closed.. but I want a EA which works on price and 12 sma cross.. thanks for replying!!
Files:
crosses.gif  32 kb
 
mladen:
In my experience if you use the "raw" price at the times when there us a cross you are going to have a lot of "false" signals (simply because moving average is crossing over a couple of bars) Here is one example that might clarify that :
See how many times times the price crosses 12 period SMA in the period marked by rectangle

Hi,

I am agree with you but I want price cross to 12 sam and EA should buy/sell when candle closes above/below the 12 sma.

Reason: