This is a demo tutorial. While there is no step-by-step commentary available (yet), the live demo below is fully functional. Feel free to open it for full source code.
This demo shows how we can create a custom indicator as well as add a button to add/toggle it in Stock Chart's toolbar.
See the Pen
Stock Chart with custom indicator add button by amCharts team (@amcharts)
on CodePen.0