Ok, so it make sense not switching the order of the assets.
I have several more questions.
I want to start from the following one.
Consider the following Objective function:

Code:
vars PriceMed = series((priceHigh()+priceLow())/2);
ZigZag(PriceMed, 0.0037, 16, 1);
adviseLong(SIGNALS+BALANCED, rSign, ADX(16));



If I run it in Train mode I get:

Code:
17.05083,1.00000
15.92449,1.00000
15.35854,1.00000
14.35458,1.00000
13.80413,1.00000
14.31322,1.00000
16.44507,-1.00000
16.44507,-1.00000
16.44507,-1.00000
16.44507,-1.00000
18.18639,-1.00000
19.83614,-1.00000
21.73008,-1.00000
23.44226,-1.00000
24.77156,-1.00000
25.96473,-1.00000
27.43466,-1.00000
29.02421,-1.00000
30.23936,-1.00000
32.22313,-1.00000



which make sense...but If I change the function to:

Code:
vars PriceMed = series((priceHigh()+priceLow())/2);
ZigZag(PriceMed, 0.0037, 16, 1);
adviseLong(SIGNALS+BALANCED, ifelse(rSign==1, 0, 1), ADX(16));



I get the following:

Code:
17.05083,-0.58358
15.92449,0.03484
15.35854,-0.78387
16.44507,1.00000
14.35458,-1.91621
18.18639,1.00000
13.80413,-2.16878
19.83614,1.00000
14.31322,-1.98588
21.73008,1.00000
23.44226,1.00000
24.77156,1.00000
25.96473,1.00000
27.43466,1.00000
29.02421,1.00000
30.23936,1.00000
32.22313,1.00000



which does not make so much sense!
The records are first records of the file. After the first records everything seems fine.
Is there any reason for that?

Thanks.
Cheers.