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

Notification

Icon
Error

2 Pages12>
Options
Go to last post Go to first unread
lamkeng  
#1 Posted : Friday, June 15, 2007 1:00:10 PM(UTC)
lamkeng

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 6/15/2007(UTC)
Posts: 9

Please help to develop a moving average indicator as below;

weekly pivot point = ( weekly high + weekly low + end of the week close)/3

3 period weekly pivot point average = (1st week pivot point + 2nd week pivot point + 3rd week pivot point )/3

Thanks.

mstt  
#2 Posted : Saturday, June 16, 2007 5:45:12 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)

Lamkeng

Try this indicator. Notice that it uses the Forum DLL which is available from the files section of this forum. Hope this helps.

Roy

MetaStock Tips & Tools

Code:

 {Weekly Pivot Point SMA}
 {This indicator uses the Equis Forum DLL}
 {Roy Larsen, 2004-2007}
 
 {User settings}
N:=Input("Weekly Pivot Point SMA, Periods",1,99,3);
Q:=Input("Mode, 0=Static 1=Dynamic 2=Delayed",0,2,1);
 {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 weekly HLC prices}
Hw:=HighestSince(1,M,H);
Hw:=ValueWhen(1,J,If(J=1,Hw,ValueWhen(2-G,1,Hw)));
Lw:=LowestSince(1,M,L);
Lw:=ValueWhen(1,J,If(J=1,Lw,ValueWhen(2-G,1,Lw)));
K:=ValueWhen(1,J,If(J=1,C,ValueWhen(2-G,1,C)));
Hw:=ValueWhen(1,Hw>0,Hw);
Lw:=ValueWhen(1,Lw>0,Lw);
PP:=(K+Hw+Lw)/3;
 
{Calculate and plot SMA of weekly pivot points}
J:=J>0; X:=Cum(J*PP);
(X-ValueWhen(N+1,J,X))/N;
lamkeng  
#3 Posted : Sunday, June 17, 2007 8:42:12 AM(UTC)
lamkeng

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 6/15/2007(UTC)
Posts: 9

Roy
lamkeng  
#4 Posted : Sunday, June 17, 2007 8:43:46 AM(UTC)
lamkeng

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 6/15/2007(UTC)
Posts: 9

Roy,

Thanks for your help.

[:)]

Regards,

lamkeng

lamkeng  
#5 Posted : Sunday, June 17, 2007 9:23:36 AM(UTC)
lamkeng

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 6/15/2007(UTC)
Posts: 9

Roy,

Thanks a lot for your help , once again I need your help to develop a moving average indicator as below;

monthly pivot point = ( monthly high + monthly low + end of the month close)/3

3 period monthly pivot point average = (1st month pivot point + 2nd month pivot point + 3rd month pivot point )/3

[:)]

Thanks.

lamkeng

mstt  
#6 Posted : Monday, June 18, 2007 4:24:30 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)

Lamkeng

Try this. You'll need the Forum DLL with this indicator as well.

Roy

MetaStock Tips & Tools

Code:

{Monthly Pivot Point SMA}
 {This indicator uses the Equis Forum DLL}
 {Roy Larsen, 2004-2007}
 
 {User settings}
N:=Input("Monthly Pivot Point SMA, Periods",1,99,3);
Q:=Input("Mode, 0=Static 1=Dynamic 2=Delayed",0,2,1);
 {0, update at last bar of current frame}
 {1, update on each new bar}
 {2, update on first bar of new frame}
 
 {Monthly frame timing}
D:=DayOfMonth();M:=Month();Y:=Year();
A:=ValueWhen(1,Cum(1)=1,Y);
M:=(Y-A)*12+M;I:=M-ValueWhen(2,1,M);
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 monthly HLC prices}
Hm:=HighestSince(1,M,H);
Hm:=ValueWhen(1,J,If(J=1,Hm,ValueWhen(2-G,1,Hm)));
Lm:=LowestSince(1,M,L);
Lm:=ValueWhen(1,J,If(J=1,Lm,ValueWhen(2-G,1,Lm)));
K:=ValueWhen(1,J,If(J=1,C,ValueWhen(2-G,1,C)));
Hm:=ValueWhen(1,Hm>0,Hm);
Lm:=ValueWhen(1,Lm>0,Lm);
 
 {Calculate and plot monthly pivot point SMA}
