// 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");
}
}