My script requires about 15 constant matrices of floats to perform a few transformations on a handful of input indicators. (If you're curious, the transformation is PCA projection.)

To accomplish this I have tried to initialize the arrays in the code, like this:
Code:
static var pc_1[121][30] = {
  -0.157275083866484, 0.151902882281035, -0.00459335364287939,
    0.0130055542759733, -0.00446267164469449, 0.00249909658366857,
    -0.0466348517770217, 0.0136211757432005, -0.0478944036910219,
...
}



I find I get a compile-time error, Out Of Memory, when the matrices I'm trying to define are 121x30. If I change the program to get by with 15 121x20 matrices instead, the compile step is successful, and the program is correct in operation. So I conclude that the lite-C compiler chokes on initialization of a large array using literals expressed in the code, or that there is a low upper limit on the size of the output binary.

Do you have any strategies for getting around this limitation? I was thinking of reading the values of pc_1 from a text file using file_read at runtime instead. But it will take me some effort to get that right considering the string to float conversion. Before I embark on that, I thought I'd ask, do you think it will work?

My back up plan, which I'm not at all happy with, is to run a background process that is capable of handling this calculation (R perhaps) and have Zorro consult with it (via RPC maybe, somehow) at every bar. Boo.

Last edited by GPEngine; 11/18/13 16:28.