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

Notification

Icon
Error

Options
Go to last post Go to first unread
TomHam  
#1 Posted : Thursday, July 28, 2022 7:39:55 PM(UTC)
TomHam

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/23/2005(UTC)
Posts: 44
Location: Savannah

Was thanked: 6 time(s) in 4 post(s)

I've written a very simple formla (binary output) to show when the Close is above the 20 SMA and below the 100 SMA ; If(C>Mov(C,20,S) AND C<Mov(C,100,S),+1,0).

But when I try to plot this on a Weekly bar chart there are no results.  I'm assuming that the formula is "looking at" daily data and that's the problem.

Is there a way to specify that the forula should use weekly closing price data only?

(I'm trying to avoid using the Security function since I want to plot it on a universe of securities.)

Thanks.        ..............  Tom  ...............

MS Support  
#2 Posted : Friday, July 29, 2022 2:25:54 PM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,812

Thanks: 72 times
Was thanked: 148 time(s) in 144 post(s)
Originally Posted by: TomHam Go to Quoted Post

I've written a very simple formla (binary output) to show when the Close is above the 20 SMA and below the 100 SMA ; If(C>Mov(C,20,S) AND C<Mov(C,100,S),+1,0).

But when I try to plot this on a Weekly bar chart there are no results.  I'm assuming that the formula is "looking at" daily data and that's the problem.

Is there a way to specify that the forula should use weekly closing price data only?

(I'm trying to avoid using the Security function since I want to plot it on a universe of securities.)

Thanks.        ..............  Tom  ...............

Hi Tom,

MetaStock formulas calculate on the interval of the chart they are plotted on as a general rule. Are you getting a 0 value from the indicator or nothing at all? If you are getting a 0 value all the way through the weekly chart it could be simply that the condition was never true for that symbol. If you are getting no values at all you might need to load more data into the chart. I just plotted your formula into a Weekly chart of AAPL.O. The most recent "True" date was 3/8/2019:

Code:
1/18/2019    0
1/25/2019    0
2/1/2019    0
2/8/2019    0
2/15/2019    0
2/22/2019    0
3/1/2019    0
3/8/2019    1
3/15/2019    0
3/22/2019    0
3/29/2019    0
4/5/2019    0
4/12/2019    0

Are you seeing this on one particular symbol or on every weekly chart you look at? Are you using Locally Stored Data or Online Data?

Edited by user Friday, July 29, 2022 2:29:55 PM(UTC)  | Reason: Not specified

TomHam  
#3 Posted : Friday, July 29, 2022 3:35:28 PM(UTC)
TomHam

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/23/2005(UTC)
Posts: 44
Location: Savannah

Was thanked: 6 time(s) in 4 post(s)

Thanks for your reply.

I did find my problem.  It was more in my logic than the formula.  Changing the short MA from 20 to 10 periods gave me more of what I was looking for.  

All is well.    :)          ..........  Tom  ..........

Users browsing this topic
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.