Group Abstract Group Abstract

Message Boards Message Boards

0
|
8.6K Views
|
3 Replies
|
2 Total Likes
View groups...
Share
Share this post:

How to code prior close in financial data?

Posted 4 years ago

I would like to compute the range based on the high compared to the prior close. My data:

upstP = FinancialData["UPST", {2021}];
upstH = FinancialData["UPST", "High", {2021}];
upstL = FinancialData["UPST", "Low", {2021}];
upstC = FinancialData["UPST", "Close", {2021}];

I tried DatePlus[] without success

DatePlus[upstC, -1]
upstC[[1, 1]] // Normal // Short
DatePlus[upstC[[All, 1]], -1, "Day"]

I tried TimeSeriesShift[] without success

TimeSeriesThread[{1, -1} . # &, {upstC, TimeSeriesShift[upstC, -1]}] //
   Normal // Short

and some other variations that I can no longer remember. How would I subtract yesterday's close from today's high -- continuous???

POSTED BY: Raymond Low
3 Replies
Posted 4 years ago
POSTED BY: Raymond Low
POSTED BY: Henrik Schachner
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard