OmniTrader Forum OmniTrader 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.

Only Forum Moderators, Administrators, and the owner of this message may delete it.

Jim Dean

Posts: 2891

Joined: 9/21/2006
Location: L'ville, GA

User Profile
Subject : RE: creating a scan as of a date in the past
Posted : 8/19/2017 8:14 AM
Post #42366 - In reply to #42364

Can be done but a bit tricky.

Build scan formula as usual, then "and" it (in paren's) with:
Baryear()=yyyy and barmonth()=mm and bardayofmonth()=dd

THEN, to get OScan to apply that rule to all the loaded bars,
Insert entire formula into this: Sum((formula),250) < 0

The inserted formula, wrapped in parens, returns its true/false result as -1 or 0. The Sum function adds up the returned values for the past 250 bars. So, when the formula "hits" the day you specified, it will return -1 only if your other scan criteria are valid for that day. All the other days will return 0 since the date specs don't match. Voila!

However - note that OScan natively only loads in the most recent 250 daily bars, so if you want to go back further, you need to change the config file - and Barry dis-recommends doing that (not sure why).

If you are using MarketScan intraday timeframes, you can also include barhour() &/or barminute() in the specifier.

[Edited by Jim Dean on 8/19/2017 8:16 AM]

Deleting message 42366 : RE: creating a scan as of a date in the past

Nirvana Systems
For any problems or issues please contact our Webmaster at