Custom Indicators

A custom indicator is an indicator. As a matter of fact, 60 of the 80 indicators in Mastock are custom indicators. The best way to familiarize yourself with custom is to open the custom screen (Z shortcut) and see how well known indicators have been scripted.
There are around 100 script keywords. They have been chosen to be as close as possible as natural language like Open, High, Low, Volume, Avg for average, ExpAvg for exponential average, etc….
The best way to start learning about custom is to examine how well known indicators are scripted.

For instance, below the Chaikin Oscillator script:

mfmv = ((Close - Low) - (High - Close))/(Low - High)*volume(50,1000)
accDist = xPeriodSum(mfmv,0)
Chaikin = expAvg(accDist,3) - expAvg(accDist,10)

Defining Custom Indicators is done using the custom indicators panel. It is accessed through “Tools, Manage Triggers” or by using the “Z” keyboard shortcut.

How To - Step by Step

Screen Shot 2013-11-28 at 9.21.53 PM

On the right side, the preview windows enable an instant check of either the program works or not. On the left side, the program instructions text and various control to define the type of indicator, color and thickness of the curves.

This panel enables you to define three kind of custom indicators:
  • Indicator: Classical indicator displayed in the indicator view
  • Overlay: Overlay in the graph view, like Bollinger bands
  • Trigger: Display, on the graph, symbols for Buy and Sell recommendations

At the bottom of the left side, you can enter any comments you want to explain the meaning or any other relevant information for the current indicator.

Indicators or Overlays can display up to 3 different curves. The three color wells on the left side define the colors for each of the curve. The text fields, nearby, define the thickness of each of the curves. Curve1 and Curve2 can either be bar chart or a simple curve.

To define a new indicator, press “New”, enter a name, pick the type, enter your text in the instruction area and, optionally, in the comments area.

The trigger effectiveness button starts a simulator showing what would have been the result, in cash, if you had strictly applied the system recommendations, over the last 12 months, on the current stock.

When pressing the curve names button, a popup appears enabling you to give a name to up to three curves defined in NotifyResult(x,y,z). This is optional and is only used to display a small tip when hovering over a curve as shown below.

Screen Shot 2013-09-29 at 5.24.25

You can use a special “parameter(x)” instruction in your script, where x is 1, 2, 3, 4 or 5. Doing so enables you to easily modify parameters without acceding to the custom indicators panel.

Screen Shot 2014-03-29 at 7.18.22 PM

When at least one parameter has been defined, a small Gear button appears at the bottom left corner of the window.

Screen Shot 2014-03-29 at 7.18.22 PM

If you inadvertedly make a change you end up regretting, you can use the File menu to, either revert everything to initial defaults (everything does mean everything, you’ll lose anything you have modified), or select one or several indicators to reset to defaults. In the second case, only the indicators you selected are renewed.

Note you can backup your current custom indicators configuration by exporting it into a file, and later, should that prove necessary, re-import it from that same file.