Announcement

Collapse
No announcement yet.

How to detect the time interval of a chart

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

  • How to detect the time interval of a chart

    Is it possible to detect the time frame of the chart within the efs code?

    I want to be able to do different things depending on the time frame.

    i.e.
    IF TimeInterval = "5 Min" THEN Do "A"
    IF TimeInterval = "Daily" THEN Do "B"

  • #2
    Re: How to detect the time interval of a chart

    Hi FXJons,

    Yes, but it depends on what you want.
    there is: isDWM(), is Daily(), isWeekly(), isMonthly(), IsIntraDay(), isTick(), or as Alex indicated in one of her posts in the forum you can do the following:

    if(isDaily()){
    //do this
    }else if(isRawTick()){
    var myInterval = getInterval()
    var myIndex = myInterval.length;
    if(myInterval.charAt(myIndex-1)=="T") {
    //do this for tick charts
    }else if (myInterval.charAt(myIndex-1)=="V") {
    //do this for volume charts
    }//etc
    }

    And getInterval() will give you time interval in minutes. You can also adapt Alex's code for seconds by using "S" in the above code. Hope this helps.
    Regards,
    Jane




    Originally posted by FXJons
    Is it possible to detect the time frame of the chart within the efs code?

    I want to be able to do different things depending on the time frame.

    i.e.
    IF TimeInterval = "5 Min" THEN Do "A"
    IF TimeInterval = "Daily" THEN Do "B"

    Comment

    Working...
    X