OmniTrader Professional Forum
-
OmniScan
Scan lookback |
^ Top | ||
Duxx![]() Posts: 881 Joined: 2/18/2009 ![]() | How can I write a scan that looks for a condition in the last x days? Here is a simple example Loock for stocks that had volume of X in the last 126 days and C>O at the same time Thank you | |
^ Top | ||
Jim Dean![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() | Sum(-(V>100000 and C>O), 126) = 126 But that will never happen. No stock has 126 green bars in a row, that I know of. | |
^ Top | ||
Duxx![]() Posts: 881 Joined: 2/18/2009 ![]() | Jim Thank you Maybe my description was incorrect. 1) Look for the past 126 days for any stock with volume greater than X The scan should give me only stocks that had that volume condition in the past 126 days 2) The second condition was that on the specific days the volume was met on condition 1.... the price ended higher Maybe the second condition cannot be done in omniscan... but the first should be doable? I took out the C>O and still did not get what I was looking for. Thanks | |
^ Top | ||
Jim Dean![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() | Sum(-(V>100000 and C>O), 126) >= 1 The and-condition being true results in (-1), otherwise it’s zero. Negative sign converts it to positive one. Sum function processes that rule for 126 days and adds the results. If it was true for one or more of those days, the sum will report the number of days it was true for. | |
^ Top | ||
Duxx![]() Posts: 881 Joined: 2/18/2009 ![]() | This worked. Thank you Jim and Happy New Year | |
^ Top | ||
Jim Dean![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() | Always happy to help. Keep that Sum( -( boolean ), periods ) trick in mind. It can be very useful for a lot of situations. |