You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
467 B

2 years ago
symbol = take(`AAPL, 6) join take(`FB, 5)
time = 2019.02.27T09:45:01.000000000 + [146, 278, 412, 445, 496, 789, 212, 556, 598, 712, 989]
price=173.27 173.26 173.24 173.25 173.26 173.27 161.51 161.50 161.49 161.50 161.51
quotes=table(symbol, time, price)
print(quotes)
weights = dict(`AAPL`FB, 0.6 0.4)
print(weights)
ETF = select symbol, time, price*weights[symbol] as price from quotes;
print(ETF)
select rowSum(ffill(last(price))) from ETF pivot by time, symbol;