logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
blueboy65  
#1 Posted : Tuesday, November 13, 2007 6:19:24 PM(UTC)
blueboy65

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 11/14/2007(UTC)
Posts: 9
Location: Melbourne, Australia

G'day all - is there a way to backtest for Weekly AND Daily signals on the same stock simultaneously ? As an example I would like to test the following:'

1. RSI oversold on Daily chart AND

2. Weekly MA is rising

Any help would be greatly appreciated.

blueboy65

mstt  
#2 Posted : Tuesday, November 13, 2007 6:59:24 PM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)

Hi Blueboy

You could use my "Weekly SMA" indicator for EOD charts as part of your system test on daily data. Setting it up for your specific job shouldn't be too difficult. My "Weekly EMA" formula has to use PREV so would slow a system test down significantly. There are also DLL-based formulas around that allow you to plot weekly values on daily data. However, I'm not sure where you'd get the information you'd need for those, and I can't speak for their accuracy.

Roy

MetaStock Tips & Tools

{Weekly SMA}

{This indicator uses the Equis Forum DLL}

{Roy Larsen, 2004-2007}

{User settings}

N:=Input("Weekly SMA, Periods",1,99,10);

Q:=Input("Mode, 0=Static 1=Dynamic 2=Delayed",0,2,0);

{0, update at last bar of current frame}

{1, update on each new bar}

{2, update on first bar of new frame}

{Weekly frame timing}

{* Day counter from metastock@wabbit.com.au}

M:=Month();A:=Int((14-M)/12);D:=DayOfMonth();

Y:=Year()+4800-A;B:=M+(12*A)-3;

M:=D+Int((2+153*B)/5)+(365*Y)+Int(Y/4)-Int(Y/100)+Int(Y/400)-32045;

{*}I:=Int(M/7);

I:=I-ValueWhen(2,1,I);

G:=LastValue(Lowest(Sum(I>0,5))=5);M:=G+I;

F:=G+(M=0)*ExtFml("Forum.Sum",Ref(I,1),1);

A:=LastValue(Cum(1)-1)=Cum(1);

B:=Alert(A,2)*(A=0);

J:=If(F,1,If(Alert(F,2)=0 AND M,2,0));

J:=If(A+LastValue(J)>2 OR B+(Q=1)=2,1,J);

J:=If(G,1,If(Q=2 OR Cum(J)<=1,M*2,J));

{Calculate and plot a Weekly SMA of CLOSE}

K:=ValueWhen(1,J,If(J=1,C,ValueWhen(2-G,1,C)));

J:=J>0; X:=Cum(J*K);

(X-ValueWhen(N+1,J,X))/N;

hayseed  
#3 Posted : Tuesday, November 13, 2007 7:08:20 PM(UTC)
hayseed

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 3/7/2005(UTC)
Posts: 1,346

hey blue.... roy has done alot of work in the week vs daily ..... some of his indicators could possibly help you.....

looking at your exact 1 and 2 conditions brings to mind something i use quite often when testing against daily and weekly together..... you can divide your weekly ma by 5 and get roughly the same value .... in other words the weekly 50 ma is similar to the daily 10 ma..... so if the daily 50 is rising , often times the weekly 10 is rising also..... it's just an approximation however.....

roy's method is far better for precise work.....h

hayseed  
#4 Posted : Tuesday, November 13, 2007 7:12:59 PM(UTC)
hayseed

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 3/7/2005(UTC)
Posts: 1,346

dangit roy..... you beat me by seconds....... aren't you suppose to be sleeping now.....

oh btw, your hieken ashi indicator ought to be real handy.... thanks.....h

mstt  
#5 Posted : Tuesday, November 13, 2007 7:42:14 PM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)

Hi H

It's the middle of the afternoon here in NZ so I'd better not be sleeping (it's just after 3pm). I didn't mean to steal your thunder - haven't been visiting this site quite so often of late but dropped in today and thought perhaps I should add a couple of thoughts. Take care.

Regards

Roy

blueboy65  
#6 Posted : Tuesday, November 13, 2007 8:26:37 PM(UTC)
blueboy65

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 11/14/2007(UTC)
Posts: 9
Location: Melbourne, Australia

Roy - thanks heaps for the quick response !

Just one question however, I'm assuming the Weekly SMA formula above plost the Weekly SMA on the Daily chart ? If this is so, then how would I determine whether the Weekly Close price is > the Weekly SMA (or would it be implied as long as the Weekly SMA was rising) ?

Sorry for the dumb simple questions but as you can tell I'm just picking this up and have a lot of learning to do.

blueboy65

mstt  
#7 Posted : Tuesday, November 13, 2007 9:10:32 PM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)

Hi Blueboy

You can assume that the weekly CLOSE is above a rising EMA (no matter what the direction of price an EMA always moves towards it), but you CANNOT assume the same thing with an SMA. I think the trick might be to alter the indicator slightly so that it outputs the condition you want instead of the weekly SMA. The weekly price (CLOSE) is developed within the indicator (K variable) as a prerequisite to creating the SMA. To plot a binary on a chart or call for an exploration or system test, change the last two lines from:

J:=J>0; X:=Cum(J*K);

(X-ValueWhen(N+1,J,X))/N;

to:

J:=J>0; X:=Cum(J*K);

X:=(X-ValueWhen(N+1,J,X))/N; K>X;

Or you could call FmlVar("Weekly SMA","K") - the weekly price - and test that for being greater than Fml("Weekly SMA") - the weekly SMA.

FmlVar("Weekly SMA","K") > Fml("Weekly SMA");

To use the indicator to plot both the weekly CLOSE and the weekly SMA, change the last line to:

K; (X-ValueWhen(N+1,J,X))/N;

This last option still allows you to call the Weekly SMA indicator value for an exploration or system test using Fml("Weekly SMA"). Hope this helps.

Regards

Roy

blueboy65  
#8 Posted : Thursday, November 15, 2007 7:17:27 PM(UTC)
blueboy65

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 11/14/2007(UTC)
Posts: 9
Location: Melbourne, Australia

Roy - thanks once again ! I'll give these a try and let you know if I'm having any problems.

blueboy65

Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.