Announcement

Collapse
No announcement yet.

QM #F bad price data (Too many decimals)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • QM #F bad price data (Too many decimals)

    The attached script displays some examples of the bad data being received for QM #F , NYMEX eMini Crude Oil (Light) futures

    Symbol=QM #F
    Rawtime=1149675000 MRTPrice=70.9 MRTBPrice=70.9 MRAPrice=70.925 Close=70.9
    Rawtime=1149675000 MRTPrice=70.85000000000001 MRTBPrice=70.85000000000001 MRAPrice=70.875 Close=70.85000000000001
    Rawtime=1149675000 MRTPrice=70.85000000000001 MRTBPrice=70.825 MRAPrice=70.85000000000001 Close=70.85000000000001
    . . .
    Rawtime=1149675060 MRTPrice=70.8 MRTBPrice=70.8 MRAPrice=70.85000000000001 Close=70.8
    Rawtime=1149675060 MRTPrice=70.85000000000001 MRTBPrice=70.825 MRAPrice=70.85000000000001 Close=70.85000000000001
    Rawtime=1149675060 MRTPrice=70.85000000000001 MRTBPrice=70.825 MRAPrice=70.85000000000001 Close=70.85000000000001
    Rawtime=1149675060 MRTPrice=70.85000000000001 MRTBPrice=70.85000000000001 MRAPrice=70.875 Close=70.85000000000001
    Rawtime=1149202980 MRTPrice=70.825 MRTBPrice=70.825 MRAPrice=70.85000000000001 Close=70.65
    . . .
    Rawtime=1149675120 MRTPrice=70.825 MRTBPrice=70.825 MRAPrice=70.85000000000001 Close=70.825
    Rawtime=1149675120 MRTPrice=70.85000000000001 MRTBPrice=70.825 MRAPrice=70.85000000000001 Close=70.85000000000001
    Rawtime=1149675120 MRTPrice=70.85000000000001 MRTBPrice=70.85000000000001 MRAPrice=70.875 Close=70.85000000000001
    Rawtime=1149675120 MRTPrice=70.85000000000001 MRTBPrice=70.825 MRAPrice=70.85000000000001 Close=70.85000000000001
    Rawtime=1149675120 MRTPrice=70.85000000000001 MRTBPrice=70.85000000000001 MRAPrice=70.875 Close=70.85000000000001
    Rawtime=1149675120 MRTPrice=70.85000000000001 MRTBPrice=70.85000000000001 MRAPrice=70.875 Close=70.85000000000001
    Rawtime=1149675120 MRTPrice=70.85000000000001 MRTBPrice=70.85000000000001 MRAPrice=70.875 Close=70.85000000000001
    Rawtime=1149675120 MRTPrice=70.85000000000001 MRTBPrice=70.825 MRAPrice=70.85000000000001 Close=70.85000000000001
    Rawtime=1149675120 MRTPrice=70.85000000000001 MRTBPrice=70.825 MRAPrice=70.85000000000001 Close=70.85000000000001
    Attached Files

  • #2
    Hello j.r.walker,

    These are not bad prices but floating point numbers, which is how JavaScript represents numbers. The trailing fractional value will not adversely affect any calculations in an EFS study. However, if you want to get rid of it you can round your values accordingly.

    MRTPrice = getMostRecentTrade().toFixed(6)*1;
    MRBPrice = getMostRecentBid().toFixed(6)*1;
    MRAPrice = getMostRecentAsk().toFixed(6)*1;
    vClose = close(0).toFixed(6)*1;

    For more on the floating point representation of numbers in JavaScript, please review this article from our Core JavaScript 1.5 Reference in our EFS KnowledgeBase.
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment

    Working...
    X