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!
Anti Moving Averages Crossover Strategy
Moderator: moderators
- heyen
- rank: <50 posts
- Posts: 20
- Joined: Fri May 19, 2006 10:41 am
- Reputation: 0
- Location: Germany
- Gender:
Anti Moving Averages Crossover Strategy
- Attachments
-
- 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.
Thank you for your support.
- blr121970
- rank: <50 posts
- Posts: 23
- Joined: Mon May 22, 2006 1:55 am
- Reputation: 0
- Location: Irvine, California
- Gender:
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
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;
Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.
Thank you for your support.
- TheRumpledOne
- rank: 10000+ posts
- Posts: 15558
- Joined: Sun May 14, 2006 9:31 pm
- Reputation: 3035
- Location: Oregon
- Real name: Avery T. Horton, Jr.
- Gender:
- Contact:
I couldn't help myself!!
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
- heyen
- rank: <50 posts
- Posts: 20
- Joined: Fri May 19, 2006 10:41 am
- Reputation: 0
- Location: Germany
- Gender:
Ami Broker Code
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 );
-
- rank: 150+ posts
- Posts: 164
- Joined: Thu May 18, 2006 11:58 am
- Reputation: 0
- Gender:
- Contact:
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.
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.
- heyen
- rank: <50 posts
- Posts: 20
- Joined: Fri May 19, 2006 10:41 am
- Reputation: 0
- Location: Germany
- Gender:
TS Workspace
Hello fatdog1,
could you please post a screenshot?
i dont use trade station, but amibroker pro.
thank you.
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.
Thank you for your support.