# OPTIMISATION

Questions about MultiCharts and user contributed studies.
XIKON
Posts: 22
Joined: 15 Dec 2010
Has thanked: 3 times
Been thanked: 3 times

### OPTIMISATION

Hi,

I have been just fiddling with optimisation for moving averages and it appears that we can run both exhaustive and genetic modes which is great however the problem I have is that as I am using '2MovAvglines' LE for entry and SE for exit I need both to have identical fast and slow averages rather than different lengths while the optimisation report lists fast and slow lengths for the entry different from those for the exit strategy. Is there an option which will allow me to filter for those which have identical settings for entry and exit strategy.

On the same note would you recommend that the approach I am taking is correct, ie. that the settings for entry and exit have to be identical?

Many thanks for your contribution.

Regards,

XIKON

piranhaxp
Posts: 236
Joined: 18 Oct 2005
Has thanked: 4 times
Been thanked: 29 times

### Re: OPTIMISATION

Xikon,

you have to implement both signals in one signal in order to be able to optimize like you want. But please be aware to use the same period-inputs for each variable (moving average).

Here one example :

input: short_period(5); // length for the shorter mov. average
input: long_period(20); // length for the longer mov. average
input: basep(c); // basis price for the average calculation = close in this example

var: s_avg(0);
var: l_avg(0);

s_avg = averagefc(basep,short_period);
l_avg = averagefc(basep, long_period);

if s_avg cross below l_avg then sellshort ......
if s_avg cross above l_avg then buy .....

With this example you can optimize both averages in one way.

Right from my quantitative background I can't recommend same parameters for 'long- and 'short'-positions because of the character of long and short markets.

Regards.

Mike

XIKON
Posts: 22
Joined: 15 Dec 2010
Has thanked: 3 times
Been thanked: 3 times

### Re: OPTIMISATION

Hi Mike,

Many thanks for your message and sharing the script. It is much appreciated. I am going through a number of entry and exit strategies to identify any inefficiencies in the market as part of an MBA project. I have found it more difficult than I expected in terms of developing the entry and exit strategies let alone writing the scripts.

Regarding identical fast and slow lengths for entry and exits, I also suspected that it would be counter productive as after exporting the optimisation report to excel and filtering the data,only a handful appeared to fit the criteria and the net profits were below average.

Many thanks again.

XIKON

piranhaxp
Posts: 236
Joined: 18 Oct 2005
Has thanked: 4 times
Been thanked: 29 times

### Re: OPTIMISATION

Xikon,

always a pleasure. If there are any questions pls don't hesitate to ask in the forum or to ask via pm.

Regards.

Mike

Return to “MultiCharts”