PP:=(K+Hm+Lm)/3;
J:=J>0; X:=Cum(J*PP);
(X-ValueWhen(N+1,J,X))/N;
lamkeng  
#7 Posted : Monday, June 18, 2007 6:12:40 PM(UTC)
lamkeng

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 6/15/2007(UTC)
Posts: 9

Roy,

Thank you very much . What is the different between static , dynamic and delay mode ? Thanks.

from

lamkeng

lamkeng  
#8 Posted : Tuesday, June 19, 2007 9:20:37 AM(UTC)
lamkeng

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 6/15/2007(UTC)
Posts: 9

Roy,

Thank you very much . I know what is the different between static , dynamic and Delayed already.

thanks.

from

lamkeng

mstt  
#9 Posted : Tuesday, June 19, 2007 12:52:26 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 Lamkeng

I was about to post the following reply when the forum crashed yesterday. It might help someone else so I'll post anyway.

"Static" reports end-of-month (or end-of-week) values on the last bar of month when possible, otherwise on the first bar of the next month. If you had a month with only 1 EOD bar the end-of-month values for that month could not be reported by the indicator until the beginning of the following month. This would be a rare situation but certainly not unheard of. Note that "Static" does not update on the very last bar of a chart.

"Dynamic" is the same as "Static" except that the current (last) month is plotted dynamically as the month is formed with each EOD bar. The indicator updates the current month as each new bar is added, whereas "Static" cannot update until the first bar of a new month is in place (this only applies to the last bar).

"Delayed" holds reporting of results from every month until the first bar of the new month. Think of it as Dynamic mode delayed by one EOD bar.

These options give you choices about how you use the indicators for display, back test or explorations. For example, Dynamic is probably most useful when plotting on a chart. However, when back testing you might want to set to Delayed mode so that there's no danger of trading end-of-frame values (say the end-of-month CLOSE) before that information is actually available. If a trading system buys and sells with a 1-bar delay then there's no need to use the Delayed mode.

Roy

MetaStock Tips & Tools

lamkeng  
#10 Posted : Sunday, June 24, 2007 5:59:51 PM(UTC)
lamkeng

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 6/15/2007(UTC)
Posts: 9

Roy,

Pls advise me on how to develop a sorting criteria for Metastock software for stocks based on Moving average 3 days cross over 7 days in a bullish trend.

Thanks.

lamkeng

aksh  
#11 Posted : Saturday, July 28, 2007 12:04:20 AM(UTC)
aksh

Rank: Member

Groups: Registered, Registered Users
Joined: 1/20/2007(UTC)
Posts: 15

Was thanked: 1 time(s) in 1 post(s)

Hello everyone,

Mr. Roy Larsen is a gem of a person, always ready to help people out. I'm speaking from personal experience.

arun

mahen1602  
#12 Posted : Saturday, January 12, 2008 12:16:26 AM(UTC)
mahen1602

Rank: Newbie

Groups: Registered, Registered Users
Joined: 1/12/2008(UTC)
Posts: 7

HELLO SIR,

HOW CAN I INSTALLED IN MY METASTOCK BUIT IN YOUR weekly pivot point moving average indicator MS FORMULA.

>> Hello sir,
>> i mahendra from India-maharastra-mumbai
>>
>> 1) 5day swing( 5 HHigh Close crossoverclose, 5 LLow croseover
>> close)
>>
>>1) expert advice in 5 day sing in Buy & Sell Signal.
>>
>> please see this link in amibroker chart in 5 day swing
>> http://www.vfmdirect.com/nl/index.shtml
>>
>> please help me replyme
>> mahendra bhavsar.mono :- 91-22-9423226169
>> email:- parulmumbai@yahoo.com
>
> please request you
only one formula built me sir please, & expert with buy -sell signal.


