Hi fellow Quantopians,
quick question regarding new Q2 platform.
Have an algo where I'm evaluating some stock parameters 5 minutes before the close and then making decision.
Problem that I'm facing is that, based on available documentation:
1) using history function like:
data.history(context.security,fields='volume',bar_count=1,frequency='1d')
would give me volume for previous day, not info for that particular day (up until 5 mins before the close).
I was thinking that one solution would be to sum up all minute values from open until that moment and then use .mean().
Anyone knows how to it by some more elegant way?
2) if I want to evaluate average volume for last 3 days, INCLUDING volume for that particular day ((day-2)+(day-1)_(day-0 (but up to 5 mins BC)), what would be someone's simple solution?
thanks in advance