Hi, it would be nice if someone can answer this….
Are this 2 code are the same and work the same way?
CLOSE < low[1] or CLOSE < low[2] or CLOSE < low[3] or CLOSE < low[4]
——————————————–
CLOSE < (low[1] or low[2] or low[3] or low[4])
Many thanks
Hi, it would be nice if someone can answer this….
Are this 3 code are the same and work the same way?
CLOSE < low[1] or CLOSE < low[2] or CLOSE < low[3] or CLOSE < low[4]
——————————————–
CLOSE < (low[1] or low[2] or low[3] or low[4])
————————————————-
c1 = CLOSE < low[1]
c2 = CLOSE < low[2]
c3 = CLOSE < low[3]
c4 = CLOSE < low[4]
s1 = c1 or C2 or C3 or c4
Many thanks
If you number your options then it’s easier fior us to help you as we can easily refer to numbers. 🙂
This
S1 = CLOSE < low[1] or CLOSE < low[2] or CLOSE < low[3] or CLOSE < low[4]
is same as
c1 = CLOSE < low[1]
c2 = CLOSE < low[2]
c3 = CLOSE < low[3]
c4 = CLOSE < low[4]
s1 = c1 or C2 or C3 or c4
This one
CLOSE < (low[1] or low[2] or low[3] or low[4])
won’t work for what you want it to do, e.g. or low[2] will only give you the value of low 2 bars ago.
JSParticipant
Senior
Code1 = Close<Low[1] or Close<Low[2] or Close<Low[3] or Close<Low[4]
Code2 = Close<Low[1] or Low[2] or Low[3] or Low[4]
c1 = Close<Low[1]
c2 = Close<Low[2]
c3 = Close<Low[3]
c4 = Close<Low[4]
Code3 = c1 or c2 or c3 or c4
Return Code1 as "Code1", Code2 as "Code2", Code3 as "Code3"
In addition to GraHal’s explanation:
You can set up a simple indicator to test…
Then you see that Code1 and Code3 give the same results (0 or 1) but that Code2 is always true (always 1). This is probably because in Code2 you don’t give a condition to Low[2], Low[3] and Low[4]. So you’re basically saying here, is there a Low[2] or a Low[3] or a Low[4] (and there always are).
thank you guys, got it now, very appreciate 🙂