Handling Stock Data which only in market Hours(9:15 - 15:30)

Hello, For storing trade data or stock market data, all trades are happend at market hours only (for india, 9:15 to 15:30) every day. How to handle this in Influxdb?

Recently, I face a problem of using aggregateWindow with {createEmpty: true} to aggragte a data for 5m,15m etc…

The function aggregate the values properly, But create emptyRecords for time period of whole day for each day(Including holidays, but market holiday doesnt have data). But I need to create empty records for time period for only within market hours.

Summarizing, I need to create empty records when following condition met
IF No records available for window(Default)
Additionally, IF time is between 9:15 and 15:30(market).

Is there way to minutelySelction like hourlySelection to filter specific time range of day for each day(9:15 to 15:30)?

Is there any way to createEmpty records for market hours only?
Is there any way to limit such functions(aggregateWindow, etc…) to apply only for specific time range each day?

Hello @ramprasath,
Try taking advantage of if exists
https://docs.influxdata.com/influxdb/cloud/query-data/flux/exists/#map-values-based-on-existence

You can use the today() function plus time like so:

import "experimental"
start = experimental.addDuration(
  d: 555m,
  to: today(),
)

stop = experimental.addDuration(
  d: 930m,
  to: today(),
)

from(bucket: "mydata")
  |> range(start: start, stop: stop)

Does that answer all of your questions?