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

Notification

Icon
Error

Options
Go to last post Go to first unread
doji88  
#1 Posted : Sunday, July 7, 2013 3:21:40 PM(UTC)
doji88

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 7/2/2013(UTC)
Posts: 6

Hi, I made a filter looking for securities that having a closing price above its 150-day simple moving average. The formula is CLOSE>Mov(CLOSE,150,SIMPLE). However, many of the securities are rejected even though they meet the criteria. Is the formula incorrect?

Thanks [:)]
henry1224  
#2 Posted : Sunday, July 7, 2013 5:13:56 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)
How many bars do you load in an exploration? Don't checkoff minimum , click on 1500 minimum!
doji88  
#3 Posted : Sunday, July 7, 2013 8:29:58 PM(UTC)
doji88

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 7/2/2013(UTC)
Posts: 6

Figured it out thanks! Btw, can you create a filter with both OR and AND functions?
(E.g. Securities with volume greater than 1M with a doji or hammer? V>1000000 AND Doji() OR Hammer()
Or would it be better to have two explorations? The first exploration for volume and the second exploration for the candlesticks.
mstt  
#4 Posted : Tuesday, July 9, 2013 1:36:01 AM(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 doji

The Explorer Filter window accepts code just the same as any of the columns as well as being able to make decisions from the results of one or more columns. If you know how to create an indicator then you've pretty much got it covered. AND has a higher precedence than OR, so there are some situations where logical expressions need to be enclosed by brackets, and some where they are not.

ConditionA AND ConditionB OR
ConditionC AND ConditionD OR
ConditionE AND ConditionF;

is the same as...

(ConditionA AND ConditionB) OR
(ConditionC AND ConditionD) OR
(ConditionE AND ConditionF);

but

ConditionA AND (ConditionB OR
ConditionC) AND (ConditionD OR
ConditionE) AND ConditionF;

is totally different.

Two expressions connected by AND must both be TRUE for the combined expression to be TRUE. Practicing the combination of various expressions should teach you the basic rules fairly quickly. If in doubt then grouping with brackets is a pretty safe way to go, assuming you have a basic knowlege of logic.

One point that trips up a number of new Explorer users is that the Filter result is only relevant on the last data bar. The only result that counts is the last bar. If you're having trouble visualising a column or filter result looks like it's a good ide to reconstruct the particular piece of code as an indicator in the Indicator Builder. Dropping the test indicator onto a chart will show what the result looks like on every bar, not just the last bar.

Roy

doji88  
#5 Posted : Tuesday, July 9, 2013 4:33:29 AM(UTC)
doji88

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 7/2/2013(UTC)
Posts: 6

Thanks for the in-depth explanation. The examples helped a lot!
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.