Reply

Custom moving Average E.A

8 replies

msophe

Subscriber, bbp_participant, community, 124 replies.

Visit profile

7 years ago #116276

HI

 

I have build  E.A with custom moving average (SMA) but I want when open buy order and when enter sell order should close first 

 

automatically buy order and open sell order, I don’t want buy order and sell order both to be open.

 

Here you can my attachment.

 

Thanks.

 

 

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

7 years ago #141341

Hello,

 

you can add close position (magic). Look at the modified EA

0

msophe

Subscriber, bbp_participant, community, 124 replies.

Visit profile

7 years ago #141382

HI

 

I found there mistake in  E.A and I try to figure out but i fail and this is that;

 

I want the candle when cross up line and open new indicator above should open BUY ORDER and when buy position cross down line

 

and before open another candle should close immediately Buy position and open sell position. It should do the same position.

 

I have attach here my home work and help to finish up.

 

Thanks

 

 

 

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

7 years ago #141404

Hello,

 

you can use shift = 0 with the moving average. When you use Bid price and Ask price always use “Every tick” backtest in MetaTrader to make it work correctly. See file attached

0

msophe

Subscriber, bbp_participant, community, 124 replies.

Visit profile

7 years ago #141492

Hello

In moving Average(SMA) I want when profit reach dollar 10 in long position should close position and wait for short entry when SMA

 

Cross below Ask.

And when short position profit reach dollar 10  should close short position and wait long position when SMA Cross above Bid.

But if profit does not reach dollar 10 should close normal . Example short position open and does not reach dollar 10 but SMA come 

 

Cross Above Bid should close short position and open Long position, It will do the same to the rest.

I have attach my work progress here , it need some little help.

Thanks for you time, am appreciate.

 

 

 

 

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

7 years ago #141541

Hello,

 

if so you can separate entry conditions and profit management. Look at the attached file

0

msophe

Subscriber, bbp_participant, community, 124 replies.

Visit profile

7 years ago #141547

Hello

 

Thanks, but i was ask that if I have attach that E.A and open order and profit reach dollar 10 and i have another position I opened manually  and it has loss dollar 6 so

 

it will  not affect the E.A with condition that when profit reach  dollar 10 should close position.

 

Thanks

0

msophe

Subscriber, bbp_participant, community, 124 replies.

Visit profile

7 years ago #141562

HI

 

Thanks for showing in E.A, It open order as i request and when profit reach dollar 10 is closing and waiting for cross, but there mainly big

 

problem happen, and is that , it open correctly but in closing are not closing even cross the above line or below and make more loss ,

 

 while instruction is clear state , may be there mistake in build, can  you check to know where problem com from.

 

I have attach screenshot to find more. 

 

Thanks.

 

 

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

7 years ago #141583

Hello,

 

you need to remove the “market positions is flat” condition from Long and Short tabs. See file attached

0

Viewing 8 replies - 1 through 8 (of 8 total)