I want to flag a bug I’ve discovered in the JSON export functionality for signal bots that I believe needs urgent attention, as it affects the reliability of bot backups and imports.
When exporting a signal bot configuration to JSON, several indicator conditions are being inverted in the exported file compared to what is configured in the UI. Specifically, ‘Greater Than’ conditions export as ‘lt’ (less than) and ‘Lower Than’ conditions export as ‘gt’ (greater than) for price-vs-MA comparisons. Additionally, exit conditions appear to have the same inversion problem.
Here is a concrete example from my own bot export:
-
Entry Group 1, EMA 100 vs Price:
- UI shows: Current Price GREATER THAN EMA 100
- JSON exports as: “indicatorCondition”: “lt”
- Should be: “indicatorCondition”: “gt”
-
Entry Group 2, Price vs EMA 21:
- UI shows: Current Price GREATER THAN EMA 21
- JSON exports as: “indicatorCondition”: “lt”
- Should be: “indicatorCondition”: “gt”
-
Entry Group 2, Price vs EMA 100:
- UI shows: Current Price GREATER THAN EMA 100
- JSON exports as: “indicatorCondition”: “lt”
- Should be: “indicatorCondition”: “gt”
-
Exit Group, Price vs EMA 100:
- UI shows: Current Price LOWER THAN EMA 100
- JSON exports as: “indicatorCondition”: “gt”
- Should be: “indicatorCondition”: “lt”
This is particularly concerning because:
- Users relying on JSON exports as backups will unknowingly restore bots with inverted logic
- A bot configured to only enter when price is ABOVE a moving average would be incorrectly imported as entering when price is BELOW it — the opposite signal
- This could cause significant financial losses if a user restores from a JSON backup and runs it live without re-verifying every condition in the UI
I discovered this by carefully cross-referencing my exported JSON against my known UI configuration. The backtest results confirmed the UI was correct and the JSON was not.
My suggestion for a fix:
- Audit the JSON serialisation logic for all MA price comparison indicators
- Add a validation step on import that warns users if imported conditions appear inconsistent
- Consider adding a human-readable label field to each exported indicator so users can verify intent at a glance (e.g. “price above EMA 100” rather than just “lt”/“gt” codes)
- Provide a JSON schema or documentation that clearly defines what each condition code means so users can manually verify exports
I’d also suggest adding a warning in the UI noting that JSON exports should always be verified against the UI before being used for import or archival purposes, until this is resolved.
Thank you for looking into this — I otherwise really enjoy using Gainium and appreciate the platform.