Expert Advisor

Scripting

Chartboard deploys with support for Python Advisor (*.pya) scripts using embedded python.

  • Scripts are based on the Python 3.8 release.
  • Duplex interaction is facilitated through an extensive set Python extension functions.
  • Chartboard Extension Classes (CBEC) available for developing proprietary scripts.
  • Advisor scripts exist as disk files with ".pya" extension that may be exchanged as required.  Scanning scripts use the ".pys" extension.  Regular python scripts common to both Advisor and Scanning modes usually retain the ".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 may query chart visuals and adjust processing and behavior accordingly.
  • Drawing and Markup visuals may controlled from scripts.
  • Model trades may be activated from scripts
  • Advisor scripts are attached to charts as required.  Assigned scripts may verify suitability of the chart when activated.
  • Scripts may be dragged and dropped on Charts either directly from "Windows File Explorer" or the internal "Mapped Python Scripts Explorer".  Chartboard support a LOCAL script that is assigned individually to each Chart and a GLOBAL script that is common to all Charts.  Once assigned such scripts can be activated from the Ribbon Bar >> [Python Tab] on an individual Chart basis.
  • Download ChartboardQRCard.pdf Python Advisor quick reference card.

Debugging

Advisor script 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)

Advisor scripts are usually based on CBEC that wrap up the raw Chartboard python scripting API.  Such foundation 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.    Advisor and Scanning scripts share the same Chartboard Extension Class (CBEC) libraries with the structural difference Advisor scripts access Chartboard as CStack generated descendant classes and Scanner scripts access Chartboard as CScanner generated descendants.

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

Samples

The following sample Python Advisor scripts are supported by the Chartboard product.

  • Sample[MACD]-[RSI]-[ADX].pya download or [View in Browser]
    Advisor script for generating buy shading signals utilizing MACD, RSI and ADX charts and data series.
  • Trade[RSI]-[Reversal-ENGULFING].pya download or [View in Browser]
    Advisor script illustrating how to use engulfing reversal candlesticks and RSI data series to generate buy and sell shading signals.
  • Sample[Aroon].pya download or [View in Browser]
    Advisor script hi-lighting overbought and sold zones using the Aroon indicator.
  • Crossover[Aroon]Strategy.pya
    Advisor script using Aroon indicator crossovers (robo buy-sell signals) to model trades on the OHLC chart stacks over which it is run.  Trades are modeled for the active (Monthly, Weekly or Daily) period. Trades are annotated on OHLC chart and results presented in grid properties window.  Click here for sample workspace screen shot.
  • Swapover[SAR]Strategy.pya
    Python Advisor script using Parabolic SAR indicator swapovers ( ) to model trades on the OHLC chart stacks over which it is run. Trades are modeled for the active (Weekly or Daily) period. Trades are annotated on the OHLC chart and results presented in grid properties window. Click here for sample workspace screen shot.
Facebook