fix(ton-trading-bot): исправить стратегию накопления TON (#204)#205
Merged
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: xlabtg#204
Author
Working session summaryГотово: issue #204 исправлен, изменения отправлены в PR #205, PR переведён в ready. Основное:
Проверки:
This summary was automatically extracted from the AI working session output. |
Author
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
📊 Context and tokens usage:
Total: (133.2K + 3.4M cached) input tokens, 11.1K output tokens, $5.275215 cost 🤖 Models used:
📎 Log file uploaded as Gist (1549KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
Author
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Что исправлено
ton_trading_auto_executeбольше не трактует рост TON/USD как прибыль для стратегии накопления TON→USDT.auto_close_at_profit_percentсохраняется направлениеbelow: правило срабатывает после заданного падения цены, а не роста.above.received_from_asset - amount_in. Поэтому сценарий сделки [P0] ton-trading-bot: 3 critical tools documented but missing from exported API (get_open_positions, close_position, close_all_positions) #188 теперь даёт10.93 - 10 = +0.93 TON, а не ошибочный убыток из движения USD-цены.pnl_asset, чтобы единица P&L была явной.stop_loss_rules.profit_directionс обратно совместимым значениемabove.ton-trading-botповышена с 2.4.1 до 2.4.2, README обновлён.Воспроизведение
До исправления тест с реальными данными issue падал:
+0.93 TON(+9.3%);-$1.538из формулы движения TON/USD.Автоматические проверки
Добавлены тесты, которые проверяют:
profit_direction = belowдля накопления;+0.93 TON;closing → open;close_failed;Результаты локально:
node --test plugins/ton-trading-bot/tests/index.test.js plugins/ton-trading-bot/tests/open-positions.test.js— 203/203;npm run lint— 0 ошибок (только унаследованные предупреждения);npm run typecheck— успешно;npm run validate—ton-trading-bot: 42 tool(s) validated.Общий
npm testдоходит до 495 успешных тестов и падает только на несвязанномvk-full-adminиз-за отсутствующей зависимостиvk-io. Общая validate также сообщает отсутствующие зависимости других плагинов (@evaafi/sdk,@tonkite/highload-wallet-v3,@ston-fi/api,vk-io).Fixes #204