AB Crash After Backtest

I am trying to track down an error which occurs after I run a back test with a particular AFL file, but only after I use a particularly large watch list or use specific parameter values (like the percentage for a stop loss). I am still trying to isolate the problem, but wondering if anyone can offer any guidance as to what sorts of tasks AB is executing at this point. I've added a few trace statements, and see this output after the back test has run:

[49724] RPTT: bo.PostProcess()
[49724] MC START
[49724] MC END
[49724] MC Time 0.010610sec
[49724] RPTT: Removing Static Variables
[49724] RPTT: AFL Complete
[49724] Drawdown Table complete
[49724] Monthly Performance chart complete
[49724] Open Positions chart complete
[49724] LowestEq 1.000000, 9, 1000
[49724] LowestEq 5.000000, 49, 1000
[49724] LowestEq 10.000000, 99, 1000
[49724] LowestEq 25.000000, 249, 1000
[49724] LowestEq 50.000000, 499, 1000
[49724] LowestEq 75.000000, 749, 1000
[49724] LowestEq 90.000000, 899, 1000
[49724] LowestEq 95.000000, 949, 1000
[49724] LowestEq 99.000000, 989, 1000
[49724] MC charts rendering thread 0.208360sec

The lines that start with "RPTT" are from my AFL, and show that I've removed my static vars with StaticVarRemove("*") and exited the main AFL (RPTT: AFL Complete). Then we see a few lines from my Report Charts, and we can see that those have also completed. The MC lines are from AB, but they all look the same as they do for a successful run.

After the trade list has appeared and all of the above lines of _TRACE output have been written, the AB Crash Recovery System window appears with this content:

AmiBroker version 6.20.1.6201
( 64-bit, cooltool.dll 6.20.1,  mfc42.dll 6.20.1,  msvcrt.dll 7.0.17134 )

Microsoft Windows 10 version 10.0 (Build 17134)
Service Pack 0.0, Common Controls: 6.16

Unhandled exception
Type:    COleException
The parameter is incorrect.


Additional information:

Multi-threaded charts - ENABLED

Number of stock loaded: 52454
Currently selected stock: #AMEXAD
Number of quotes (current stock): 2897

Workspace:
Data source = PRDA, Data local mode = 1, NumBars = 7500

Preferences:
Data source = (local), Data local mode = 1, NumBars = 7500

Command history:
3393 - Creates new Analysis--New Analysis
3408 - New document--New Tab

Cache manager stats:
Number of list elements: 5000
Number of map elements: 5000
Hash table size: 5987

Memory status:
  MemoryLoad: 49 %
  TotalPhys:     25066112K  AvailPhys:     12656824K
  TotalPageFile: 29805972K  AvailPageFile:  7017952K
  TotalVirtual:  4294967168K  AvailVirtual:  4284618868K

Last Windows message:
HWnd:    0x2e11e0
Msg:    0x0110
wParam:    0x005f046c
lParam:    0x00000000

Log:
Logging started 2018-10-30 11:12:41
     2.83 ms : Enabling low frag heap (0.02 ms)
     2.85 ms : Launching splash screen (1.31 ms)
     4.16 ms : Waiting for splash screen (8.03 ms)
    12.19 ms : Waiting for splash screen (8.07 ms)
    20.26 ms : Alloc other stuff (1.11 ms)
    21.37 ms : Loading amisci.dll (9.46 ms)
    30.83 ms : Setting up SEH translator (120.63 ms)
   151.46 ms : Initializing OLE (0.02 ms)
   151.48 ms : Initializing RichEdit (0.73 ms)
   152.21 ms : Checking current working directory (0.49 ms)
   152.70 ms : Loading persistent variables (0.07 ms)
   152.77 ms : Loading MRU lists (3.27 ms)
   156.04 ms : Loading commisison table (8.39 ms)
   164.43 ms : Loading preferences (1.31 ms)
   165.75 ms : Initializing display settings (0.52 ms)
   166.27 ms : Loading old groups and markets (0.22 ms)
   166.49 ms : Loading GICS and ICB (2.20 ms)
   168.69 ms : Loading plugins (43.79 ms)
   212.48 ms : Loading AT interfaces (0.26 ms)
   212.73 ms : Loading AFL function table (1557.86 ms)
  1770.60 ms : Init chart infos (0.77 ms)
  1771.37 ms : Loading parameters (4.08 ms)
  1775.44 ms : Loading chart infos (0.36 ms)
  1775.80 ms : Loading custom tools (1.20 ms)
  1777.00 ms : Allocating lists (0.07 ms)
  1777.07 ms : Loading layers and alerts (1.24 ms)
  1778.31 ms : Loading miscellaneous data (0.02 ms)
  1778.32 ms : Adding MDI templates (3.60 ms)
  1781.93 ms : Register OLE server (3.25 ms)
  1785.18 ms : Creating main frame object (21.40 ms)
  1806.58 ms : Loading main frame (205.57 ms)
  2012.15 ms : Parsing command line (0.01 ms)
  2012.16 ms : Checking Broker.Document object registration (0.07 ms)
  2012.23 ms : Dispatch commands via ProcessShellCommand (0.05 ms)
  2012.28 ms : Showing main frame window (97.88 ms)
  2110.16 ms : Setting up accelerators (0.11 ms)
  2110.27 ms : Loading database (LoadMarketData) (1101.02 ms)
  3211.28 ms : Setting active symbol (362.22 ms)
  3573.50 ms : Opening default chart (35.62 ms)
  3609.12 ms : Loading default workspace/layout (19.15 ms)
  3628.27 ms : Closing startup splash screen (async in 1 second) (0.36 ms)
  3628.63 ms : Starting up schedule (0.33 ms)
  3628.97 ms : *InitInstance finished

The same problem occurs on two different systems. Both are Windows 10 (one Pro edition with 24GB RAM, the other Home edition with 32GB RAM). AmiBroker is 64-bit v6.20.1 on both systems, and my data provider is Norgate NDU.

Any hints on how to efficiently isolate the problem would be greatly appreciated.

If you get COleException it means that somewhere (in the database or in the code) you have wrong ("impossible") date like 31 February, or Null date, and trying to convert it to OLE date or display it using some formatting like DateTimeToStr.

2 Likes

OK, but it appears that all the primary tasks have been completed: my primary AFL runs to the end, the MC runs have excecuted (judging by the _TRACE output), all of my Report Charts AFL has executed, and the expected HTML and PNG files are present in the AmiBroker/Reports directory. Would an invalid date cause issues when AB is performing housekeeping tasks after the backtest?