Registered User Joined: 11/19/2015 Posts: 7
|
Hi Bruce,
I was wonderinf how to combine two if then statements? I wanted to create a PCF where todays open must be between yesterdays open and close regardless if yesterday was green or red. I broke these up into two if then statements where
IF (C.1>O.1) THEN (O<C.1) AND (O>O.1)
and
IF (C.1<O.1) THEN (O>C.1) AND (O<O.1)
How would i be able to combine the two?
|
Administration
Joined: 9/30/2004 Posts: 9,187
|
Try this: (O < C1 and O > O1) OR (O > C1 and O < O1)
This formula will return True when today's Open falls between the previous day's Open and Close. It checks for both "up" and "down" days.
|
Registered User Joined: 11/19/2015 Posts: 7
|
Hi Bruce,
thanks so much. i just ended up using
ABS(C.1-O.1) >= ABS(C.1-O) AND
ABS(C.1-O.1) >= ABS (O.1-O)
I was wondering how one would code in consistently lower swing point highs and conversely consistently higher swing point lows?
|
Administration
Joined: 9/30/2004 Posts: 9,187
|
You might find some of this material useful Plotting Swing Highs and Lows with Dots.
There are a few more links within that topic as well.
|