your sent formula is i copy & pest in built indicater & expert in my mstock.
>

mstt  
#13 Posted : Sunday, January 13, 2008 12:39:00 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)

Mahen

Sorry, I don't understand your question.

Roy

sennal999  
#14 Posted : Sunday, March 2, 2008 12:53:31 PM(UTC)
sennal999

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/30/2007(UTC)
Posts: 11

Dear mstt,

Please help me to develop for DAY PIVOT MOVING AVERAGE INDICATOR WITH MOVING AVERAGE 3 AND 5

Advance Thanks.

senthil kumar.M

sennal999  
#15 Posted : Wednesday, March 5, 2008 11:39:24 AM(UTC)
sennal999

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/30/2007(UTC)
Posts: 11

Dear mstt,

I have coded this formula. Is it correct?

{Daily Pivot Point SMA}

{This indicator uses the Equis Forum DLL}

{Roy Larsen, 2004-2007}

{User settings}

N:=Input("Daily Pivot Point SMA, Periods",1,99,3);

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

{0, update at last bar of current frame}

{1, update on each new bar}

{2, update on first bar of new frame}

{Daily 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(Highest(Sum(DayOfWeek()<>

ValueWhen(2,1,DayOfWeek()),5))=5);

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 weekly HLC prices}

Hw:=HighestSince(1,M,H);

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

Lw:=LowestSince(1,M,L);

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

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

Hw:=ValueWhen(1,Hw>0,Hw);

Lw:=ValueWhen(1,Lw>0,Lw);

PP:=(K+Hw+Lw)/3;

{Calculate and plot SMA of daily pivot points}

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

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

REGARDS

SENTHIL KUMAR.M

mstt  
#16 Posted : Wednesday, March 5, 2008 4:10:19 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 Senthil

There is a problem with your adaptation of my Weekly Pivot Point SMA to a daily version for use on intraday charts. I suspect that the problem is in the frame timing module. Never mind because here’s a version that should work properly (it does work for me on a test chart).

The commented last line of code can be enabled and used to check against the result from the nominal output (previous active line). This is done by switching your chart from Intraday to Daily and noting that one plot covers the other (both should have the same value or be so close that it doesn’t matter). As a further check I suggest that you read off the last 5 to 10 indicator values when the chart is set to Daily, then switch to Intraday and verify that the same 5 to 10 last values are observed.

Roy

MetaStock Tips & Tools

{Daily Pivot Point SMA 2008}

{This indicator uses the Equis Forum DLL}

{Roy Larsen, 2004-2008}

{User settings}

N:=Input("Daily Pivot Point SMA, Periods",1,99,3);

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

{0, update at last bar of current frame}

{1, update on each new bar}

{2, update on first bar of new frame}

{Daily 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:=M-ValueWhen(2,1,M);

B:=I=1 AND Max(Hour(),Minute())=0;

G:=LastValue(Highest(Sum(I>0,5))=5);

I:=I AND B=0 OR ValueWhen(2,1,B); 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 daily HLC prices and pivot point}

Hd:=HighestSince(1,M,H);

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

Ld:=LowestSince(1,M,L);

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

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

Hd:=ValueWhen(1,Hd>0,Hd);

Ld:=ValueWhen(1,Ld>0,Ld);

PP:=(K+Hd+Ld)/3;

{Calculate and plot SMA of daily pivot point}

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

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

{Daily chart pivot point SMA check}

{Mov(Typical(),N,S);}

mahen1602  
#17 Posted : Thursday, March 6, 2008 12:25:21 AM(UTC)
mahen1602

Rank: Newbie

Groups: Registered, Registered Users
Joined: 1/12/2008(UTC)
Posts: 7

To enable us to provide more efficient support, use the "Reply" feature in 
your email program when
responding to this email. Please send unrelated issues in a new email.


