Warning message: In `[.data.table`(periods, -1, `:=`(from, from + 1)) : Coerced 'double' RHS to 'integer' to match the column's type; may have truncated precision.

Create issue
Issue #5 resolved
George W. created an issue

CLX9 has over 2000 open interest, so we would reasonably expect it to have some trades. But the following always return empty data table with a warning message. I am not sure whether the data is not available or there is issue with the processing of the data. Could you kindly take a look at this? Thanks a lot!

QCLX19 <- get_iqfeed_data('QCLX19', from='2017-04-08', to='2017-08-09', period='tick') Warning message: In [.data.table(periods, -1, :=(from, from + 1)) : Coerced 'double' RHS to 'integer' to match the column's type; may have truncated precision. Either change the target column to 'double' first (by creating a new 'double' vector length 3 (nrows of entire table) and assign that; i.e. 'replace' column), or coerce RHS to 'integer' (e.g. 1L, NA_[real|integer]_, as.*, etc) to make your intent clear and for speed. Or, set the column type correctly up front when you create the table and stick to it, please.

Comments (6)

  1. Stanislav Kovalevsky repo owner

    Hi George,

    Data is not available for QCLX19 symbol. Several ways to cross check:

    1. Use QuantTools_settings( list( iqfeed_verbose = T ) ) setting to see actual output from IQFeed:
        get_iqfeed_data('QCLX19', from='2017-04-08', to='2017-08-09', period='tick')
        2017-08-09 17:25:19 HTT,QCLX19,20170408,20170520,,,,1,\r\n
        2017-08-09 17:25:19 start download...
        2017-08-09 17:25:20 S,CURRENT PROTOCOL,5.1\r\nE,!NO_DATA!,,\r\n!ENDMSG!,\r\n
        2017-08-09 17:25:20 HTT,QCLX19,20170520,20170630,,,,1,\r\n
        2017-08-09 17:25:20 start download...
        2017-08-09 17:25:21 S,CURRENT PROTOCOL,5.1\r\nE,!NO_DATA!,,\r\n!ENDMSG!,\r\n
        2017-08-09 17:25:21 HTT,QCLX19,20170630,20170810,,,,1,\r\n
        2017-08-09 17:25:21 start download...
        2017-08-09 17:25:23 S,CURRENT PROTOCOL,5.1\r\nE,!NO_DATA!,,\r\n!ENDMSG!,\r\n
        NULL
    
    1. See if data available in lower resolution:
        get_iqfeed_data('QCLX19', from='2017-04-08', to='2017-08-09', period='1min')
        NULL
    
    1. Check other sources
        get_yahoo_data( 'CLX17.NYM', from = '2017-04-08', to = '2017-08-09' )
        NULL
    

    Regarding the warning I am going to update IQFeed engine in several weeks so no irrelevant warnings will be displayed.

  2. George W. reporter

    I noticed something interesting, not sure if it'd be helpful for you to troubleshoot this issue. get_iqfeed_data('@E2CQ17C247500', '2017-02-10', '2017-08-09', 'tick') generated similar warning, but E2CQ17C247500 <- get_iqfeed_data('@E2CQ17C247500', '2017-02-07', '2017-08-09', 'tick') works fine. That's really weird.

    E2CQ17C247500 <- get_iqfeed_data('@E2CQ17C247500', '2017-02-10', '2017-08-09', 'tick') Warning message: In [.data.table(periods, -1, :=(from, from + 1)) : Coerced 'double' RHS to 'integer' to match the column's type; may have truncated precision. Either change the target column to 'double' first (by creating a new 'double' vector length 3 (nrows of entire table) and assign that; i.e. 'replace' column), or coerce RHS to 'integer' (e.g. 1L, NA_[real|integer]_, as.*, etc) to make your intent clear and for speed. Or, set the column type correctly up front when you create the table and stick to it, please. E2CQ17C247500 <- get_iqfeed_data('@E2CQ17C247500', '2017-02-07', '2017-08-09', 'tick')

  3. George W. reporter

    Thanks for checking QCLX19! I did similar checks as well, and none returns any data except the daily bar. But what strikes me is that there are over 2000 open interest as of yesterday, which usually means there should be some trading. Perhaps all those traders happened more than 180 days ago. That's the only explanation I could come up with. Thanks again for sharing this wonderful package!

  4. Stanislav Kovalevsky repo owner

    Yeah, no problem! Thanks for noticing irrelevant warnings. Just updated IQFeed engine. Seems like no warnings thrown now. To apply this fix please update package to dev version using devtools::install_bitbucket( 'QuantTools/QuantTools' ).

    Regarding 180 days period if any trades happened before 180 days they should appear in one minute history which is available since 2007 or something. Strange thing is they are not there too.

  5. Log in to comment