Reader small image

You're reading from  Sencha Charts Essentials

Product typeBook
Published inMay 2015
Reading LevelBeginner
Publisher
ISBN-139781785289767
Edition1st Edition
Languages
Right arrow
Author (1)
Ajit Kumar
Ajit Kumar
author image
Ajit Kumar

Ajit Kumar has over 16 years of experience in technology areas ranging from embedded systems to large enterprise applications. He worked with various multinational corporations such as Honeywell, Hughes, Virtusa, and Convergys, before starting his own companyWalking Treewhich specializes in Sencha frameworks. Ajit has authored books on open source frameworks, including Sencha Touch Cookbook, Sencha Touch Cookbook Second Edition, Sencha MVC Architecture, and ADempiere 3.6 Cookbook, all by Packt Publishing, which he considers his way of thanking the awesome open source community!
Read more about Ajit Kumar

Right arrow

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 a chart between...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Sencha Charts Essentials
Published in: May 2015Publisher: ISBN-13: 9781785289767

Author (1)

author image
Ajit Kumar

Ajit Kumar has over 16 years of experience in technology areas ranging from embedded systems to large enterprise applications. He worked with various multinational corporations such as Honeywell, Hughes, Virtusa, and Convergys, before starting his own companyWalking Treewhich specializes in Sencha frameworks. Ajit has authored books on open source frameworks, including Sencha Touch Cookbook, Sencha Touch Cookbook Second Edition, Sencha MVC Architecture, and ADempiere 3.6 Cookbook, all by Packt Publishing, which he considers his way of thanking the awesome open source community!
Read more about Ajit Kumar