Announcement

Collapse
No announcement yet.

load/retrieve close(0,-10) values

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

  • load/retrieve close(0,-10) values

    Please show me a code fragment that loads an array with n values of close(0,nn) data, then another frag that retrieves the data for calculation.

    The help file only shows "open(0,-10)" loads an array with the 10 previouse open() values. - Not enough to go on -

    Cheers,

    Ed Hoopes
    [email protected]

  • #2
    Ed
    The enclosed will plot the close of two bars back taken from the array close(0,-10)
    Alex

    PHP Code:
    function preMain(){
        
    setPriceStudy(true);
        
    setStudyTitle("test");
        
    setCursorLabelName("close -3");
    }
    function 
    main(){

        var 
    close(0,-10);
        var 
    x[2];
        
        return 
    y;

    Comment


    • #3
      Alex, you're quicker than lightning!

      Ed, here's another helpful example.

      PHP Code:
      function preMain() {
          
      setPriceStudy(true);
          
      setStudyTitle("Example");
          
      setCursorLabelName("Close  0"0);
          
      setCursorLabelName("Close -1"1);
          
      setCursorLabelName("Close -2"2);
          
      setCursorLabelName("Close -3"3);
          
      setCursorLabelName("Close -4"4);
          
      setCursorLabelName("Close -5"5);
          
      setCursorLabelName("Close -6"6);
          
      setCursorLabelName("Close -7"7);
          
      setCursorLabelName("Close -8"8);
          
      setCursorLabelName("Close -9"9);
          
      }

      function 
      main() {
          
      // close( [nRelativeOffset], [nNumBars], [sSymbol] )
          //  [] = optional parameter
          
          
      var aClose close(0, -10);
          if (
      aClose == null) return; // less than 10 values available
          
          // refer to each value of the array by element numbers 0 - 9
          
          // aClose[0] is bar  0 close
          // aClose[1] is bar -1 close
          // aClose[2] is bar -2 close
          // aClose[3] is bar -3 close
          // aClose[4] is bar -4 close
          // aClose[5] is bar -5 close
          // aClose[6] is bar -6 close
          // aClose[7] is bar -7 close
          // aClose[8] is bar -8 close
          // aClose[9] is bar -9 close

          
      return aClose;

      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


      • #4
        Thanks Guys

        I was caught up in new Array( . . .

        Thanks for the examples - - - now if I can just get the REST of this new indicator to work.

        Fast Response + no whipsaws - is that asking too much??

        I know - but i'm still trying

        Reef Break

        Comment

        Working...
        X