Announcement

Collapse
No announcement yet.

1st bar index of a period ...

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

  • 1st bar index of a period ...

    since there is 'getFirstBarIndexOfDay()', i am trying to construct the followings,
    'getFirstBarIndexOfWeek()', 'getFirstBarIndexOfMonth()', 'getFirstBarIndexOfYear()'.

    anybody has some good idea or suggestion?

  • #2
    first thing I would ask you is "what time frame are you trying to retrieve this data from??".

    If you are trying to do this from a 1~30 minute chart, esignal provides only 120 of history (unless they changed something I don't know about).

    So... with this situation - in the second half of the year, you might not be able to GET the first bar of the year (as 120 days is not enough data to go back that far)..

    The solution is to create a DATASET (or price series) of DAILY data (or WEEKLY OR MONTHLY). Then look back for the first bar of the YEAR or MONTH.

    I posted an example of a LOOKUP function yesterday for a client wanting to get the 8:30 OPEN price. That same function could be used to accomplish what you want (using a unique data set).

    Hope this helps.
    Brad Matheny
    eSignal Solution Provider since 2000

    Comment

    Working...
    X