How to "seed" data in an EA to match backtested parameters...?

 

Problem:  Many if not most back-tested EAs show significantly different results in forward live real account trading. Even if the trading logic is accurate different sets of historical data or different calculation times for example start times of back-tested vs. current data will create different results. Especially with indicator driven and time vs. price driven EAs, the date that the EA starts trading and calculating data will alter the date and time of trades thus widely altering the outcome of back-tested results vs. real results. Add in slippage and non-executions of trades in real world trading and the results are even more apart.

Possible Solution: First, only backtest on a real-live account so that the broker data feed is the same for the back test and the real account. Then, "seed" the EA with a variable that represents the last trade and last indicator data to compensate for any differences between the backtested data set and the real live account data set. For example, lets say we have an excellent back test that we would like to use in real trading...lets say the EA trades based on exponential moving average and a number of bars passed since the last trade. In order to simulate and get as close to what the back-tested EA would do in future live market conditions, we have to have the EA use the exact same data in future trading for example, the last trade date and time and the indicator values at that time.

How does one approach doing this?

On back-tested data, for example, the last trade date was 2013.4.19, sell at 1.30835, last bar count was 178650 at the time, and indicator value was 1.30920.

How can I seed these values so that the "live" EA uses this data to calculate forward data?

 
betterway2020:


On back-tested data, for example, the last trade date was 2013.4.19, sell at 1.30835, last bar count was 178650 at the time, and indicator value was 1.30920.

How can I seed these values so that the "live" EA uses this data to calculate forward data?

It sounds like you are trying to curve fit your EA,  I think that is a bad idea.
 
betterway2020: Problem:  Many if not most back-tested EAs show significantly different results in forward live real account trading.
Future data isn't the same, so results will always be different. If you curve fit your parameters it may be complete looser on different data. Always optimize on one year and test on another.
 

Thanks for the replies. I understand the potential pitfalls of "curve fitting". However, there are also reasons to test "curve-fitting" in a live environment.

Many EAs when back-tested at different times, produce wildly different results even without changing parameters.

For example, a seeming profitable EA tested today, if left alone for a month or two, when tested again on the same account will not have the same results, in fact will have flattened or gotten slammed.

That same EA if used in a live environment would have been not good. This is without "curve-fitting" and leaving the parameters alone.

What I am attempting to do and code is this... (I know there is a way to do it. I just can't wrap my head around the logic and code right now.)

I want the EA to use the EXACT same parameters that were calculated in terms of the date and time of last trade, numbers of bars since last trade, numbers of open trades and indicator values.

Markets can be cyclical in nature. By using the same date and time of last trade and indicator values of last trade, to "start" or "seed" the live EA gives it the best possible chance to continue it's trade pattern for better or worse.

One can argue for or against the theory all day long.

Here's the logic that I have in my current EA...

A. Last trade (bar count = 0) to start. Number of open trades (count = 0) to start.

B. If bar count exceeds last trade by X and number of open trades is less than X and indicator values are X plus Y, then trade.

Trades are executed as market orders and SL/TP modified immediately after confirmation.

How do I code the EA to seed the bar count of the last trade and values of the indicators at time of last trade?

Reason: