OmniTrader Professional Forum OmniTrader Professional Forum
forums calendars search
today this week
 
register logon control panel Forum Rules
You are currently browsing as a guest.
You should logon to access more features
A Self-Moderated Community - ALL MEMBERS, PLEASE READ!
Vote for Members who contribute the most to your trading, and help us moderate content within the Forums.


  Current location        Thread information  
OmniTrader Professional Forum
OmniScan
Scan lookback
Last Activity 1/3/2021 5:03 PM
5 replies, 108 viewings

Jump to page : 1
Now viewing page 1 [25 messages per page]
 
back reply
Printer friendly version

^ Top
Duxx

Elite
50010010010025
Posts: 835

Joined: 2/18/2009

User Profile
 
Subject : Scan lookback
Posted : 1/2/2021 7:33 PM
Post #31333

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

Sage
20001000100100100
Posts: 3321

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Scan lookback
Posted : 1/2/2021 7:36 PM
Post #31334 - In reply to #31333

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.

[Edited by Jim Dean on 1/2/2021 8:39 PM]

^ Top
Duxx

Elite
50010010010025
Posts: 835

Joined: 2/18/2009

User Profile
 
Subject : RE: Scan lookback
Posted : 1/2/2021 7:46 PM
Post #31335 - In reply to #31334

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

Sage
20001000100100100
Posts: 3321

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Scan lookback
Posted : 1/2/2021 8:42 PM
Post #31336 - In reply to #31335

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.

[Edited by Jim Dean on 1/2/2021 8:43 PM]

^ Top
Duxx

Elite
50010010010025
Posts: 835

Joined: 2/18/2009

User Profile
 
Subject : RE: Scan lookback
Posted : 1/3/2021 4:33 PM
Post #31337 - In reply to #31336

This worked. Thank you Jim and Happy New Year
^ Top
Jim Dean

Sage
20001000100100100
Posts: 3321

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Scan lookback
Posted : 1/3/2021 5:03 PM
Post #31338 - In reply to #31337

Always happy to help.
Keep that Sum( -( boolean ), periods ) trick in mind. It can be very useful for a lot of situations.
Jump to page : 1
Now viewing page 1 [25 messages per page]
back reply

Legend    Action      Notification  
Administrator
Forum Moderator
Registered User
Unregistered User
E-Mail this thread to a friend
Toggle e-mail notification


Nirvana Systems
For any problems or issues please contact our Webmaster at webmaster@nirvsys.com.