Loading...
Searching...
No Matches
Extending ATAS

Overview

The ATAS developer API lets you add your own code to the platform in several places. Every kind of extension is an ordinary .NET class library that references the platform assemblies (ATAS.Indicators.dll and, depending on the kind, ATAS.Strategies.dll, OFT.Rendering.dll, ATAS.DataFeedsCore.dll) with <Private>false</Private>. The same DLL runs in the classic ATAS and in ATAS X, as long as it does not use WPF types (see «Developing indicators for ATAS X»).

Extension What it is Base type / marker Article
Chart indicator Calculates and draws on a chart from bars, trades and the order book Indicator Development of a user indicator and the following articles
Strategy An indicator that also trades ChartStrategy Strategies
Heatmap indicator Draws on top of the Heatmap module from trades, profiles and MBO data HeatmapIndicator<TSettings>, [HeatmapIndicator] Heatmap indicators
SmartDOM column A column of the SmartDOM that draws its cells SmartDomColumn, [SmartDomColumn] SmartDOM columns
Watchlist column A column of the Watchlist: one value per instrument WatchlistColumn, [WatchlistColumn] Watchlist columns
Custom module A panel (ATAS) / widget (ATAS X) whose whole area your code draws PlatformModule, [PlatformModule] Custom modules
Connector A data feed: instruments, trades, order book of an external source BaseConnector<…> + BaseConnectorSettings<…> Connectors

Heatmap indicators, columns and modules are identified by a stable id in the attribute (<vendor>.<name>, the vendor atas is reserved): the platform saves them in workspaces and templates under that id, so you can rename classes and namespaces freely, and a workspace keeps them — with their settings — while the DLL is missing.

One DLL, several extensions

A single assembly may contain any number of chart indicators, heatmap indicators, SmartDOM columns, Watchlist columns and custom modules: the platform scans every loaded assembly for all of these kinds, so related tools (for example an indicator, the matching SmartDOM column and a dashboard module) can share code and ship as one file.

Connectors are the exception: they are loaded from a different folder, once at start-up, and cannot be unloaded while the platform runs. Ship a connector as a separate DLL that contains nothing else.

Where each kind is installed

Kind Folder (classic ATAS / ATAS X) Reload
Chart indicators, heatmap indicators, SmartDOM and Watchlist columns, custom modules Extensions or Indicators in AppData%\ATAS / in AppData%\ATAS X without a restart, see «Reloading a library» below
Strategies AppData%\ATAS\Strategies (see «Strategies») see «Strategies»
Connectors AppData%\ATAS\CustomConnectors / AppData%\ATAS X\CustomConnectors at start-up only: replacing the DLL needs a restart

The Extensions and Indicators folders are equal: the platform creates both, reads both with one loader, and a DLL works the same in either of them. Indicators is the historical name; Extensions is there for libraries that are not (only) chart indicators. On macOS the folders are ~/Library/Application Support/ATAS/Extensions and ~/Library/Application Support/ATAS/Indicators (and ~/Library/Application Support/ATAS/CustomConnectors for connectors). Keep one copy of an assembly: when the same assembly is in both folders, the platform loads the copy with the higher assembly version and reports the other one as skipped.

Indicators, strategies and everything else in these folders can also be distributed through the marketplace (see below); the marketplace and the Add custom indicator button of the indicators window install a DLL into the Indicators folder.

Reloading a library

The platform watches both folders, so a new or replaced DLL is loaded while the platform runs:

  • ATAS X reloads the libraries by itself about a second after the files stop changing and shows a notification with the result.
  • Classic ATAS shows a reload button in the status bar of the main window when the files changed; the libraries are reloaded when the user presses it. Nothing is reloaded before that.
  • An AI agent connected through ATAS Connect reloads the libraries with the tool extensions_reload and reads the result with extensions_get_state, in both platforms.

Open charts take their indicators again from the new build, and open custom modules, columns and heatmap indicators are created again from it and keep their settings.

A reload is reported per file, in the message shown to the user, in the platform log and in extensions_get_state:

  • a file that cannot be loaded — a dependency is missing, the file is damaged — is named with the reason, and the other files are loaded all the same. No restart is needed: fix or replace the file and reload again;
  • a file that is in use by another process or is still being written by a build is named as well. ATAS X tries it again by itself for several seconds; in the classic ATAS the reload button stays, press it again when the build has finished;
  • files that are not extension libraries — native DLLs, copies of the platform assemblies that a build output copied as a whole brings along — are skipped;
  • if an indicator that is on an open chart comes from a library that cannot be loaded after you replaced it (in either folder, also when you moved the file from one folder to the other), the charts are not touched: they keep running the previous build until that file is loaded or removed, and the report says which files the charts wait for. The same happens when the library of such an indicator is gone and the folders hold a file the platform cannot read at all (a copy that was cut short, under any file name): that file may be the new build, so the charts wait until it is repaired or removed. While every indicator on the open charts has its library, a broken file never holds the charts back;
  • when the same assembly is in two files and another library needs it, that library gets the copy the report shows as loaded.

The same report is written to the log when the platform starts.

Tariffs

Some parts of the developer API can be restricted by the user's tariff: market-by-order data, options data, heatmap indicators, SmartDOM and Watchlist columns, custom modules and connectors from your own assemblies. The restrictions apply to third-party code only and are checked while the platform runs, so they can change after the user logs on with another account; a restricted extension stays listed (the user sees the tariff banner when trying to use it) and keeps its saved settings. What your code observes in each case is described in Developer API and tariffs — design your extensions to keep working, with less data, when a part of the API is unavailable.

Distributing and selling your extensions

You can give other ATAS users access to your DLL through the Personal Area: upload it, choose who gets access and for how long, and turn access off at any time — the steps are described in Indicators and strategies distribution. The platform installs such a DLL into the Indicators folder, so the heatmap indicators, columns and modules it contains are delivered together with its indicators. Access is checked per class through the [FeatureId] attribute (namespace OFT.Attributes) for chart indicators, strategies, heatmap indicators, SmartDOM and Watchlist columns and custom modules: a marked class is offered only to accounts that have the feature, and a saved instance of it in the layout of an account without the feature stays inert («Not available») and is not created. Heatmap indicators are an exception to the last point: when the platform loads a DLL, it runs the static constructor of every heatmap indicator class and creates one instance of it to read its descriptor, whatever the account — keep their constructors free of side effects. Selling through the ATAS marketplace follows the same path; contact ATAS for the current terms.

Connectors cannot be distributed this way: the Personal Area and the marketplace install DLLs into the Indicators folder, while connectors are loaded only from the CustomConnectors folder. A connector DLL is put into that folder by the user (see Connectors).

Related articles