Announcement

Collapse
No announcement yet.

EFS Question

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

  • EFS Question

    Hi

    Regarding the commands

    getMostRecentAsk()
    getMostRecentBid()
    getMostRecentTrade()
    getMostRecentTradeSize()


    I have seen the following check done on the initial data

    var nTempAsk = getMostRecentAsk();
    var nTempBid = getMostRecentBid();

    if (nTempAsk != null && nTempAsk != 0) nAsk = nTempAsk;

    if (nTempBid != null && nTempBid != 0) nBid = nTempBid;


    Is this check necessary? ie can I just use
    nAsk = getMostRecentAsk();

    It seems to have worked fine without it so far.

    TIA

  • #2
    Re: EFS Question

    Musashi
    It is not required if that is what you are asking but it is good practice to check if a value is valid especially if you are going to use it in the context of equations (for example to avoid divide by 0 or NaN errors)
    Alex


    Originally posted by Musashi
    Hi

    Regarding the commands

    getMostRecentAsk()
    getMostRecentBid()
    getMostRecentTrade()
    getMostRecentTradeSize()


    I have seen the following check done on the initial data

    var nTempAsk = getMostRecentAsk();
    var nTempBid = getMostRecentBid();

    if (nTempAsk != null && nTempAsk != 0) nAsk = nTempAsk;

    if (nTempBid != null && nTempBid != 0) nBid = nTempBid;


    Is this check necessary? ie can I just use
    nAsk = getMostRecentAsk();

    It seems to have worked fine without it so far.

    TIA

    Comment


    • #3
      Wow that was fast!

      Thanks Alex

      Comment


      • #4
        Musashi
        You are most welcome
        Alex


        Originally posted by Musashi
        Wow that was fast!

        Thanks Alex

        Comment

        Working...
        X