EA not trading when it should in Windows 7.

 

Hi guys. I thought i would ask some of the experts here as i have been frustrated by this for months now. I have an EA that I wrote and am happy enough with it to trade it real time. I attach it to the appropriate chart, set it to the correct timeframe, enable expert advisors and allow live trading in the ea properties on the chart and under the options menu. There is a smiley face on the chart indicating that all is well but it just won't trade when it should. i watch it in real time and see a trade forming but no order is placed. There is nothing in the Experts log or in the Journal. However if i run the backtester, that trade is entered into on the backtester.


So i installed VMWare and created a Windows XP virtual machine, installed MetaTrader and the set up the EA exactly how i had it under windows 7 and it worked fine. I have tried running MT as administrator in WIN 7 and also tried running it in XP compatibility mode but no luck. Is there a bug in MT that affects EA trading in Windows 7?


Thanks in Advance.


Kaine

 
kainea:

i watch it in real time and see a trade forming but no order is placed.

What do u mean?

 
gordon:

What do u mean?



Sorry, should have explained that better. I have 4 or 5 rules that must be passed before a trade is opened. I can look at the charts, see all 5 rules pass but no trade is entered. If i then run a backtest over that same period, the trade is opened correctly in the backtester.

 

kainea wrote >>

Sorry, should have explained that better. I have 4 or 5 rules that must be passed before a trade is opened. I can look at the charts, see all 5 rules pass but no trade is entered. If i then run a backtest over that same period, the trade is opened correctly in the backtester.

Tester has fixed spread, whereas live/demo have variable spread (with most brokers). Make sure that's not the cause of the difference between Tester and demo/live.


I also suggest u use Print() statements on each rule to print exactly why and if the rule triggered to pinpoint the problem

 
gordon:

Tester has fixed spread, whereas live/demo have variable spread (with most brokers). Make sure that's not the cause of the difference between Tester and demo/live.


I also suggest u use Print() statements on each rule to print exactly why and if the rule triggered to pinpoint the problem

Yeah i have gone through the Print() statements on each line. Its as if the EA just stops running for a while then starts again for a short time then stops. Wierd and kind of hard to explain. I don't think the spreads are the problem. I actually had that thought as well and added a 60 pip slippage to the OrderSend command but it didn't help. But the fact that it works on my XP VM and not on the windows 7 even if they are running simultainiously rules out things like slippage. The reason i started thinking it was some sort of issue with windows 7 is that i gave the EA to a couple of my friends. All of the ones that were using Windows XP had no problems but the ones that were using Windows 7 had the exact same issues as me.


I have searched for ages trying to find some answers and didn't really find anyone else with the same problem as me on the internet so i thought that it was just me doing something stupid or forgetting a tick box or something like that.

 
kainea:

Yeah i have gone through the Print() statements on each line. Its as if the EA just stops running for a while then starts again for a short time then stops. Wierd and kind of hard to explain. I don't think the spreads are the problem. I actually had that thought as well and added a 60 pip slippage to the OrderSend command but it didn't help. But the fact that it works on my XP VM and not on the windows 7 even if they are running simultainiously rules out things like slippage. The reason i started thinking it was some sort of issue with windows 7 is that i gave the EA to a couple of my friends. All of the ones that were using Windows XP had no problems but the ones that were using Windows 7 had the exact same issues as me.


I have searched for ages trying to find some answers and didn't really find anyone else with the same problem as me on the internet so i thought that it was just me doing something stupid or forgetting a tick box or something like that.

Hmmm.... don't know. Perhaps, u can try contacting MQ.

 
kainea:

Yeah i have gone through the Print() statements on each line. Its as if the EA just stops running for a while then starts again for a short time then stops.

What do you mean by "as if"? The EA either stops running for a while or it doesn't. A Print() of a few things like Time[0], Volume[0] etc right after start() will tell you whether that's the case or not.
Reason: