I'm confused by the money management system in the Portfolio Backtester. I created a portfolio in Beta 3 with a value of $100,000 for "initial portfolio capital." The strategy has a "Dollars per Trade" value of $10,000, and does not allow multiple entries per symbol. It has 100 symbols, trades on daily bars, and only makes long trades.
My expectation is that this strategy would initially make up to ten trades of about $10,000 each. I.e., the initial purchases would not exceed the "initial portfolio capital" value.
However, this strategy goes crazy with order entries. It initially makes 46 different "EnterLong" trades over the first several days, before it makes any "ExitLong" trades. If I'm calculating this correctly, this means that it actually requires nearly $460,000 to trade initially, which is far more than the "initial portfolio capital" value.
This pattern continues. At one point, this strategy has nearly 100 orders pending, each of which is about $10,000 in value. This vastly exceeds the "initial portfolio capital" value.
I created a spreadsheet (attached) that is based on the "List of Trades" report, but with each "EnterLong" and "ExitLong" sorted chronologically. I also created some additional columns (highlighted in the spreadsheet) to track the cash flow requirements. I've also attached the original "Performance Report" in Excel.
As a related question, the performance report reports a value of about $177,000 for the "account size required." This is less than what I've calculated, but more than the "initial portfolio capital" value.
Can someone explain why this strategy appears to be making purchases that vastly exceed the "initial portfolio capital" value? Also, how is the "account size required" value calculated, and why is this greater than the "initial portfolio capital" value?
Thanks much in advance.
Cash flow management with Portfolio Backtester
Cash flow management with Portfolio Backtester
- Attachments
-
- SampleReports.zip
- (1.52 MiB) Downloaded 122 times
Re: Cash flow management with Portfolio Backtester
I should add that I don't believe that I had this problem in Version 6. I asked about a related question with the Portfolio Backtester earlier this month, but I had the opposite problem -- the backtester was being too precise with limiting orders to the portfolio value.
viewtopic.php?f=1&t=8438
Could this be a bug with Beta 3? Or did I do something that would cause these results? (I'm testing a different portfolio and strategy than before, so I can't do an "apples to apples" comparison.)
viewtopic.php?f=1&t=8438
Could this be a bug with Beta 3? Or did I do something that would cause these results? (I'm testing a different portfolio and strategy than before, so I can't do an "apples to apples" comparison.)
- Stan Bokov
- Posts: 963
- Joined: 18 Dec 2009
- Has thanked: 367 times
- Been thanked: 302 times
Re: Cash flow management with Portfolio Backtester
Please make sure that you specify 100% in the MaxPotentialLoss settings (attached screenshot). This will tell the Portfolio Backtester that you have 'potentially' lost the $10,000 that you commit to each trade, and should not use this money again to purchase. Please test this out, and let us know if it helps.
As I mentioned in the other thread where we were discussing Portfolio Backtesting (viewtopic.php?f=1&t=8438&p=39506&hilit=portfolio#p39506) - that value affects the amount of money available for reinvesting.
As I mentioned in the other thread where we were discussing Portfolio Backtesting (viewtopic.php?f=1&t=8438&p=39506&hilit=portfolio#p39506) - that value affects the amount of money available for reinvesting.
- Attachments
-
- Portfolio_settings.png
- (87.63 KiB) Downloaded 551 times
Last edited by Stan Bokov on 28 Apr 2011, edited 1 time in total.
Reason: added screenshot
Reason: added screenshot
Re: Cash flow management with Portfolio Backtester
Stan,
I'm sorry -- I spoke too soon. Changing these settings reduced the problem, but didn't eliminate the problem.
I ran some more backtests and exported the results to Excel. I sliced and diced the list of trades so that each buy or sell order is shown in chronological order. It is still showing the strategies going "into debt" -- i.e., making more purchases than there is cash available.
To be more specific, I created a simple strategy that intentionally creates a large number of purchases before a sale is triggered. I used the standard MovAvg Cross LE entry signal (with the default settings), and the TimeExit (Bars) LX exit signal, with an exit after 30 bars on daily bars.
The settings are with an "Initial Portfolio Value" of $100,000, a "Dollars Per Trade" value of $10,000, and both "Max # of Capital at Risk per Position" and "Max Potential Loss" set to 100%.
In this case, the strategy first makes ten EntryLong orders of slightly less than $10,000 each. This is expected.
However, it then places two additional EntryLong orders of about $3,000 each, along with a third order of about $45. All of this occurs before any ExitLong conditions have triggered. This means that the strategy has spent about $106,000, out of an "Initial Portfolio Value" of $100,000, long before any securities are sold.
I'm finding similar results with other strategies, but with even more pronounced overtrading. I've attached a screenshot of the settings, along with the portfolio file and a list of trades in Excel. Can you provide any insight as to what is happening here?
I'm sorry -- I spoke too soon. Changing these settings reduced the problem, but didn't eliminate the problem.
I ran some more backtests and exported the results to Excel. I sliced and diced the list of trades so that each buy or sell order is shown in chronological order. It is still showing the strategies going "into debt" -- i.e., making more purchases than there is cash available.
To be more specific, I created a simple strategy that intentionally creates a large number of purchases before a sale is triggered. I used the standard MovAvg Cross LE entry signal (with the default settings), and the TimeExit (Bars) LX exit signal, with an exit after 30 bars on daily bars.
The settings are with an "Initial Portfolio Value" of $100,000, a "Dollars Per Trade" value of $10,000, and both "Max # of Capital at Risk per Position" and "Max Potential Loss" set to 100%.
In this case, the strategy first makes ten EntryLong orders of slightly less than $10,000 each. This is expected.
However, it then places two additional EntryLong orders of about $3,000 each, along with a third order of about $45. All of this occurs before any ExitLong conditions have triggered. This means that the strategy has spent about $106,000, out of an "Initial Portfolio Value" of $100,000, long before any securities are sold.
I'm finding similar results with other strategies, but with even more pronounced overtrading. I've attached a screenshot of the settings, along with the portfolio file and a list of trades in Excel. Can you provide any insight as to what is happening here?
- Attachments
-
- Test.zip
- (1.3 MiB) Downloaded 117 times
-
- ScreenHunter_02 Apr. 28 22.43.jpg
- (516.52 KiB) Downloaded 543 times