Error

 Previous Topic Next Topic
 dexter #1 Posted : Wednesday, December 1, 2010 6:20:50 AM(UTC) Rank: NewbieGroups: Registered, Registered UsersJoined: 11/28/2010(UTC)Posts: 2 Hi, I'm trying to build an expression were I check for a closing above a moving average, and to see how long that condition has been true, ie how many days the stock has been above the moving average. I want to use it in an explorer where I search for stocks that's currently trading above its MA and be able to sort them or filter by how many days that's been true. Is this possible in MS?
 Wanna join the discussion?! Login to your Discussions forum accountor Register a new forum account.
 wabbit #2 Posted : Wednesday, December 1, 2010 6:30:13 AM(UTC) Rank: Advanced MemberGroups: Registered, Registered Users, Subscribers, Unverified UsersJoined: 10/28/2004(UTC)Posts: 3,111Location: Perth, Western AustraliaWas thanked: 16 time(s) in 16 post(s) Without getting into philosophical arguments: the count of the number of bars above the MA is the BarsSince() the price was below the MA.wabbit [:D]
 dexter #3 Posted : Wednesday, December 1, 2010 12:46:41 PM(UTC) Rank: NewbieGroups: Registered, Registered UsersJoined: 11/28/2010(UTC)Posts: 2 Well, I guess I'm not a programmer.... I've tried the formula If(C>Mov(C,100,E),BarsSince(Cross(C,Mov(C,100,E))),0) The thing that puzzles me is that when I apply the indicator Moving Average with Exponential 100 there are lots of charts with prices closing below the EMA at the end of the chart... Other MA's like the MS11 - adaptive Moving Average, produces a line where prices close above. So, why do they differ?
 henry1224 #4 Posted : Thursday, December 2, 2010 6:38:25 AM(UTC) Rank: Advanced MemberGroups: Registered, Registered Users, SubscribersJoined: 10/29/2004(UTC)Posts: 1,394Location: Glastonbury, CTWas thanked: 2 time(s) in 2 post(s) Dexter,In your statementIf(C>Mov(C,100,E),BarsSince(Cross(C,Mov(C,100,E))),0) it will count the number of bars since the cross of c and the MA as long as the close is greater than the MA and it will stop and plot a 0 if the close is equal or less than the MABarsSince(Cross(C,Mov(C,100,E)))will continue to count the number of bars since the cross of C and the ma until the next crossing
 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.