Simulated live trading

 

Hey guys I was wondering did anyone code their EA to simulate live trading on the live feed ? I am going to code mine to do that and would appreciate any ideas/input.

I figured I would code some functions to simulate the server responses to all the trade related functions, like OrderSend() OrderModify() OrderOpenTime() etc and make a copy of the EA with modified function calls to use these new functions instead of the server. Simulated slippage and server response times by random sleep() amounts and make a screen display to show details of the simulated orders, open time, lot size, profit/loss etc. This should mean the EA simulates trading for a period of time while using live prices and the live spread

 

Why ?   Can't you simply use a Demo account instead ?

 

Don't forget you are going to have to create a data base of some kind to hold all the open trade and closed trade info for functions such as OrdersTotal(), etc.   Why not use the Strategy Tester and simulate thee missing Broker effects  ( slippage, delays, etc) in your EA when it  IsTesting() ? 

 

Mainly because I think it would be the most accurate test within reason, it would remove doubts I have about demo price feeds, dodgy historical data etc. If the testing is on live prices and by writing everything to a log file, including any indicator levels and trade prices and times at the time of a trade it all could be easily verified as accurate.

Partly because I coded a rudimentary version of that in an indicator using simple trade signals, it kept a running total of each trade's results and totalled up all the trading profit/losses etc. The results were very different when I later wrote the same trading logic into an EA and backtested ot over the same chart period. Something didn't add up and I dont think it was the indicator, the open and close prices of the "trades" it made were displayed right there on the screen I added up the pips they were correct. While backtesting the same, simple system in strategy tester over same days historical data afterwards, it tanked every time.

Reason: