Announcement

Collapse
No announcement yet.

Why the following does not work?

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

  • #16
    regarding my atr sample code. Sorry I had the typo of premain instead of preMain; also bInit is initialiazed as false but null.

    But my code still doest not work on a Daily Chart! hmmmm...

    Comment


    • #17
      function preMain() {
      setPriceStudy(false);
      }

      var atrD = null;
      var bInit = false;

      function main() {

      if (bInit == false) {
      atrD = atr(14, inv("D"));
      bInit = true;
      }
      var atrD0 = atrD.getValue(0);
      debugPrintln(atrD0);
      return atrD0

      }

      this debugprintln statement returns null for atrD0.

      Comment


      • #18
        z11
        It is working fine at my end (tried it on two computers)
        Alex

        Comment


        • #19
          Ok Alex, I found the problem - the first few values of atrD0 are indeed null.. I should have added a check null statement! amature mistake..thanks for trying this out!

          ziggy

          Comment

          Working...
          X