Anti Moving Averages Crossover Strategy

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

Anti Moving Averages Crossover Strategy

Postby heyen » Wed Jun 07, 2006 8:19 pm

Hello,

once again a different approach to mechanical trading systems.

I have always wondered, why a MA Crossover is supposed to signal a certain price trend.
When my long term ma crosses below my short term ma, then price can still go south. there is no reference to the vertical direction of price.
Also if i a triple ma system, then once the st crosses above the mt above the lt, the run might be exhausted.

everybody dreams of getting in at the "low"!!!

if i look for a reversal of a short term ma i do konw that price has reversed and is going up.

lets say DEMA[2]>DEMA[1]<DEMA than price has reversed from down trend to up trend. my smoothed ma tells me so.
if i know the stma is above the lt ma i also know its a general uptrend.

same goes for down trend reversal.

if i pinpoint entries by different time frames of the short and long term ma's and just use plain reversals for exit i get a money mashine intraday system.

just let the automatic optimization run over your historical date and see for yourself....

:-)

Any feedback of back tests is welcome.
Since i am using amibroker professional, no TS code - sorry.

If you'd like the amibroker code - PM!
Attachments
antimaco.jpg
Net Profit 3D visu of short and long term optimization
antimaco.jpg (126.41 KiB) Viewed 6510 times

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

User avatar
blr121970
rank: <50 posts
rank: <50 posts
Posts: 23
Joined: Mon May 22, 2006 1:55 am
Reputation: 0
Location: Irvine, California
Gender: Male

Postby blr121970 » Thu Jun 08, 2006 5:26 am

Please post the amibroker code.

Even though most of us are TS users we could still benefit from it.

Thanks,
Ryan

User avatar
blr121970
rank: <50 posts
rank: <50 posts
Posts: 23
Joined: Mon May 22, 2006 1:55 am
Reputation: 0
Location: Irvine, California
Gender: Male

Postby blr121970 » Thu Jun 08, 2006 10:39 pm

I converted your amibroker code to TS.

Looks good on a 1 min ER2:

Return on Initial Capital 2.21%
Annual Rate of Return 56.24%
Buy & Hold Return (2.06%)
Return on Account 168.70%
Avg. Monthly Return $1,105.00
Std. Deviation of Monthly Return $91.92

Code: Select all

// Original Author: Thomas Heyen
// Mechanical Trading Model ER2 - Emini Russel 2000
// Curve Fit June 2006
// Base Time Frame: 15 seconds
//
// Converted to TS strategy by
//            Ryan B. Saldanha (blr121970@yahoo.com)
// Base Time Frame(on TS): 1 minute
// -------------------------------------------------

Input:
    PositionSize  (1),
    MarginDeposit (1),
    perL          (40),
    perL0         (40),
    perL2         (60),
    per0          (50),
    per           (50),
    per2          (74);

Variables:
    MarketHours(false),
    MarketClose(false),
   up(false),
   down(false),
   fastup(false),
   fastdown(false),
   _Buy(false),
   _Cover(false),
   _Short(false),
   _Sell(false);

MarketHours = Time>=094000 AND Time<=154000;
MarketClose = Time>=154444 AND Time<=240000;

up          = (Average(C,perL) > Average(C,perL)[1])
              AND
              (Average(C,perL)[2] > Average(C,perL)[1]);

down        = (Average(C,per)<Average(C,per)[1])
              AND
              (Average(C,per)[2] < Average(C,per)[1]);

fastup      = (Average(C,perL0)>Average(C,perL0)[1])
              AND
              (Average(C,perL0)[2] > Average(C,perL0)[1]);

fastdown    = (Average(C,per0)<Average(C,per0)[1])
              AND
              (Average(C,per0)[2] < Average(C,per0)[1]);

_Buy        = up   AND (Average(C,per) > Average(C,perl2));
_Cover      = fastup;
_Short      = down AND (Average(C,per) < Average(C,per2));
_Sell       = fastdown;

If marketposition = 0 then
begin
   if _Buy then
      Buy this bar
   else if _Short then
      SellShort this bar;
end
else if  marketposition = 1 AND _Sell then
   Sell this bar
else if _Cover then
   BuyToCover this bar;

User avatar
blr121970
rank: <50 posts
rank: <50 posts
Posts: 23
Joined: Mon May 22, 2006 1:55 am
Reputation: 0
Location: Irvine, California
Gender: Male

Postby blr121970 » Fri Jun 09, 2006 3:45 pm

Attached is the strategy in ELD format.
Attachments
MTM-ER2.ELD
(4.06 KiB) Downloaded 313 times

rrobin
rank: 50+ posts
rank: 50+ posts
Posts: 112
Joined: Fri May 19, 2006 11:09 am
Reputation: 0
Location: Cedar Creek Lake, Texas
Gender: Male

Postby rrobin » Fri Jun 09, 2006 4:07 pm

For a 2 month old you are doing good.

Thanks for the code.

6 month old :P

rr

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

