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

Notification

Icon
Error

Options
Go to last post Go to first unread
mhireche  
#1 Posted : Sunday, November 20, 2011 1:36:08 AM(UTC)
mhireche

Rank: Newbie

Groups: Registered, Registered Users
Joined: 8/5/2011(UTC)
Posts: 4

Hello,

I have a problem with the following formula/indicator :

VOLUME>=Ref(VOLUME,-1)*1.5 AND Stoch(20,5)> Stoch(20,3) AND CLOSE<= O+(O * .3)OR CLOSE >= Ref(CLOSE, -1) - (.3 * Ref(CLOSE,-1) AND CLOSE <= O + (O * .3) OR CLOSE > Ref(CLOSE,-1) - (.3 * Ref(CLOSE,-1)))

It is supposed to detect strength out of a bottom. Apparently there is no syntax error in it and it provides a signal.

But the way it is written (lack of parenthesis to delineate clearly items for precedence) make me quite unsure about what is calculated.
I am particularly worried and uncomfortable by the part I highlighted in bold.

Your help will be welcomed.

Thanks and best regards
MS Support  
#2 Posted : Tuesday, November 22, 2011 10:28:49 AM(UTC)
MS Support

Rank: Advanced Member

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

Thanks: 92 times
Was thanked: 155 time(s) in 150 post(s)
if you just had AND linking your conditions, the formula would be fine. However, anytime you mix AND and OR links, you should put parenthesis around the section the OR refers. consider:

A and B or C and D

did the author mean:

(A and B) or (C and D)

or:

A and (B or C) and D

or something else. I can easily show at least two other ways to combine those four conditions.
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.