Using Rental-Code Metadata to Set Strategy Limits
Summary
This guide explains how a strategy developer can use metadata attached to a rental registration code to set different usage limits for different customers. The strategy reads the metadata at runtime and maps its value to a configured limit. The example uses a spot strategy and checks the account’s held and frozen base currency before running its trading logic; when holdings exceed the allowed amount, it skips that logic. The document notes that a futures strategy would need limits based on its own position data and order management.
The example maps several metadata levels to different maximum holdings and uses a default when no level is supplied. Developers can also change a code’s metadata after creation, with the example requiring the user to restart the bot to observe the changed limit. This is an implementation pattern for access and exposure controls, not a trading signal or performance study. The sample is explicitly illustrative; practical restrictions must fit the strategy’s instruments, positions, and close-position behavior. Metadata length is limited to 190 characters.
Key ideas
- Rental registration metadata can select strategy limits for different customer tiers.
- A strategy can read the metadata and map its value to a position cap.
- The example pauses trading logic when spot holdings exceed the configured cap.
- Futures limits require checks designed around the strategy’s position data and trade lifecycle.
- A developer can modify metadata after issuing a code, and the example applies the change after a bot restart.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.