Please help to modify scalping EA.

 

Hi

I took the basic code from IBFX scripts ( just like a template) and modified to use with my scalping idea.

For some reason ( not surprisingly , since i am not a programmer in mq4) it does not work all the time, getting stuck somewhere. And MT4 does not have a debugger.

It works with 1 pair ( i use eur/usd or aud/usd) but does not work properly when i use on multiple charts. I think the problem with the way i am using magic number.

" The idea is very simple.... Place 2 orders 10 pips above and 10 pips below to start, with tight stop loss of 20 pips and profit of 10 pips.

For BuyStop and SellStop

every time the price for the currency is changed i am updating the price of those orders for the same distance.

Lets say EUR?USD moved 2 pips i am updating both orders to be 10 above and 10 below.

I am using my system live and it produces good results , for the last 3 month on average it has 4-6 wins per 1 loss ration.

Here is the kicker!

Instead figuring the fast market movements or high volatility... The price always will be updated till the market becomes high powered.

Usually during the news or some fast market movements servers are getting busy and the order is not getting updated, which tigers the order ( up or down)

In majority cases when its hard to update the order, it means market is moving very fast and practically guarantee to keep moving in that direction for short period of time. ( usually i noticed 20-30 pips easy, but to be safe i use 10 pips)

Here is the EA i am using it. Please help me to find the problem and make it kind of universal, so i can use on multiple currencies at the same time.

//// Please look at the attached EA and help to code properly. /////

Thanks

Yan

Files:
scalping_ea.mq4  20 kb
 
picassoinactions:
Hi

I took the basic code from IBFX scripts ( just like a template) and modified to use with my scalping idea.

For some reason ( not surprisingly , since i am not a programmer in mq4) it does not work all the time, getting stuck somewhere. And MT4 does not have a debugger.

It works with 1 pair ( i use eur/usd or aud/usd) but does not work properly when i use on multiple charts. I think the problem with the way i am using magic number.

" The idea is very simple.... Place 2 orders 10 pips above and 10 pips below to start, with tight stop loss of 20 pips and profit of 10 pips.

For BuyStop and SellStop

every time the price for the currency is changed i am updating the price of those orders for the same distance.

Lets say EUR?USD moved 2 pips i am updating both orders to be 10 above and 10 below.

I am using my system live and it produces good results , for the last 3 month on average it has 4-6 wins per 1 loss ration.

Here is the kicker!

Instead figuring the fast market movements or high volatility... The price always will be updated till the market becomes high powered.

Usually during the news or some fast market movements servers are getting busy and the order is not getting updated, which tigers the order ( up or down)

In majority cases when its hard to update the order, it means market is moving very fast and practically guarantee to keep moving in that direction for short period of time. ( usually i noticed 20-30 pips easy, but to be safe i use 10 pips)

Here is the EA i am using it. Please help me to find the problem and make it kind of universal, so i can use on multiple currencies at the same time.

//// Please look at the attached EA and help to code properly. /////

Thanks

Yan

[lang=pl]Hi, please tell me what exactly doesn't work. Now im using it ins USD/CHF USD/AUD parallelly and it open positions in both papers.

Cheers,

Grzesiek[/lang]

 

For some reason after 1 executes , it's pretty much does not reopen.

Its gotta be a bug somewhere.

When i start the ea on 3-4 pairs, its working at first, but then after executing few trades it stops.

I cant figure out what is wrong. But since i am using same magic number i was thinking may be that is the problem.

And may be some1 can help to optimize it to work faster.

 
g.pociejewski:
[lang=pl]Hi, please tell me what exactly doesn't work. Now im using it ins USD/CHF USD/AUD parallelly and it open positions in both papers.

Cheers,

Grzesiek[/lang]

And one more thing, right now if one position becomes open , it won't open a pending order for that direction.

Originally i programmed that it continues to have a pending order when orders open but then i noticed the problem that open order was getting updated for stop loss and TP since they were checked by the magic number. I could not figure out the other way.

So to stop updating the the open order i added if ( OrderType()<2 ) continue;

But would be nice to keep opening pending order while one is open.

 

ever get anywhere with this?

Hi mate,

Ever get your EA to function properly? I've been backtesting for a bit and I get quite good results - but thats if the EA works or doesnt get stuck lol...

Regards

 

Scalping EA

burningmunkey:
Hi mate,

Ever get your EA to function properly? I've been backtesting for a bit and I get quite good results - but thats if the EA works or doesnt get stuck lol...

Regards

Hi

I had few modifications from few people but still getting stucked.

I am using on daily bases and usually after 1-2 scalps i just restart. There is a still bug somewhere.

Some1 with good programming expirience in mql should rewrite it. The idea is very simple and basic.

Thanks

Yan

 
picassoinactions:
Hi

I had few modifications from few people but still getting stucked.

I am using on daily bases and usually after 1-2 scalps i just restart. There is a still bug somewhere.

Some1 with good programming expirience in mql should rewrite it. The idea is very simple and basic.

Thanks

Yan

Hi,

I am testing this EA and seems to be just what i am looking for.

one nice thing would be to have the pips away from marked as a paramter, not hardcoded to 10 pips to trigger more trades.

would this be possible?

Reason: