Optimizing rule-based system with EMA
Author: jkkifs
Creation Date: 5/21/2015 4:51 AM
profile picture

jkkifs

#1
Hi,

I would like to optimize simple EMA trend following system.

Basic Input -
Entry - Buy @ close - when Price crosses above EMA 20,
Exit - Sell @ clsoe - when price crosses below EMA 20,

Entry - Short @ close - when price crosses below EMA 20,
Exit - Cover @ close - when price crosses above EMA 20,

after converting this rule based strategy to rule based, I tried doing optimisation,

SET Optimization strategy parameters as follows.

parameters - default - start - stop - step
ma period - 20 -15 -80 -2
ma period - 20 -15 -80 -2
ma period - 20 -15 -80 -2
ma period - 20 -15 -80 -2

but after begin optimization it took several time & it even uses combination of different ema for entry & exit for optimization results ( which makes system more complex, though some time useful ).

I simply want, it should test same EMA value for entry n exit in optimization results. rather than different combination.

like ema 20 results , then 22, then 24, then 26 rather than giving different combination of averages for entry and exit.

please help guys.
profile picture

jkkifs

#2
attached print screen of optimization results.

first row is perfect , as it uses MA period ( 2 ) for all MA Period entry and exit, but later on it starts using different MA period for entry and exit.
profile picture

Eugene

#3
When exposing strategy parameters in Rule-based systems, each parameter is individual even though you believe this is the same 20-period EMA shared by the four conditions. But the computer does not know a thing about your intentions. You can edit the converted code, replacing the 3 superfluous EMAs with just one. Or, taking the code from this KB article as a template, create an optimizable system with just 1 EMA:

CODE:
Please log in to see this code.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).