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

Notification

Icon
Error

Options
Go to last post Go to first unread
j32driver  
#1 Posted : Wednesday, January 30, 2008 11:44:12 AM(UTC)
j32driver

Rank: Member

Groups: Registered, Registered Users
Joined: 6/29/2007(UTC)
Posts: 19

Hi everyone! Need some basic help with MS EOD and plotting moving averages.

I'm playing with an advisor based on the relationship of 3 moving averages... the 3,13, and 39 exponential on a daily chart. Here is my coding for the advisor:

Bull:=Mov(C,3,E)>Mov(C,13,E) AND Mov(C,13,E)>Mov(C,39,E);
Bear:= Mov(C,3,E)<Mov(C,13,E) AND Mov(C,13,E)<Mov(C,39,E);
LE:= Bull AND Ref(Bull,-1)=0;
SE:= Bear AND Ref(Bear,-1)=0;

Heres the problem... when I plot the 3 moving averages on the chart, they don't line up with where the "LE"and "SE" indicators think the moving averages actually are.

To further complicate this, I've noticed that as I scroll a chart from left to right, the 39 Exp. Moving Average changes and slides around. The 3 and 13 don't appear to move, just the 39.

Any ideas?

henry1224  
#2 Posted : Wednesday, January 30, 2008 7:45:52 PM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

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

Bull:=Mov(C,3,E)>Mov(C,13,E) AND Mov(C,13,E)>Mov(C,39,E);
Bear:= Mov(C,3,E)<Mov(C,13,E) AND Mov(C,13,E)<Mov(C,39,E);
A:=If(bull,1,If(Bear,-1,0);

For the long position

A=1 and ref(a,-1)<>1

For the short position

A=-1 and Ref(A,-1)<>-1

For the Long Exit position

A<>1 and Ref(A,-1)=1

For the Shortexit position

A<>-1 and Ref(A,-1)=-1

j32driver  
#3 Posted : Wednesday, January 30, 2008 8:15:55 PM(UTC)
j32driver

Rank: Member

Groups: Registered, Registered Users
Joined: 6/29/2007(UTC)
Posts: 19

Thanks Henry. I'll make the corrections tomorrow morning. Any idea on why the plot of the 39 Moving Average changes value depending on where I scroll the chart to?
j32driver  
#4 Posted : Thursday, January 31, 2008 6:20:07 PM(UTC)
j32driver

Rank: Member

Groups: Registered, Registered Users
Joined: 6/29/2007(UTC)
Posts: 19

Ok... I spent some time today playing with the moving averages. It looks like the problem is only on 1 chart. I can't reproduce the funky plot of the 39 EMA on any other chart except the one. All the other charts and smartcharts appear to act as they should.

On the problem chart, the 1st two EMAs plot like they should, when I plot the 3rd one, it presents options for the new scale on the left. I always choose "merge new scale" and then I get the funky EMA that moves based on where I scroll the chart.
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.