Hi,
Iam getting crazy with this, any help is appreciated.
I have a running collection over currency pairs and their closing prices.
In the pasted output the prices are aggregated into 5 min values.
Please look below for my influx cli output:
select ccypair, close from “5m_bars” where (ccypair = ‘AUDCHF’ or ccypair = ‘AUDCAD’) and time > now()-30m
name: 5m_bars
time ccypair close
2018-10-08T18:20:00Z AUDCAD 0.91683
2018-10-08T18:20:00Z AUDCHF 0.70231
2018-10-08T18:25:00Z AUDCAD 0.9171
2018-10-08T18:25:00Z AUDCHF 0.70238
2018-10-08T18:30:00Z AUDCAD 0.9171
2018-10-08T18:30:00Z AUDCHF 0.70246
2018-10-08T18:35:00Z AUDCAD 0.91697
2018-10-08T18:35:00Z AUDCHF 0.7026
2018-10-08T18:40:00Z AUDCAD 0.91703
2018-10-08T18:40:00Z AUDCHF 0.70259
2018-10-08T18:45:00Z AUDCAD 0.91697
2018-10-08T18:45:00Z AUDCHF 0.70265
— Just to show some sample data from the measurement
select first(close) as close into “5m_bars_tmp” from “5m_bars” where time > now()-15m group by time(5m,-1m),ccypair fill(previous)
name: result
time written
1970-01-01T00:00:00Z 452
— Create a new measurement looking back 15 minutes and offset -1m
select ccypair, close from “5m_bars_tmp” where ccypair = ‘AUDCAD’
name: 5m_bars_tmp
time ccypair close
2018-10-08T18:34:00Z AUDCAD 0.91697
2018-10-08T18:39:00Z AUDCAD 0.91703
2018-10-08T18:44:00Z AUDCAD 0.91697
select ccypair, close from “5m_bars_tmp” where ccypair = ‘AUDCHF’
name: 5m_bars_tmp
time ccypair close
2018-10-08T18:29:00Z AUDCHF 0.91697
2018-10-08T18:34:00Z AUDCHF 0.7026
2018-10-08T18:39:00Z AUDCHF 0.70259
2018-10-08T18:44:00Z AUDCHF 0.70265
This is where it goes weird. AUDCAD is alphabetically the first ccypair in the measurement and AUDCHF is the 2nd.
Why is there no value with time 18:29 on AUDCAD ? and why is there a value from AUDCAD on AUDCHF at 18:29 ? As there is clearly a value for AUDCHF on 18:30 in the original measurement.
What am I doing wrong ?
Thanks!
//p