Vintage MACO Replica

trading strategies and money management discussion, code, results

Moderator: moderators

User avatar
heyen
rank: <50 posts
rank: <50 posts
Posts: 20
Joined: Fri May 19, 2006 10:41 am
Reputation: 0
Location: Germany
Gender: Male

Vintage MACO Replica

Postby heyen » Thu Jun 08, 2006 9:04 am

We all know the theory of Simple, Double or Triple Moving Averages.

How about a system that uses only 1 MA and nothing else?

I had trouble modelling a MA CO Model for a future, so i tried a MA Xover with its lagging self. And voila, it did work.

But results improved when using a fast DEMA crossing over its same period EMA thats lagging behind.

This is an intraday trading model.

In case you would like the AmiBroker code:


/* #########################
Lagging MA Crossover Model
Author: Thomas Heyen
Amibroker Professional Code
#########################*/


MarketHours = TimeNum()>=093000 AND TimeNum()<=154400;
MarketClose= TimeNum()>=154444 AND TimeNum()<=240000;
PositionSize = MarginDeposit = 1; // Do not reinvest Profits in backtest

//TF = Optimize("TF",15,15,900,15); // Test 15sec to 15min Bars
/* Timeframe is 2 Minutes */
TimeFrameSet(120);

smooth = Optimize("smooth",20,2,40,1); //20 for DEMA X EMA
Lag = Optimize("lag",24,2,40,1); //24 for

fast = DEMA(C,smooth);
slow = Ref(EMA(C,smooth),-Lag);

Buy = Cross(fast,slow) AND MArkethours;
Sell = Cross(slow,fast) OR MArketclose OR slow == fast;
Cover = Cross(fast,slow) OR MArketclose OR slow == fast;
Short = Cross(slow,fast) AND MArkethours;

PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorGreen);
PlotShapes(IIf(Short,shapeDownArrow,shapeNone),colorRed);

// Plot Trading Ribbon
Color = IIf( BarsSince(Sell)>BarsSince(Buy), colorGreen, IIf( BarsSince(Cover)>BarsSince(Short), colorRed, colorGrey50 ));
Plot( 1, "", Color, styleArea | styleOwnScale | styleNoLabel, -0.1, 15 );

TimeFrameRestore();
Attachments
L-MA-CO.jpg
L-MA-CO.jpg (227.01 KiB) Viewed 285 times
Last edited by heyen on Thu Jun 08, 2006 9:20 am, edited 1 time in total.

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.

User avatar
michal.kreslik
rank: 1000+ posts
rank: 1000+ posts
Posts: 1032
Joined: Sat May 13, 2006 2:40 am
Reputation: 0
Location: Monte Carlo, Monaco
Real name: Michal Kreslik
Gender: Male
Contact:

Postby michal.kreslik » Thu Jun 08, 2006 9:11 am

Wow, the 3D output graphs from AmiBroker do really look cool!

Another way to use only one MA is to focus on the direction changes within that one MA.

User avatar
heyen
rank: <50 posts
rank: <50 posts
Posts: 20
Joined: Fri May 19, 2006 10:41 am
Reputation: 0
Location: Germany
Gender: Male

Direction changes

Postby heyen » Thu Jun 08, 2006 9:36 am

Michal,

your suggestion fits to the "MA NOX"-Idea in the other thread.
I have to get deeper ino this - an uptrend accelleration should
weigh more than a plain reversal. Good point.

But i also think of TRO's multi MA slot mashine.
Maybe if we compare directional change of multi time frame MA's
we could spot interesting correlations.

The 3D graphs of a 2-variable optimization helps to spot if a strategy
is sound. If a certain combination spikes through the breakeven plain
then its not likely to have a good model. But if we have hill we can
accept changes in conditions and still stay profitable.

AmiBroker is my best investment for the past months!

User avatar
michal.kreslik
rank: 1000+ posts
rank: 1000+ posts
Posts: 1032
Joined: Sat May 13, 2006 2:40 am
Reputation: 0
Location: Monte Carlo, Monaco
Real name: Michal Kreslik
Gender: Male
Contact:

Re: Direction changes

Postby michal.kreslik » Thu Jun 08, 2006 9:54 am

heyen wrote:The 3D graphs of a 2-variable optimization helps to spot if a strategy
is sound. If a certain combination spikes through the breakeven plain
then its not likely to have a good model. But if we have hill we can
accept changes in conditions and still stay profitable.


Sure, this is called the nearest neighbor parameter selection. Genetic algorithms, for example, always produce such a gradually shaped fitness landscape.

The problem with 3D graphs is that they can only visualize 3 parameters at a time.

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.


Return to “strategy trading & money management”