geff
rank: 50+ posts
rank: 50+ posts
Posts: 66
Joined: Thu Jun 22, 2006 7:49 pm
Reputation: 0
Location: Los Angeles
Gender: Male

Postby geff » Tue Jun 27, 2006 5:59 pm

Hello, blr121970 and heyen. I tried ER2 1 min on TS with the posted ELD but it wasn't pretty.

What parameters did you use?
Date range?
Exchange Time?
Slippage/Commission?

Thanks, Jeff

User avatar
TheRumpledOne
rank: 10000+ posts
rank: 10000+ posts
Posts: 15558
Joined: Sun May 14, 2006 9:31 pm
Reputation: 3035
Location: Oregon
Real name: Avery T. Horton, Jr.
Gender: None specified
Contact:

Postby TheRumpledOne » Tue Jun 27, 2006 7:41 pm



I couldn't help myself!! :idea:

When I saw this thread and code, I thought I should write a SLOT MACHINE indicator for it. Then I decided to write it as a function that could be used in the POOR MAN'S SLOT MACHINE "PMSM" as an input!!

Which means you can also use it in the AUTO AVERY TRADE MANAGER and any other indicator that uses a function as input.
Attachments
MTM.ELD
(4.69 KiB) Downloaded 283 times

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

Ami Broker Code

Postby heyen » Fri Jun 30, 2006 1:33 pm

Since People haved asked for the AmiBroker code, here it is.

Code: Select all

PositionSize = MarginDeposit = 1;
MarketHours = TimeNum()>=094000 AND TimeNum()<=154000;
MarketClose= TimeNum()>=154100 AND TimeNum()<=240000;

perL0 = Optimize("fast long",40,15,90,5);
perL2 = perL0+Optimize("slow long",30,15,90,5);
per0 = Optimize("fast short",40,15,90,5);
per2 = per0+Optimize("slow short",30,15,90,5);

up= (MA(C,perL2)>Ref(MA(C,perL2),-1)) AND (Ref(MA(C,perL2),-2)>Ref(MA(C,perL2),-1));
down= (MA(C,per2)<Ref(MA(C,per2),-1)) AND (Ref(MA(C,per2),-2)<Ref(MA(C,per2),-1));
fastup= (MA(C,per0)>Ref(MA(C,per0),-1)) AND (Ref(MA(C,per0),-2)>Ref(MA(C,per0),-1));
fastdown= (MA(C,perL0)<Ref(MA(C,perL0),-1)) AND (Ref(MA(C,perL0),-2)<Ref(MA(C,perL0),-1));


Buy = markethours AND up AND (EMA(C,perL2)>MA(C,perL2));
Sell = marketclose OR fastdown;
Short = markethours AND down AND (EMA(C,per2)<MA(C,per2));
Cover = marketclose OR fastup;
PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorGreen);
PlotShapes(IIf(Short,shapeDownArrow,shapeNone),colorRed);
Lang = BarsSince(Buy) < BarsSince(Sell);
kurz = BarsSince(Short) < BarsSince(Cover);
//Plot Trading Ribbon
Color = IIf( Lang, colorGreen, IIf( kurz, colorRed, colorWhite ));
Plot( 1, "", Color, styleArea | styleOwnScale | styleNoLabel, 0, 15 );


fatdog1
rank: 150+ posts
rank: 150+ posts
Posts: 164
Joined: Thu May 18, 2006 11:58 am
Reputation: 0
Gender: Male
Contact:

Postby fatdog1 » Sat Jul 01, 2006 12:27 am

Hi Heyen,

I hope you don't mind.
I read the thread and wanted to chime in.

For Tradestation users, here is a 5 minue workspace of the Russell with blue lines for support and orange lines for resistance between 650 and 780.

I put the lines on the hourly chart and changed it to a 5 minute chart. I will tighten them up to reflect the areas of S/R on the 5 minute chart depending which way the Russell moves next week.

The first area of resistance on a 5 minute chart is 733, but it is small.
740 will be harder to get past since it is big on a 60 minute chart.

725.50 is the first area of support on the 5 minute.

If the price starts to rise when you are near a blue line and the ma's cross, your long trade has a better chance of working out.

If the ma's cross and the price is near an orange line, use caution on new long positions. I personally won't enter long near a orange line if it is the first time back to that area.

If you are already long and have a profit, at least tighten up your stop near orange lines.
I also use those orange line areas to take partial profits on my longs.

An area like 740 would be a good place to enter a short if the ma's cross for an short trade entry signal.

You will get an alert the first time a line is touched.
Attachments
@ER2 Workspace 6-30-06.tsw
Updated 7-4-06
(22 KiB) Downloaded 310 times
@ER2 Workspace 6-30-06.tsw
(22 KiB) Downloaded 275 times
Last edited by fatdog1 on Wed Jul 05, 2006 12:29 am, edited 1 time in total.

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

TS Workspace

Postby heyen » Sat Jul 01, 2006 8:17 pm

Hello fatdog1,

could you please post a screenshot?
i dont use trade station, but amibroker pro.

thank you.

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


Return to “strategy trading & money management”