Scanning

Scripting

Chartboard supports Advisor and Scanning automation using embedded custom python scripts. 

  • Scans are created and maintained in the Workspace Explorer tree as per and alongside OHLCvs and Point and Figure charts.  Such scan definitions may be copy-pasted and exported and imported between Chartboard sites as simple files (*.Msgra#Scan).  These Workspace scan definitions are independent of the assigned python script.
  • Scripts are based on the Python 3.8 release that ships with the Chartboard product.
  • Duplex interaction is facilitated through an extensive set Python extension functions.
  • Chartboard Extension Classes (CBEC) available for developing proprietary scripts.
  • Scanning scripts exist as disk files with ".pys" extension and may be exchanged as required.  Expert Advisor scripts use the ".pya" extension.  Regular python scripts common to both Advisor and Scanning modes usually retain the standard Windows ".pyw" extension.
  • A console window may be activated from within Chartboard for monitoring and debugging scripts.
  • Python scripts have duplex access back into Chartboard for data and visuals.  Alternatively python may be used for forward access into 3rd Party products such as SQL databases, AI and machine learning.
  • Scripts generate a synthetic chart for each stock through which standard visuals may be queried.  Such charts may be individually viewed at the completion of a scan for selected stocks.
  • Scanning scripts are attached to scans as required.  Chartboard supports multiple scan definitions all of which are serialized.
  • Multiple scans may be concurrent but only a single instance of any given scan.
  • Download ChartboardQRCard.pdf Python Expert Advisor quick reference card.

Operation

Scanning objects or placeholders are managed through the Workspace Explorer tree using the following sequences.

  • From a Workspace folder context menu select [New Stock Scanner...] item, which in turn activates the following configuration dialog.

    Python Scan Dialog

  • Activate scan via double mouse click or [View Scan] context menu item.
  • Utilize displayed Ribbon Bar items to mange scan activities.

Debugging

Scanning scripts testing can be enhanced by activation of the application console and diverting Python's stderr and stdout to such.

The application console can be toggled on and off via the Ribbon Bar >> [Home] tab >> [View] group >> Console check box.  Should Python Scanning and Advisor scripts be activated for multiple charts, debugging messages may be interweaved.  Python scripts may be edited internally within Chartboard or externally through a 3rd party application.

Moving the {Python Debug} >> Inspection cursor over a chart stack exposes the underlying data in python scripting format.  Can be used both as a guide to accessing chart stack data from python or debugging scanning scripts.

Property Grids expose hints for those parameters accessible from automation scripts.  Reference the "Property Description" region for the selected item at the base of the grid.

Chartboard Extension Classes (CBEC)

Scanning scripts are usually based on CBEC that wrap up the raw Chartboard python scripting API.  Such extension classes are shipped with the Chartboard product in the PythonCBEC.pyw file.  Alternatively the scripting API can be used to create an equivalent product or extend the existing.  Python Scanning and Advisor scripts share the same Chartboard Extension Classes (CBEC) with the structural difference Scanning scripts access Chartboard through CScanner generated descendant classes and Advisor scripts access Chartboard as CStack generated descendants.

Both Scanning and Advisor scripts are managed through the Python Scripts Map attachment explorer.  Scanner scripts may only be run from scanning environments and Advisor scripts from a chart stack environment.

Samples

The following sample Python Scanner scripts are shipped with Chartboard product.

  • SampleScanner[MACD].pys
    Scanning script for selecting those stocks with MACD buy signal less than nominated number of periods and a calculated MACD value < 0.0.

    The scanner script generates a list control that summarizes the results as shown here.  Charts for any tabulated stock can be automatically generated by double clicking any results row or selecting {View Scan Chart} item from the context menu for the row.

  • SampleScanner[Reversals].pys
    Scanning script for selecting those stocks whose last fitted Reversal is bullish.

    The scanner script generates a list control that summarizes the results as shown here.  Charts for any tabulated stock can be automatically generated by double clicking any results row or selecting {View Scan Chart} item from the context menu for the row.

  • SampleScanner[Harmonics].pys
    Scanning script for selecting those stocks whose last fitted Harmonic is bullish.

    The scanner script generates a list control that summarizes the results as shown here.  Charts for any tabulated stock can be automatically generated by double clicking any results row or selecting {View Scan Chart} item from the context menu for the row.
Facebook