Actions23
- General Actions
- Bots Actions
- Deals Actions
- User Actions
Overview
The "Stop Bot" operation in this Gainium API node allows users to stop a trading bot of a specified type (Grid, DCA, or Combo) on the Gainium platform. This operation is useful for users who want to halt automated trading activities managed by their bots, either in real or paper trading contexts.
Typical scenarios include:
- Temporarily stopping a bot to prevent further trades during market volatility.
- Stopping a bot after reaching a profit target or loss limit.
- Managing multiple bots programmatically via workflows to optimize trading strategies.
For example, a user running a Grid bot might want to stop it and cancel any partially filled orders, while a user with a DCA bot might want to specify how open positions should be closed when stopping the bot.
Properties
| Name | Meaning |
|---|---|
| Bot Type | The type of bot to stop. Options: Grid, DCA, Combo. |
| Bot Id | The unique identifier of the bot to stop. |
| Additional Options | Optional settings to customize how the bot is stopped: - Cancel Partially Filled (boolean): For Grid bots, whether to cancel partially filled orders. - Close Type (options): For DCA and Combo bots, how to close positions ( cancel, closeByLimit, closeByMarket, leave).- Close Grid Type (options): For Grid bots, how to close grid orders ( cancel, closeByLimit, closeByMarket). |
| Paper Trading | Boolean indicating whether to use paper trading mode (true) or real trading mode (false). |
Output
The output JSON contains the response data from the Gainium API after attempting to stop the bot. It typically includes confirmation of the stop action or details about the bot's updated status.
Example structure:
{
"data": {
// API-specific response fields confirming the bot stop action
}
}
No binary data output is produced by this operation.
Dependencies
- Requires an API key credential for authenticating with the Gainium API.
- The node uses HMAC SHA-256 signatures for request authentication.
- Network access to the Gainium API base URL configured in credentials.
- Proper permissions are required on the API key, specifically write access to manage bots.
Troubleshooting
Common issues:
- Invalid or missing Bot Id or Bot Type parameters will cause errors.
- Insufficient API key permissions (missing write access) will result in authorization errors.
- Incorrect usage of additional options (e.g., using Grid-only options on a DCA bot) may cause unexpected behavior or API errors.
- Network connectivity problems or incorrect base URL configuration can lead to request failures.
Error messages:
"Error: <reason>"— Generic API error returned from Gainium; check the reason message for details."HMAC generation failed: Web Crypto API not available"— Indicates environment does not support required cryptographic functions; ensure the runtime supports Web Crypto API."Operation stop_bot is not supported"— Internal error if operation name is misconfigured; verify correct operation selection.
Resolutions:
- Verify all required parameters are correctly set.
- Ensure the API key has appropriate permissions.
- Confirm network connectivity and API endpoint correctness.
- Use the official Gainium API documentation to validate parameter values and request formats.
Links and References
- Gainium API Official Documentation (referenced in property notices)
- Gainium API general usage and authentication guidelines (available on Gainium developer portal)