Group Abstract Group Abstract

Message Boards Message Boards

0
|
4.1K Views
|
8 Replies
|
8 Total Likes
View groups...
Share
Share this post:

List of 50-day simple moving average for stock

Posted 3 years ago

I'm trying to obtain a list showing date and value (daily) of 50-day simple moving average for IBM stock, specified date range January 1 2022 to September 1 2022. I'd like to see a list of values vs. a chart. Would appreciate it if someone could show me how to enter on Wolfram, I'm not having any luck with Wolfram accepting the syntax I've entered.

POSTED BY: Rachel Brown
8 Replies
Posted 3 years ago

Hi Rohit,

Thank you once again. I'm such a beginner that I have to work through the examples many times to understand. I was thinking that Moving Average is a financial indicator, but now I see it's in the drop down list, which means it's built-in WL. Whereas RateOfChange is not in the drop down list. I'm going to practice more tonight. Very grateful for your help on this..

POSTED BY: Rachel Brown
Posted 3 years ago

*****Correction to the above code in the first example (RateOfChange, not RateOfReturn)

data = FinancialData["IBM", {{2022, 1, 1}, {2022, 9, 1}}, "Close"]
RateOfChange50 = RateOfChange[data, 50]
DateListPlot[RateOfChange50]
POSTED BY: Rachel Brown
Posted 3 years ago
POSTED BY: Rohit Namjoshi
Posted 3 years ago
POSTED BY: Rachel Brown
Posted 3 years ago
POSTED BY: Rachel Brown
Posted 3 years ago
POSTED BY: Rachel Brown
Posted 3 years ago

Hi Rachel,

the // Normal instruction in any of my searches on how to create a list from a chart

Normal is not creating a list from a chart. FinancialData returns a TimeSeries which is shown in the frontend in graphical form. Normal, when applied to a TimeSeries, returns the list of date/value pairs. In general Normal can be used to look at the underlying data for objects that are represented in graphical/icon form by the frontend. E.g. sa = SparseArray[{{1, 1} -> 1, {2, 2} -> 2, {3, 3} -> 3, {1, 3} -> 4}] Normal@sa

sales = Import["ExampleData/RetailSales.tsv", "Dataset"]
Normal@sales

You can also use TradingChart with a "SimpleMovingAverage" FinancialIndicator. E.g.

TradingChart[{"IBM", {{2022, 1, 1}, {2022, 9, 1}}}, 
 {"BollingerBands",FinancialIndicator["SimpleMovingAverage", 50]}]

The chart is dynamic, hover over it.

If you are new to the Wolfram Language, take a look at the free online interactive book by Stephen Wolfram.

POSTED BY: Rohit Namjoshi
Posted 3 years ago
POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard