DocsErrors
Parameter Errors
Parameter errors occur when ctx.param() is called with invalid options.
Error: invalid_param_type
Error: Invalid parameter type "number" for param "period". Expected: int, float, string, boolean
Cause: The type field must be one of the four QSL types.
Fix: Use the correct type name:
// Wrong ctx.param('period', { type: 'number', default: 14 }); ctx.param('period', { type: 'integer', default: 14 }); // Correct ctx.param('period', { type: 'int', default: 14 }); ctx.param('threshold', { type: 'float', default: 0.5 }); ctx.param('mode', { type: 'string', default: 'fast' }); ctx.param('useFiler', { type: 'boolean', default: true });
Error: missing_default
Error: Parameter "period" must have a default value
Cause: Every parameter must specify a default value.
Fix:
// Wrong — no default ctx.param('period', { type: 'int', min: 5, max: 50 }); // Correct ctx.param('period', { type: 'int', default: 14, min: 5, max: 50 });
Error: invalid_param (range issues)
Error: Parameter "period": default (100) is outside range [5, 50]
Cause: The default value must be between min and max.
Fix: Ensure min <= default <= max:
ctx.param('period', { type: 'int', default: 14, // Must be between min and max min: 5, max: 50, step: 1, });
Error: Step Size Issues
Common problems with step:
// Step must be positive ctx.param('period', { type: 'int', default: 14, min: 5, max: 50, step: 0 }); // Step should evenly divide the range (or close to it) // This creates 45/7 ≈ 6.4 steps — some values will be skipped ctx.param('period', { type: 'int', default: 14, min: 5, max: 50, step: 7 }); // Better — step divides evenly ctx.param('period', { type: 'int', default: 15, min: 5, max: 50, step: 5 });
Optimization Grid Overflows
If your parameters produce more than 50,000 combinations, optimization will not start. Reduce the grid by:
- Increasing step sizes
- Narrowing min/max ranges
- Setting
optimize: falseon less important parameters
parameterparaminvalidtypedefaultminmaxstepvalidation