is there a way to load a file into the memory during optimization and each - page 2

 
Lorentzos Roussos #: I'll need to iterate through the members of structures , i'll go ahead and assume the only way is custom arrays with members , or , dedicated function to export code .

I'm not sure what you mean, but any file data, whatever it may be can easily be transcoded into globally scoped constant data.

You could even write some code to read in a file and produce the MQL code for you to be used as an include file at compile time.

 
Dominik Christian Egert #:


As a suggestion, use a uchar resource and read the file at compile time, split the uchar array and restore your struct this way CharToStruct()

To create the file, go the other way around, StructToChar() and write-append it to a bin-file.

Easier, more versatile approach, I guess.

Greetings.

The loading is what i'm trying to dribble around

 
Dominik Christian Egert #As a suggestion, use a uchar resource and read the file at compile time, split the uchar array and restore your struct this way CharToStruct() To create the file, go the other way around, StructToChar() and write-append it to a bin-file. Easier, more versatile approach, I guess.
No, that will still have loading and processing. Best to do that off-line and produced properly prestructured code for compile time that will be ready to use at run time.
 

its stuck in compilation  🤣


I did not account for size limitations 

 
Lorentzos Roussos #:

The loading is what i'm trying to dribble around

Why ?
 
Lorentzos Roussos:

subsequent pass not having to load the file again ?

(load a constant structure once from a file and work on that , sort of)

tx 

Not possible.
 

no bueno  🤣

Alain Verleyen #:
Why ?

Load structure : test , test , test , test , test 

vs

Load structure : test , Load stucture : test , Load structure : test , Load structure : test.

 
Lorentzos Roussos #:

no bueno  🤣

Interesting. Is it code you can share ? I could check and report it to a developer.

Load structure : test , test , test , test , test 

vs

Load structure : test , Load stucture : test , Load structure : test , Load structure : test.

Yes of course. But is it so problematic to load each time ?
 
Lorentzos Roussos #: no bueno  🤣 Load structure : test , test , test , test , test  vs Load structure : test , Load stucture : test , Load structure : test , Load structure : test.
Remember that you will need to escape special characters like quotes, etc.
 
Alain Verleyen #:
Interesting. Is it code you can share ? I could check and report it to a developer.
Yes of course. But is it so problematic to load each time ?

Its an array , that's the lowest level i could brind it down to but , 300 megabytes .

The code compiles if the array is -1.0's 0.0's 1.0's , (in other words if theres 3 values per slot)

20x90x12000 slots 

But , if its 4 digit mixed values(i.e. : any value between -1.0 or 1.0) (they can't go above 1.0 or below -1.0 anyway) it cannot compile .

To simplify : 

  • -300MB+ include
  • -of a double array 
  • -compiles when array varies between 3 values
  • -does not compile otherwise
  • -i'm allowing 4 digits in the array upon creation of the include
  • -the values cannot go above 1.0 or below -1.0

Fernando Carreiro #:
Remember that you will need to escape special characters like quotes, etc.

Its just a double array include , a huge array but it compiles in some cases.

edit : i also created a secondary structure where array sizes are static but no gain in speed , the "bottleneck" is in loading the complex structure 

I will also try loading the array not as an include , i'll still be loading on every pass (300mbs at that) but maybe the fact its a double array will help

Reason: