Duplicated trades in a backtest on ASCII data
Author: kevyaugusto
Creation Date: 5/11/2020 8:02 AM
profile picture


Hello everyone,
I hope you have had a great weekend.

I have imported 15min intraday data extracted from the real platform that I trade into Wealth-lab. After that, I have run the strategy that I have set up. When I opened the trades tab of that asset backtested, it was displaying duplicated trades, resulting in unreliable performance results.

I have attached the intraday ASCII file data for you to test. Also, I am attaching snapshots of the strategy rules so you can set it up in your PC and execute the tests.

Could anyone please review it and help me with that? Has anyone faced the same issue in the past? I was wondering if this is a bug or if I am doing something wrong using Wealthlab software.

Please, do not hesitate to contact me if you have any question.

I look forward to hearing from you.

Thank you in advance!
profile picture


Hi Kevy,
I think you possess a superpower - you've got duplicate trades, you duplicated a topic, and the reason you have duplicate trades is because your data are duplicated too! I hereby name you, "The Duplicator". :)

1. Close Wealth-Lab
2. Open your data file and delete lines 2141 to 4124, inclusive.

And on the strategy, it's bad style to use "AtClose" orders - especially for intraday trading. This is an IMPOSSIBLE order to achieve. There is only a 1 tick difference between the close of a bar and open of the next bar, consequently, you should replace your orders with Buy/Sell At Market order types.

An exception would be if you want to Sell At Close on the last bar of the day to flatten your position. For this, apply the Date/Time > Intraday Rule: Is Last Bar of Day to a SellAtClose order.

Note! There is no Alert for AtClose orders.
profile picture


Hi Cone. I hope you have had a great day!

Thanks for getting back to me and I am sorry about the duplicates! =O

I will review the CSV file and will remove duplicated records.

Thanks also for checking all information and providing more details related to my strategy. Really appreciated that. I am relatively new to the Wealth-lab and still have much to learn about this tool.

I think I understood what you wrote about "AtClose" but I just want to confirm.

When you mentioned the "AtClose" orders for intraday are IMPOSSIVEL to achieve, do you mean that only if I use an automated integration with a broker? I say that because I am only testing strategies using intraday data so I can follow up the market during the day and manually execute these strategies without a bot. Please, let me know if I understood it properly or if I am complete away from what you have said.

Thanks for your help!
Best Regards,
The Duplicator -- ooops, Kevy. :P

profile picture


ROFL - your signature :D

Right about AtClose orders. There's no problem testing it that way, but why do a less realistic test? Furthermore, the AtClose orders will not give you an Alert (needed to place an order), so you'll need to change the strategy to operate in real time anyway. In other words, even if you're placing orders manually, you still need the strategy to tell you "buy or sell now", right?

fyi, we just upgraded our ASCII Provider to remove duplicate records when reading text data files. You can download an install the Update using Tools > Extension Manager.
profile picture


Hi Cone. LOL !

Thank you for your reply. I have updated my strategy to use AtMarket instead of AtClose. I think you're right, it is better to be more realistic in these tests than anything else.

That's great to hear the upgrade of ASCII Provider. I will download it soon. You guys rock!

Thanks and have a nice week.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).