Announcement

Collapse
No announcement yet.

pdi.efs length anomaly - how come?

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

  • pdi.efs length anomaly - how come?

    I discovered while debugging something I am doing, that

    with both lengths for adx, pdi and ndi set to 14, that
    pdi does not return any data until the 41st bar wherease adx and ndi return data on the 15th bar (not streaming data).

    While this is not a serious problem, once understood, I know of no reason why pdi should behave differntly from adx and ndi. It turns out I have to test for null on the return from those now because of this.

    jgr

  • #2
    Re: pdi.efs length anomaly - how come?

    jgr
    As far as I can see pdi, ndi and adx begin returning a value on the same bar
    That aside good programming practice suggests that one should always check for nulls
    Alex




    Originally posted by jgr
    I discovered while debugging something I am doing, that

    with both lengths for adx, pdi and ndi set to 14, that
    pdi does not return any data until the 41st bar wherease adx and ndi return data on the 15th bar (not streaming data).

    While this is not a serious problem, once understood, I know of no reason why pdi should behave differntly from adx and ndi. It turns out I have to test for null on the return from those now because of this.

    jgr

    Comment


    • #3
      Alexis,

      Thanks for the quick reply.

      If you run that same test, without pdi I think you will see that results show up on 15th. bar. That is what I find curious.

      I actually tried it three ways in which I substitute ema for the adx, ndi and pdi respectively and found that when pdi was in the mix, it started non-null data on bar 41 but without it, bar 15.

      In case it is data dependent, the Stock was FAS and time toward close Friday.

      jgr.
      Last edited by jgr; 07-25-2009, 10:40 AM.

      Comment


      • #4
        jgr
        The results are exactly the same as in my previous test
        Alex




        Originally posted by jgr
        Alexis,

        Thanks for the quick reply.

        If you run that same test, without pdi I think you will see that results show up on 15th. bar. That is what I find curious.

        I actually tried it three ways in which I substitute ema for the adx, ndi and pdi respectively and found that when pdi was in the mix, it started non-null data on bar 41 but without it, bar 15.

        In case it is data dependent, the Stock was FAS and time toward close Friday.

        jgr.

        Comment


        • #5
          Alexis,

          OK, I was substituting ema for the respective adx, pdi or ndi functions. My debugPrintln did not show the whole story.

          What happens is that ema does return non-null after the length (14 in this case). However, the adx, pdi and ndi retun null until the 41st bar. This working on 1 min intraday chart off-line.

          I poked around reading up on the formula for this and it does have a lot of smoothing. Looks like with 14 period input it does not have an output until the 41st period. On a 1 minute chart that is 41 minutes. But the pre-market data gets it going.

          Comment

          Working...
          X