Sometimes you want your strategy to read variables out of an external file. Use the file_content and sscanf functions for that:

Code:
// helper function - read a variable from a string
// with a format like "name = 12.34"
var readVar(string str,string name)
{
  float f = 0; // sscanf needs float
  string s = strstr(str,name);
  if(s) s = strstr(s,"=");
  if(s) sscanf(s+1,"%f",&f);
  return f;
}
 
function run()
{
  static var Parameter1 = 0, Parameter2 = 0;
  if(is(INITRUN)) { // read the parameters only in the first run
    string setup = file_content("Strategy\\mysetup.ini");
    if(setup) {
      Parameter1 = readVar(setup,"Parameter1");
      Parameter2 = readVar(setup,"Parameter2");
  }
}


mysetup.ini is a plain text file that contains the values of the variables, in a format like this:
Code:
Parameter1 = 123
Parameter2 = 456