Announcement

Collapse
No announcement yet.

Series Object

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

  • Series Object

    if a chart contains -300 to 0 bars on a 5 minute chart, will the following series (in the same chart's EFS) also contain the same number of bars?

    var Xseries1 = sma(10,inv("D"))
    var xSeries2 = close(inv("D"))

    or in other words what determines series length ?
    Paul Williams
    Strategy & Applications
    www.futurenets.co.uk

  • #2
    unconfirmed but it looks like ...

    if a 5min chart using an efs has 300 bars than a series like

    var xSeries2 = close(inv("D"))

    used in the same efs will return 300 bars

    but there may be exceptions?
    Paul Williams
    Strategy & Applications
    www.futurenets.co.uk

    Comment


    • #3
      Series Object

      I'm trying to find a way to analyse the series (OHLV values) of another interval from the current chart. Initially I thought the following code would work ...

      Code:
      var bInit = false;
      var x60min = null;
      
      function oOHLC(Int)
      {
          this.xOpen = open(inv(Int));
          this.xHigh = high(inv(Int));
          this.xLow = low(inv(Int));
          this.xClose = close(inv(Int));
      }
      
      function DoSomethingWith60min(os)
      {
          var vO = x60min.xOpen.getValue(os);
          var vH = x60min.xHigh.getValue(os);
          var vL = x60min.xLow.getValue(os);
          var vC = x60min.xClose.getValue(os);
         
          //...
      
      }
      
      function main()
      {
      
          if (!bInit)
          {
      
              x60min = new oOHLC(60);
              bInit = true;
          }
      
          var nIndex = getCurrentBarIndex();
      
          if (getBarState() == BARSTATE_NEWBAR) 
          {
              DoSomethingWith60min(nIndex);
          }
      
      }
      but this code retrieves 60min data at the time of the current charts bar time e.g. var vC = x60min.xClose.getValue(-1) does not give the close of the previous 60min bar but the value of 60min bar close at the time of the charts previous bar (I think).

      I'm hoping someone can suggest a way round this or perhaps clarify?
      Paul Williams
      Strategy & Applications
      www.futurenets.co.uk

      Comment

      Working...
      X