OmniTrader Forum - OmniScan
creating a scan as of a date in the past

^ Top
Craig B

Posts: 16

Joined: 4/21/2006
Location: Brandon, FL

User Profile
 
Subject : creating a scan as of a date in the past
Posted : 8/19/2017 8:00 AM
Post #42364

I'm trying to figure out how to use omnitrader/omniscan to use a scan but also test it as if it were running from a date in the past. The problem I have is that the "days in the past" subscript part of the formula only works from the current market day and I cannot seem to figure out how to run that same formula (and whole scan) as if it were running at a date in the past without having to alter all of the "days in the past" subscripts accordingly. I'd ultimately like to test any of my scans in different time periods to see how they would have performed in the past. Also, any of the metrics shown in the focus list also only reflect the current market date once they are filtered by the scan. It's like I just want to have Omnitrader/Omniscan think it is running only from a date in the past. Any ideas how to accomplish this? thanks!
^ Top
Jim Dean

Posts: 2718

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.
^ Top
Craig B

Posts: 16

Joined: 4/21/2006
Location: Brandon, FL

User Profile
 
Subject : RE: creating a scan as of a date in the past
Posted : 2/4/2018 9:44 AM
Post #44052 - In reply to #42364

Which config file do I edit to change the number of bars in the past that Omnitrader will use for formula subscripts in the past? Also, which parameter in that file do I alter to increase the number of days greater than 250? Thanks!


https://www.omnitrader.com/currentclients/otforum/thread-view.asp?threadid=14481&posts=3