StockFetcher Forums · General Discussion · Backtesting errors<< >>Post Follow-up
tylercabral
14 posts
msg #119013
Ignore tylercabral
modified
4/7/2014 10:10:19 PM

I have been running a lot of backtests and have begun manually reviewing them and have found several errors.

The first error I have found is one where certain trades are not included. This error is particularly unusual since when I use different backtesting ranges sometimes the trade shows up and sometimes it doesn't. For instance when I use the last 3 months this trade shows up but when I use the last two years it does not. This is a trade that triggered its exit today.

The second error I am running into is that the close price for the trade is reported as the open of one day when it should be the open of another. This error is also occurring on a trade that's trigger date is today. The trade shows the exit price as today's open when it should be today's close. As a note there are several other trades that have today as the trigger date, but they all accurately use the close price at the exit (I have the option "Close OPEN Positions at End" selected).

Has anyone else experienced these errors? It makes me really concerned about whether or not other such errors are occurring in the other tests I have run.

(I realize this should not be in the forum but the backtesting one instead, if it could be moved that would be great)

stockfetcher
963 posts
msg #119017
4/8/2014 8:01:21 AM

Concerning the first item you mention. It is very common for a trade to appear in one time-frame, but not another depending on your backtest settings. We recommend reviewing:

http://www.stockfetcher.com/help/Why-did-a-particular-stock-not-appear-as-a-trade/100288

With respect to the second item, it is difficult for us to fully understand the issue you are reporting without reviewing a specific saved backtest and related trades/dates. Please provide this information and we would be more than happy to investigate the issue further.

Thank you,
StockFetcher Support


tylercabral
14 posts
msg #119027
Ignore tylercabral
4/8/2014 11:54:50 AM

Thank you for the response. Regarding your first comment I am very aware of those potential reasons, but not of them are the cause as multiple trades is enabled, all simulated money is never completely used (I set the equity amount arbitrarily high), the limit of 25 trades is never near exceeded (the max is 3), SCTY certainly traded and does not have gaps as evidenced by being included in other back tests, and the last point #5 is not applicable.

If you look at my backtests, in "Backtest 1" there is no trade for SCTY on 4/1/14. However, when I change the analysis period to be shorter, "Backtest 2", without changing an other settings (this is a copy of Backtest 1), this trade now appears.


With regard to the second error, if you look at "Backtest 3" you will see that BLDP and SCTY, which have exit trigger dates as the last day in the analysis period (4-7-14), use the OPEN price from this day rather than the close price as the exit price. The exit was triggered as a result of this days trading action so this should use the close price not the open, much the same as stocks that have not triggered for sell yet.

stockfetcher
963 posts
msg #119029
4/8/2014 12:28:41 PM

SCTY does not appear in Backtest #1 due to item #4 from the previously supplied help topic:



BLDP and SCTY exited at OPEN on 4/7/2014 in "Backtest #3" because they apparently met your trigger, as indicated on the Trades tab. Which, based on your test settings, directs that the "OPEN" price is used.

If this does not match your records, please let us know.

Thank you,
StockFetcher Support


tylercabral
14 posts
msg #119033
Ignore tylercabral
modified
4/8/2014 3:13:50 PM

Thank you for the clarification on the first point, I had overlooked the requirement of existing at the start date of the analysis.

With regard to the second point, indeed the OPEN price should be used, but the open price from the day following the trigger. All other trades are triggered a given day and sold using the next days' open price (e.g., STX is triggered on 3/6 and sold using the open price on 3/7). The trigger date for these two stocks is listed as the exit date since this is the last day in the analysis. However, the sale date should be the following day's open. Since there is no next day, it would be logical to use the close price from this day as the exit, however, it uses the open price, which is illogical since the trigger occurred as a result of that days action.

stockfetcher
963 posts
msg #119036
4/8/2014 3:43:22 PM

You are correct the open is used (as configured in your test.) Because this is the last day of the backtest, and the following "open" is not available, the default "open" price is chosen.

StockFetcher Support


StockFetcher Forums · General Discussion · Backtesting errors<< >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2016 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus