Working in a simulation environment

Work in Progress - Target version V0.38.0

The implementation of alerts and rule-based trading is not yet complete. This documentation describes the planned and partially implemented functionality.

A simulation environment is a separated copy of your portfolios and accounts as of a day in the past. It is a tenant of its own: whatever you book, change or delete inside it stays inside it and never touches your real portfolio. How an environment comes about is described under Rule based trading.

Use Switch to simulation to open an environment and Switch to main tenant to return. Both commands reload the application, so that the navigation tree, the menus and the reports really belong to the selected environment instead of still showing figures of the tenant you came from.

What is possible in an environment

The overview below shows what you can work with in an opened environment and what stays outside it. What decides is always where the data belongs: everything tenant-specific belongs to the environment, while the strategy and your user account belong to you.

AreaIn the environment
Portfolios, accounts, watchlists, correlation matrices, imports, tax correctionsFully editable; they belong to the environment alone.
TransactionsYou can record, change and delete your own transactions. Please read the section on the effect of a replay first.
The strategy with its asset classes, securities and rulesRead only. Change the strategy in your own portfolio and replay the simulation afterwards.
AlertsNot available. Alerts watch current prices and therefore belong to your own portfolio only.
Instruments, currency pairs, asset classes, stock exchanges, import templatesEditable as usual. This data is shared and belongs to no single environment.
Cash standing ordersCan be recorded; they are executed by the historical replay alone.
Export personal data and Deleting my data and user accountNot available. Both concern your user account and act on your own portfolio only, which is why the menu entries are not shown in an environment.
Share read access and client managementNot available. A share applies to your own portfolio, not to a copy of it.

Should you nevertheless attempt one of these blocked functions, Grafioschtrader refuses it with a message instead of quietly changing something in the wrong place.

The strategy is shared, but protected

The strategy is used jointly by your portfolio and by all of its simulation environments. So that a recorded replay stays verifiable, it cannot be changed from within an environment. Switch to the main tenant, adjust the strategy there and start the replay again afterwards.

Effect of the historical replay

A replay always begins at the opening holdings of the environment. Before the first trading day is evaluated, Grafioschtrader returns the environment to exactly that state. Everything that is not part of the opening holdings is deleted in the process:

  • All transactions that do not stem from the opening. This affects the executions of the previous replay as much as transactions you recorded in the environment yourself.
  • The previous result with its course and the trading recommendations.

The holdings are then rebuilt from the opening. Your settings, in contrast, are not reset: portfolios, accounts, watchlists and the details of the environment itself remain unchanged.

Your own bookings are lost with the next replay

Transactions you record by hand in an environment are deliberately transient: the next replay removes them together with the executions of the last run. If you want to keep a booking permanently, it belongs in your own portfolio, or in an environment that you do not replay again.

Do not change the opening holdings

The transactions of the opening holdings are the basis every replay resets to. Do not change or delete these bookings, and do not remove the accounts they sit on either. Otherwise the environment describes a starting point that never existed, and the results are no longer comparable. The opening date and the opening mode cannot be changed afterwards in any case; create a new environment for that.

While a replay is running

A running replay books transactions continuously and rebuilds the holdings of the environment. While it works, the environment is therefore locked: it can neither be opened nor deleted. Switch to simulation and Delete simulation are then not offered, and a session that already has it open returns to the main tenant.

You follow the status and the course from the main tenant instead, and Cancel replay likewise. A cancellation ends the run after the day it is currently calculating; the executions booked until then remain. The environment becomes available again only once the run has actually ended, not already at the moment of the cancellation.

stateDiagram-v2
    [*] --> Idle
    Idle --> Running: Start replay
    Running --> Cancelling: Cancel replay
    Cancelling --> Idle: Run ended
    Running --> Idle: Run ended
    Idle --> [*]: Delete simulation
    note right of Idle
        Opening, editing and
        deleting possible
    end note
    note right of Running
        Locked: neither opening
        nor deleting
    end note

Only one replay runs per environment at a time, and the server executes only a few at once overall. When that capacity is exhausted, Grafioschtrader says so and you try again later.

Quantity limits

Every environment has a budget of its own: portfolios, accounts, watchlists and transactions count against the usual upper limits, but separately from your own portfolio and separately from the other environments. An environment can therefore not take away the room in your main tenant.

Shared data behaves differently. An instrument you create in an environment counts against the same budget as one you create in your own portfolio, because it belongs to no environment. The number of simulation environments per portfolio is limited as well; by default there are five. How these limits are managed is described under Quantity limitation.

The course of a replay has an upper limit too. Once it is reached, Grafioschtrader records no further entries, but the run itself finishes its calculation. The course is then incomplete while the result stays valid.

Deleting an environment

Delete simulation removes the environment with everything that belongs to it alone: portfolios, accounts, transactions, watchlists as well as the result of the last replay with its course. Your own portfolio and the shared strategy remain untouched.

Private instruments you created inside that environment are deleted along with it. A private instrument belongs to the tenant it came about in and would be meaningless without it. If you create an instrument you want to keep beyond the simulation, record it in your own portfolio.

Environments are not part of the personal export

Export personal data delivers the data of your own portfolio. The contents of a simulation environment are not included in it and cannot be restored from the export either. This is intentional: an environment is a copy that can be created anew at any time, not a data set in its own right.