MetaTrader4: Running an EA with a simulated tick input - HOW?

 

Hi Everyone,

I've recently discovered the MetaTrader4 lanuage and it is awesome. I've written an EA which I think is very promising - but I have a problem.

It seems to me that the only way I can test my EA (i.e. run it) is with live ticks coming in from my broker's server (I have a demo account). So over a weekend when the Forex market is closed, I can't run my code. Surely there must be some way to simulate a tick input (with psuedo Bid and Ask values), so that one can actually run one's code.

Anyone that writes their own EA will have this problem. I really hope there is someone out there who has solved it and can enlighten me.

Thanks guys (in anticipation)

Robin

 
knoxgrant:
Hi Everyone, I've recently discovered the MetaTrader4 lanuage and it is awesome. I've written an EA which I think is very promising - but I have a problem. It seems to me that the only way I can test my EA (i.e. run it) is with live ticks coming in from my broker's server (I have a demo account). So over a weekend when the Forex market is closed, I can't run my code. Surely there must be some way to simulate a tick input (with psuedo Bid and Ask values), so that one can actually run one's code. Anyone that writes their own EA will have this problem. I really hope there is someone out there who has solved it and can enlighten me. Thanks guys (in anticipation) Robin

Hmm. Why can't you try tester in MT4? Press Ctrl+R, choose your EA in list, choose preferable pair and timeframe and check "visual mode" box to look what EA is doing on chart. That's all, start it.

 

Hi Dael,

Really appreciate your response. Great idea. I don't yet know Tester too well. But I will learn. Tried my EA on Tester following your instructions, but results were zero - all the readouts were zero.

What I actually want to do is to set break points in the code and see what is going on in the variables and expressions. Tester can't do that for me. The EA works in a live feed situation, but it won't work on Test. Strange. I'll keep working on it. Persistence will win through.

Thanks again for your response.

Robin

 
knoxgrant:
Hi Dael, Really appreciate your response. Great idea. I don't yet know Tester too well. But I will learn. Tried my EA on Tester following your instructions, but results were zero - all the readouts were zero. What I actually want to do is to set break points in the code and see what is going on in the variables and expressions. Tester can't do that for me. The EA works in a live feed situation, but it won't work on Test. Strange. I'll keep working on it. Persistence will win through. Thanks again for your response. Robin

Hi knox... unfortunately thats one of the drawbacks that metatrader currently has... it does not have a debugger to debug the codes...