forex software

Create and Test Forex Strategies

forex software

Skip to forum content

Forex Software

Create and Test Forex Strategies

You are not logged in. Please login or register.


Forex Software → Expert Advisor Studio → What happens to open trades while doing walk forward testing?

Pages 1

You must login or register to post a reply

RSS topic feed

Posts: 6

Topic: What happens to open trades while doing walk forward testing?

Was checking out the online Expert Advisor Studio's walkforward today. I wanted to know what happens to open trades when the parameters are changed while transitioning into a new segment. Is it closed and reopened according to new signals or something else. Let me know. Thanks

Re: What happens to open trades while doing walk forward testing?

The test start from the beginning of the shifted data set.

The Walk Forward serves to check if a strategy is suitable for optimisation on a new period.
If it has new parameters, it may have completely different deals.

If you apply walk-forward optimization on a trading strategy, you have three options (I prefer to make the change during the weekend):
- change the strategies by closing the previous position, if any, and running the updated strategy from a neutral position.
- set the same magic number to the new strategy. It will close the current position according to its signals.
- leave the previous strategy to close its position and remove it from a neutral position. Run the new strategy with a new Magic Number. The positions may overlap, but it doesn't matter.

Re: What happens to open trades while doing walk forward testing?

Hey Popov, thanks for the reply.
I understood your point of how one can proceed while applying walk forward in live trading.
You mentioned that test starts calculation from the beginning of the out of sample dataset. This makes sense.

But, I was testing some strategy and was unable to reproduce the results shown when I applied the walkforward optimized parameters to the last out of sample segment. Can you point out what I'm doing wrong. I have attached a simple example below. Sorry for the long post.

1] Dataset & timeframe -> EURUSD 1D (All available premium data 4886 bars)
2] Entry condition & starting parameters -> Rsi crosses the level upward (close, period- 14, level- 70)
3] Exit condition & starting parameters -> Rsi crosses the level downward (close, period- 14, level- 30)
4] Entry Lot - 0.1, Opp. entry signal - Ignore, No SL TP.
5] Walkforward setting -> Segments(12), Out of sample(30% OOS), Numeric range(+- 20steps), Search best(Net Balance).
6] Validation -> Minimum net profit(0)

After running walkforward, the results I get for the 12th segment is 32 trades, 419 USD net profit, 555 USD drawdown.
The date range for 12th segment is -> "2021-07-13 00:00" to "2022-08-12 00:00".
The parameters for same are -> Entry RSI -> Period(3), Level(21)
Exit RSI -> Period(2), Level(45).

Now I know this strategy is no good. But the problem is when I select that date range in Data Horizon tab and run the same strategy with these calculated parameters, the results are different(See attachments). The results I get are as follows-> 30 trades, 499.6 USD net profit, 554.8 USD drawdown.

Drawdown is same but the two trades are missing. In this specific case at least its similar, sometimes there is a huge difference between what the walkforward calculates and what actual backtest shows. Please let me know what is wrong. See attached images too.

Thanks for reading this long post.

Post's attachments

Final segement's results.png 103.58 kb, file has never been downloaded. 

Initial Strategy.png 68.6 kb, file has never been downloaded. 

Walkforward Parameters.png
Walkforward Parameters.png 19.86 kb, file has never been downloaded. 

Walkforward Results.png
Walkforward Results.png 56.5 kb, file has never been downloaded. 

Walkforward Settings.png
Walkforward Settings.png 31.22 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

4 (edited by iamgreatest 2022-08-12 07:57:09)

Re: What happens to open trades while doing walk forward testing?

Also I now see an overlap between the End date of 11th Segment and Start date of 12th Segment. This is not supposed to happen right?

Post's attachments

Date Overlap.png
Date Overlap.png 33.62 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: What happens to open trades while doing walk forward testing?

>  huge difference between what the walkforward calculates and what actual backtest shows.

Walk-forward use the "actual-backtester". Actually, there is only one backtester.

> I select that date range in Data Horizon tab and run the same strategy with these calculated parameters

Walk Forward shows the OOS start and end. On the other hand, the Data Horizon sets the data series' start and end.

> Also I now see an overlap between the End date of 11th Segment and Start date of 12th Segment.

The last segment is slightly adjusted because it may not be possible to divide the provided bar by the number of the segments. It is a very rare case. Even then, we have to calculate the OOS start. Several bars deviation is normal and acceptable.

If you want a more statistically representative result, you should adjust the settings to have 100 or more deals per segment.

Re: What happens to open trades while doing walk forward testing?

Popov wrote:

>  huge difference between what the walkforward calculates and what actual backtest shows.

Walk-forward use the "actual-backtester". Actually, there is only one backtester.

> I select that date range in Data Horizon tab and run the same strategy with these calculated parameters

Walk Forward shows the OOS start and end. On the other hand, the Data Horizon sets the data series' start and end.

Appreciate the quick response Popov. Yes you are correct, the Data Horizon tab sets the data series's start and end, that's why when the indicators were trying to calculate their values using past lookbacks, they didn't have access to past data due to the strict restriction I set manually using the Data Horizon tab. This explains the lack of trades and difference in values. Thanks for clearing it up.

Posts: 6

Pages 1

You must login or register to post a reply

Forex Software → Expert Advisor Studio → What happens to open trades while doing walk forward testing?

Similar topics in this forum