Thanks! But...
I'm not sure that's the answer.
As I said, the script correctly works in "Test" mode, so I select the assets correctly in the buy and sell functions. These are the buy/sell functions of my script:
void vendemosSpread(double hedgeRatio){
asset(asset1);
Margin = 1;
//if (!TradeIsOpen)
enterShort();
asset(asset2);
Margin=1*abs(hedgeRatio);
enterLong();
}
void compramosSpread(double hedgeRatio){
asset(asset1);
Margin=1;
//if (!TradeIsOpen)
enterLong();
asset(asset2);
Margin=1*abs(hedgeRatio);
//if (!TradeIsOpen)
enterShort();
}
being asset1 and asset2 strings of 2 different assets.
But when I'm in Training mode, with these optimize lines I've just added, this is the output:
Parameter 1 step 2: 1.00 => 0.00 0/34
Selected p1[2] = +0.600 => -0.67
Parameter 2 step 1: 0.00 => 0.00 0/46
Parameter 2 step 2: 1.00 => 0.00 0/34
Selected p2[2] = +0.600 => -0.67
USD/CHF: +0.600 +0.600=> 0.000
Parameters stored in statArb5_8.par
.
Parameter 1 step 1: 0.00 => 0.00 0/ 6.
Every output gives "0", and the training only generates .par for one of the assets, not the second one...
Any ideas?