I am attempting you use the Timenum() function to reference previous prices when scanning for signals. When using IQFeed, the output of Timenum() provides the hour and minute, but does not provide granularity up to the latest second. Example, if the time now is 133511, the output of timenum() would be 133500.
This issue goes away when I switch datafeed to IB.
Any idea how I can resolve this?
Note: I have database set to 1-second timeframe and project periodicity to 1-second as well.
In this case it will not show the seconds. That is the issue I have. Notice the output for timenum() is 133800 instead of 133827, and the second() function returns 0
Thanks @empottasch , while those are viable workarounds, I would like to understand the underlying issue since the functions do work fine with IB and not IQFeed.
oh sorry I thought the issue was sub second granularity. I do not know what the issue is. Seems to work for me although I can not check it at the moment
By default it shows the START time of selected intraday interval, therefore if you have selected 1-minute bars for VIEWING, it will show say 12:30:00 for entire duration of bar that begins at 12:30:00 and ends 12:30.59.999999. It is recommended to stay with default setting (mainly for alignment if you use multiple symbols)
The Now() function on the other hand returns just one time, the CURRENT time.
Therefore there is nothing "to resolve". These functions just do two different things.
Final note:
You did not send screenshots from File->Database Settings.
Please remember that the "Base time interval" setting in File->Database Settings, is intended to be set ONCE and kept unchanged. You change the interval for viewing using View menu on the fly, NOT by changing "Base time interval". If you change "Base time interval" after your database was set to different interval, you will get a mixture of data unless you do full Force Backfill. For example if you had 1-minute and changed to 1-second later, you have to do Force Backfill to get 1-second data, to actually get those 1-second bars as they are different kind of animal and go from different IQFeed server / request.
By default it shows the START time of selected intraday interval, therefore if you have selected 1-minute bars for VIEWING, it will show say 12:30:00 for entire duration of bar that begins at 12:30:00 and ends 12:30.59.999999. It is recommended to stay with default setting (mainly for alignment if you use multiple symbols)
I have set it to 1-sec bars for viewing as well. I am sure of it, because when I use IB data, Timenum() output provides up to the second granularity (12:30:59). When I switch to IQFeed, without changing anything, the output is limited to the minute (12:30:00)
First: number of bars is way too low for 1-second database (3000 seconds is not even one hour worth of data).
Secondly you have apparently changed the plugin (the database has "IB" name) once database was set for Interactive Brokers.
Don't do that.
You should start NEW DATABASE via File->New Database
and configure it properly from the start.
Databases with different vendors should be switched by changing the database (File->Open Database).