Announcement

Collapse
No announcement yet.

IsInterval()

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

  • IsInterval()

    I'm trying to test if a chart is a Volume, Time, or Tick based chart. I've found the IsInterval() function. Is this the right function to use to determine the type of chart? The example shows differentiating between different intervals on a Time based chart.

    PHP Code:
    var sInterval getInterval();
    if (
    sInterval == "D" ) {
    debugPrint"This is a Daily chart.\n");
    } else if (
    sInterval == "1") {
    debugPrint("This is a one-minute chart\n");

    Standing on the shoulders of giants.

  • #2
    wildfiction
    Here is one way you could identify the various tick based intervals
    For daily, weekly, etc you can also just use isDaily(), isWeekly(), etc
    Hope this helps
    Alex

    PHP Code:
    if(isDaily()){
        
    //do this
    }else if(isRawTick()){
        var 
    myInterval getInterval()
        var 
    myIndex myInterval.length;
        if(
    myInterval.charAt(myIndex-1)=="T") {
            
    //do this
        
    }else if (myInterval.charAt(myIndex-1)=="V") {
            
    //do this
        
    }//etc 

    Comment


    • #3
      wildfiction
      Forgot to add that for any time based interval (ie 1, 5, 13, etc minutes) you can use isIntraday()
      Alex

      Comment


      • #4
        Thanks Alexis - that helps a lot.
        Standing on the shoulders of giants.

        Comment


        • #5
          wildfiction
          My pleasure
          Alex

          Comment

          Working...
          X