Skip to content
All library documents

Changing Strategy Parameters While a Trading Bot Runs

Article Strategy library · Author: momox

Summary

This tutorial explains how to update selected strategy parameters through a platform’s strategy interaction feature while a bot continues running. It motivates the approach as a way to avoid stopping and restarting the bot during parameter adjustments, which can interrupt its operating state or require restoring progress. The example maintains a numeric parameter and a text parameter, polls for incoming commands on a timed loop, checks each command’s prefix, and assigns the supplied value to the corresponding variable.

The document demonstrates the mechanism rather than a trading method, and offers no backtest or performance evidence. Its example receives command values as strings, so a numeric setting may need explicit conversion and validation before use in calculations. It also does not explain how to handle malformed, conflicting, or risky updates, or whether changes persist after a restart. The technique is therefore a basic operational pattern; safe use depends on checking inputs and understanding the platform’s command behavior.

Key ideas

  • A running bot can poll for parameter updates without restarting its main loop.
  • Commands identify the target variable through a name prefix followed by a value.
  • The example handles both numeric-looking and text values as incoming strings.
  • Numeric inputs may require conversion and validation before the strategy uses them.
  • The tutorial explains parameter control, not signal quality or trading performance.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.