Skip to main content
Parameters let you customize your signals without changing the code. You can set the parameter values for your signal when configuring it for your bot. This allows you to fine-tune your signal to your liking without having to write/change any code.

SDK Parameter Types

You can register the parameters in the registerParams() function of your signal.
$myString = $this->registerStringParam("myString", "Hi", "My String", "This is my description", "My Category");

$myBool = $this->registerBoolParam("myBool", true, "My Bool");

$myBoolSwitch = $this->registerBoolParam("myBoolSwitch", false, "My Bool Switch");
$myBoolSwitch->inputType = ParamInputType::Switch;

$myInt = $this->registerIntParam("myInt", 1, 0, 10, "My Int");

$myIntSlider = $this->registerIntParam("myIntSlider", 5, 1, 20, "My Int Slider");
$myIntSlider->inputType = ParamInputType::Slider;

$myFloat = $this->registerFloatParam("myFloat", 1.123, null, null, "My Float");
$myFloat->step = 0.001;

$myFloatSlider = $this->registerFloatParam("myFloatSlider", 1.5, 1, 2, "My Float Slider");
$myFloatSlider->inputType = ParamInputType::Slider;
$myFloatSlider->step = 0.1;

$myEnum = $this->registerEnumParam("myEnum", MyEnum::class, MyEnum::LowRisk, "My Enum", null, "My Category");

Using Parameters

You can access the parameter values in your signal using the getParam() function.
$myIntValue = $this->getParam("myInt");

Setting parameter values

Parameter values can be set in the bot configuration. The values set in the bot configuration will override the default values set in the registerParams() function.
The parameter values set in the bot configuration are specific to each bot. This means you can have multiple bots of the same type running with different parameter values.

SDK Functions

registerStringParam(string $key, string $default, string $label, ?string $description = null, ?string $category = null):StringParamDefinition
registerBoolParam(string $key, bool $default, string $label, ?string $description = null, ?string $category = null):BoolParamDefinition
registerIntParam(string $key, int $default, ?int $min, ?int $max, string $label, ?string $description = null, ?string $category = null):IntParamDefinition
registerFloatParam(string $key, float $default, ?float $min, ?float $max, string $label, ?string $description = null, ?string $category = null):FloatParamDefinition
registerEnumParam(string $key, string $class, $default, string $label, ?string $description = null, ?string $category = null):EnumParamDefinition