OptionsApp

Stocks & ETFs: exporting and importing strategies

5 min read

You can export strategies for stocks and ETFs as a file and import them again. This lets you back up a configuration, move it to another computer or pass it on. It applies to the configurations in the tab Seasonals & Signals and to the strategies in the tab RSL. Both tabs have the same button for it.

Important: An imported configuration arrives switched off and without an account. You review it and activate it yourself. Options have their own route: Import & export of configurations.

1. Overview

  • The export is a JSON file.
  • The button Import or export strategy configurations (icon with arrows) sits in the bar with the configuration selector, next to Delete configuration and Rename configuration.
  • Each tab exports and imports only its own kind: Seasonals & Signals the schedule configurations, RSL the Relative Strength strategies. You can open a file that holds both kinds in either tab, each tab takes only its part.
  • The app does not accept files with option strategies here. They are imported in the tab for options.

2. Exporting

Procedure:

  • In the tab Seasonals & Signals (or RSL), choose the configuration.
  • Click the import and export button. The window Strategy asks: "Select an action for strategy configurations."
  • Choose Export Selected: only the chosen configuration is saved, with the rules and conditions it uses. Or Export All: all configurations of this tab are saved, plus the whole condition library.
  • Choose the location. The suggested file name is stocks_etfs_<name of the configuration>.json, for Export All stocks_etfs_seasonals_signals.json or stocks_etfs_rsl_strategies.json.

What the file contains:

  • the configuration itself (name, limits, basis of the position size),
  • each row with schedule, position size and underlying,
  • the rule of each row with profit targets and stop adjustments,
  • the entry and exit conditions the rows use. For an RSL strategy, the condition for the regime filter.

What the file does not contain:

  • the account, the activation state and the execution counters,
  • open and closed trades,
  • for an RSL strategy, the running state of the strategy.

If a configuration, a rule or a condition has no identifier, the app assigns one before the export. The identifier is how the import later recognises that it is the same configuration.

3. Importing

Procedure:

  • In the right tab, choose the import and export button, then Import, and open the file.
  • In the table Import Strategy Configurations, select the configurations. Each line names the configuration, for schedules the number of rows and the first underlyings. The column Status shows "New" or "Update".
  • Confirm the import notice. For a file of your own it reads "Import from File", for a file from another user "Import External Content". You confirm three statements each time, among them that you review the contents including stops, profit targets and position sizes yourself and that this is not investment advice.
  • A progress window shows which conditions, rules and rows are being written.
  • At the end the message "Import Completed" lists the names of the imported configurations.

The imported configuration:

  • carries the addition "(Imported)" in its name, for a file from another user "(Imported from third-party)",
  • is switched off,
  • has no account yet. You choose the account before you activate it,
  • for files from other users, requires an additional confirmation before the first activation.

Keep in mind that a file may have been edited outside OptionsApp. A short position without a stop, for example, stays in the market without a loss limit if it is written that way in the file. Check stop, profit target and size of every row before activating.

4. Same name, same configuration: what happens on import

The import first looks for whether the configuration already exists:

  • By identifier: If the configuration in the file has the same identifier as one on this computer, that configuration is updated. The column Status shows "Update".
  • Otherwise by name: If no configuration has this identifier, the import looks for a configuration of the same kind with the same name, also with the addition "(Imported)" or "(Imported from third-party)". If it finds one, that one is updated as well.
  • Otherwise new: Without a match, a new configuration is created.

If the identifier belongs to a configuration of another strategy on this computer, the import creates a copy under a new identifier.

With an update:

  • The rows of the configuration are replaced by the rows from the file. Rows that only existed here are gone afterwards.
  • The rules of the rows are updated. A row rule of the replaced rows that no row uses afterwards is deleted.
  • The settings of an RSL strategy are overwritten, its running state is kept.
  • Before writing, the app asks: "The file contains configurations that already exist here. Their rows and rules, or the settings of an RSL strategy, will be replaced by the imported ones." With Update you continue.
  • The updated configuration is switched off afterwards, even if it was active before. You activate it again.

The import matches conditions only by identifier. A condition with the same name but a different identifier is not overwritten but created as an additional condition. Rules are also matched by identifier. If a row in the file refers to a rule or condition the import does not find by identifier, it uses the name.

The import skips a row whose rule is not in the file.

5. Open trades

  • If a configuration the import would update by identifier still has open trades (for RSL, open positions of the strategy), the import stops: "These configurations still have open trades and cannot be updated." Nothing is imported. You close the positions first.
  • The reason: a row with an open trade would stay in the market without its planned exit, and an RSL strategy would rotate its positions by other rules.
  • A configuration found by name is not checked separately in this query. Close the positions beforehand here too.
  • The import creates no trades. Positions and orders stay with the broker and are not affected by export and import.

6. When the import is refused

  • Wrong Tab: The file only holds configurations of the other kind, for example RSL strategies in the tab Seasonals & Signals. Import them in the other tab.
  • Import Blocked: open trades, see section 5.
  • Ownership: If a rule or condition in the file belongs to another strategy on this computer, the app refuses the import before anything is written.
  • Import Failed: The file is not a valid stock file or holds no configuration.

7. Notes

  • The file contains settings for trading stocks and ETFs. Pass it on only if you want to. Whoever imports it reviews the contents themselves.
  • A configuration is no substitute for a backup of the session. For that, see Create a backup and transfer sessions.
  • Examples in this article describe how to operate the app, they are not a recommendation for a strategy.

Related articles:

See also: Stocks & ETFs: orders and running trades, Stocks & ETFs: taking an existing position under management (Manage position).

Was this article helpful?