-----------------------------------------------------------------------


Dear Mahendra Bhavsar

Thank you for contacting MetaStock support, my name is William and I
will be taking ownership of your issue today. Here are the pivot point
formulas you asked for.

Daily:
new:=ROC(DayOfWeek(),1,$)<>0;
yh:=ValueWhen(1,new, Ref(HighestSince(1,new,H),-1));
yl:=ValueWhen(1,new, Ref(LowestSince(1,new,L),-1));
yc:=ValueWhen(1,new, Ref(C,-1));

pp:=(yc+yh+yl)/3;
r1:=(pp*2)-yl;
s1:=(pp*2)-yh;
r2:= pp+r1-s1;
s2:= pp-r1+s1;
r3:= pp+r2-s2;
s3:= pp-r2+s2;

r3;
r2;
r1;
pp;
s1;
s2;
s3;



Weekly:
new:=ROC(DayOfWeek(),1,$)<0;
yh:=ValueWhen(1,new, Ref(HighestSince(1,new,H),-1));
yl:=ValueWhen(1,new, Ref(LowestSince(1,new,L),-1));
yc:=ValueWhen(1,new, Ref(C,-1));

pp:=(yc+yh+yl)/3;
r1:=(pp*2)-yl;
s1:=(pp*2)-yh;
r2:= pp+r1-s1;
s2:= pp-r1+s1;
r3:= pp+r2-s2;
s3:= pp-r2+s2;

r3;
r2;
r1;
pp;
s1;
s2;
s3;



Monthly:
new:=ROC(Month(),1,$)<>0;
yh:=ValueWhen(1,new, Ref(HighestSince(1,new,H),-1));
yl:=ValueWhen(1,new, Ref(LowestSince(1,new,L),-1));
yc:=ValueWhen(1,new, Ref(C,-1));

pp:=(yc+yh+yl)/3;
r1:=(pp*2)-yl;
s1:=(pp*2)-yh;
r2:= pp+r1-s1;
s2:= pp-r1+s1;
r3:= pp+r2-s2;
s3:= pp-r2+s2;

r3;
r2;
r1;
pp;
s1;
s2;
s3;



Please contact us if there is anything further we can help you with,
have a nice day!

Thank You,


sennal999  
#18 Posted : Tuesday, March 18, 2008 4:09:48 AM(UTC)
sennal999

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/30/2007(UTC)
Posts: 11

Dear mstt,

kindly help me to code exploration formula for DAILY PIVOT POINT SMA PERIOD 5, DYNAMIC, crosses WEEKLY PIVOT POINT SMA 3, DYNAMIC and MONTHLY PIVOT POINT SMA 2 , DYNMIC.

THANKS

SENTHIL KUMAR.M

mstt  
#19 Posted : Tuesday, March 18, 2008 2:15:06 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 Senthil

I need more information before I can consider your request. What do you mean by “dynamic”? I know what it means when used in my code but I’m not sure that your meaning is the same. Also, a “cross” of one signal above two others very rarely occurs on one bar. What would be more realistic to search for is a cross of the faster signal across the higher of the two slower signals. Other cross possibilities would perhaps need to be allowed a range of bars in which to check for successive crosses. Limiting to multiple crossovers on the same bar is not a particularly useful exercise so can you be more specific about this. Is you base data EOD or intraday?

Regards

Roy

sennal999  
#20 Posted : Tuesday, March 18, 2008 11:47:13 PM(UTC)
sennal999

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/30/2007(UTC)
Posts: 11

Dear mstt,

I am using these indicators on EOD charts. which one is usefull for EOD chart. dyanamic or static?

I don't have a clear view on that.

My strategy is buy = if daily pivot sma crosses over both weekly and monthly pivot sma .

sell = if daily pivot sma crosses over both weekly and monthly pivot sma.

I am using daily pivot sma for intraday.

Thanks

Senthil kumar.M

Users browsing this topic
Guest (Hidden)
2 Pages12>
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.