Historical Trades: splits, cash flow, multiple files, shared equity
Author: KGo
Creation Date: 12/19/2017 3:54 AM
profile picture


A new utility program has been uploaded. It's named "Historical Trades: splits, cash flow, multiple files, shared equity". It will come with your next strategies download. Here is the overview from the strategy description:

Historical Trades reads multiple trade list and cash flow files of varying format including actual brokerage history into a single Wealth Lab model.

For broker history with actual shares and prices it will automatically split entries to match multiple exits and split exits to match multiple entries. It will create LIFO and/or FIFO trades at actual prices even when prices have split after the sale. If desired, it will use actual commission, fees and all cash flow transactions including actual dividends, interest, deposits, withdrawals and any other category cash flow to create a complete, accurate account model. Multiple accounts can be processed simultaneously to create a consolidated view with all the Wealth-Lab metrics.

Historical Trades creates a model from trade list files based on shares or %Equity. It accepts trades from Wealth Lab strategies, Active Trader Pro history, Fidelity.com history or third party datasets. It is effortless to combine multiple files into a single backtest. Some symbol substitution, trade selection, percent equity adjustment and other changes can be made on the fly without changing the file(s). Trade timing is flexible with same day or next day executions at open, close or price as needed for each trade in each file. Every trade has all data visible and can be reconciled to its input so there is never a question of accuracy. Historical Trades can save a file documenting all transactions and their source setup to precisely reproduce any execution.

The program has statements to run WL trades and ATP or Fidelity.com history. Just put in your file names. I'll post other sample files and code to run them tomorrow.

profile picture


Kevin, thank you for sharing your work with the community.

I'll not pretend that I understand how the code works. :)

Approved! Now it can be downloaded.
profile picture


Eugene, Thanks for the approval.

Here are some sample files and code.

This is for %Equity sizing. Use PosSizer>>Position Options>>Tag>>%Equity. It's a WL trade list, intraday 5 min scale and will execute on bars from 5 min up to daily scale on shares or %Equity. Symbol is XIV. It uses defaults stored in the file including system assumed defaults like minimized print but has added a cash flow file.
Please log in to see this code.

This example is of shares sizing. Use Data Pane SetShareSize. Fidelity type data with one trade fixed for a split during the trade. All defaults are stored in the file.
Please log in to see this code.

If you trade with Fidelity save your ATP or Fidelity.com history and use the Fidelity line in the downloaded program. It will be much like the above example.

Other files attached are for reference.