Announcement

Collapse
No announcement yet.

Get bar interval automatically

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

  • Get bar interval automatically

    In my EFS, I like to get the price for some
    symbols besides the one being displayed. And when I switch the chart
    to different intervals, e. g, daily to 5 min,
    I like the EFS be able to figure out the
    bar interval being used for these symbols
    automatically.

    I thought the following line would do it:
    myPrice = close(0, sym("IBM"), getInterval());

    However, I got an error message saying the
    second parameter for close() is not valid.

    Thanks.

  • #2
    redsignal
    In order to use the getInterval() method the variable needs to be a series and not a value as in the case of your example ie
    var myPrice = close(sym("symbol, interval"));
    Once you have the series you can then use the .getInterval() method to retrieve the interval ie
    myPrice.getInterval();
    For the description and syntax of the series object see this article in the EFS KnowledgeBase
    Alex

    Comment

    Working...
    X