计算事件发生的频率
我有一串股票价格数据,我希望能够计算出价格上涨或下跌持续了多少天。例如,根据数据,我使用“if”函数来确定一天是上涨还是下跌:“U”表示上涨日,“D”表示下跌日。假设字符串看起来像这样:
UUUDDUDUDUDUUU
我想要一个公式来计算有 3 个上升天、2 个下降天、1 个上升天、1 个下降天等...然后我将能够构建一个配置文件只要价格朝一个方向移动持续一段时间......我想在直方图或图表中显示结果。
有谁知道我可以使用什么公式或函数来获得我想要的结果?
感谢任何帮助。谢谢
I have a string of stock price data data and I want to be able to count how many days the price moves up or down lasted. So for example, from the data I have a used "if" functions to determine if a day was up or down: "U" for and Up day and "D" for a Down day. Lets say the string then looks like this:
UUUDDUDUDUDUUU
I want a formula to count that there were 3 Up days, and 2 Down Days, 1 Up, 1 Down etc etc... and then I will be able to built a profile of how long the prices moves in one direction lasted....i want to then display the results in histograms or charts.
Does anyone know what formula or function I can use to get the results I want?
Appreciate any help. thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,我在 Google 电子表格上创建了一些内容来跟踪本月的标准普尔 500 指数。您可以输入您想要的任何其他股票价格。
您可能需要类似电子表格的东西。
查看各列的公式:UP/DOWN、UP Trend、Down Trend
查看电子表格
下载 Excel。
Ok, I created something on Google Spreadsheet that tracks the S&P 500 for this month. You can enter any other stock prices you want.
You probably want something like the spreadsheet.
Look at the formulas for the columns: UP/DOWN, UP Trend, Down Trend
View the spreadsheet HERE.
Download the Excel.