Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Sencha Charts Essentials

You're reading from   Sencha Charts Essentials Create stunning charts and visualizations for both web and mobile applications

Arrow left icon
Product type Paperback
Published in May 2015
Publisher
ISBN-13 9781785289767
Length 214 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Ajit Kumar Ajit Kumar
Author Profile Icon Ajit Kumar
Ajit Kumar
Arrow right icon
View More author details
Toc

Creating a new financial chart

In this section, you will see how to create a custom stock chart—MACD—that is a momentum oscillator offering trend following and momentum. It fluctuates above and below the zero level.

Note

You can read more about this at http://en.wikipedia.org/wiki/MACD.

What is this chart all about?

Let's derive the technical requirements for the MACD chart, which we will use as a foundation to implement our custom chart.

For the MACD chart, based on the stock data that contains open, high, low, and close values for different time instances, the following values need to be calculated:

  • 12-day Exponential Moving Average (EMA)
  • 26-day EMA

Once the preceding values are calculated, the MACD-related values will be calculated for a record, by applying the following formulae:

  • MACD line = 12-day EMA - 26-day EMA
  • Signal line = 9-day EMA of MACD line
  • MACD histogram = MACD - Signal line

After the MACD line, signal line, and histogram values have been calculated, we need to draw...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image