Phase 4: Stricter direction threshold (75 bps) with augmentation and multi-pair training#40
Merged
Raynergy-svg merged 6 commits intomainfrom Feb 13, 2026
Conversation
…ation - Update direction_threshold from 0.003 to 0.0075 (75 bps) - Increase OANDA candle fetch from 15k to 25k H1 candles - Add time-series augmentation to TransformerDirectionTrainer - Update config with augmentation parameters Co-authored-by: Raynergy-svg <82431565+Raynergy-svg@users.noreply.github.com>
- Add MULTI_PAIR_TRAINING_GUIDE.md - Enhance RF trainer with Phase 4 MAE target (10 bps) - Add comprehensive Phase 4 validation tests - All tests passing Co-authored-by: Raynergy-svg <82431565+Raynergy-svg@users.noreply.github.com>
- Complete documentation of all changes - Migration guide for existing users - Validation checklist and success metrics - Future enhancement recommendations Co-authored-by: Raynergy-svg <82431565+Raynergy-svg@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update model training configurations and thresholds
Phase 4: Stricter direction threshold (75 bps) with augmentation and multi-pair training
Feb 12, 2026
- Remove unused variable n_features in transformer_trainer.py (F841) - Update DIRECTION_DEFAULTS threshold to 0.0075 (75 bps) to match config - Update test_unified_defaults.py to expect new Phase4 threshold
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.
Direction threshold increased from 30 bps to 75 bps for clearer signals. Reduces training samples by ~35%, compensated via data augmentation, extended history, and multi-pair pre-training.
Core Changes
Threshold & Data
direction_threshold: 0.003 → 0.0075(75 bps filter)default_candles: 15000 → 25000(~3 years H1 data)Time-Series Augmentation (new)
tf.data.DatasetinTransformerDirectionTrainer.train()use_augmentation: true(default enabled)RF Risk Target Tracking
target_achieved,target_gap_bpsMulti-Pair Training
JointMultiPairTrainerworkflowFiles Modified
Config:
config_improved_H1.yaml(threshold, candles, augmentation params)Code:
transformer_trainer.py(+augmentation),random_forest_trainer.py(+target tracking),config.py(+5 augmentation params)Defaults: Updated 15k→25k in 5 files (
training_ops.py,buddy_training_helpers.py,main.py,bin/Buddy)Docs:
MULTI_PAIR_TRAINING_GUIDE.md,PHASE4_IMPLEMENTATION_SUMMARY.mdTests:
test_phase4_config.py(7 validation tests, all passing)Backward Compatibility
Fully backward-compatible via config flags:
Expected Impact
Original prompt
Start implementation
The user has attached the following file paths as relevant context:
- .github/copilot-instructions.md
[Chronological Review: The conversation began with the user outlining a series of tasks related to recalibrating thresholds and enhancing model training. The user specified changes to configuration files, the use of specific training methods, and adjustments to data handling. The most recent phase discussed was Phase 4, focusing on threshold recalibration and compensating for smaller training sets.][Intent Mapping: The user explicitly requested to increase the direction threshold, update a configuration file, implement multi-pair pre-training, apply data augmentation techniques, extend historical data, and set a target for the risk model's MAE. Key requests included:
[Technical Inventory: Technologies and frameworks mentioned include:
[Code Archaeology: The user referenced specific lines in configuration files and Python scripts:
[Progress Assessment: The user has outlined a comprehensive plan for recalibrating thresholds and enhancing training methods. Specific tasks are pending, including the implementation of the requested changes and testing the outcomes.]
[Context Validation: All critical information for continuation is captured, including specific file modifications and the rationale behind each request.]
[Recent Commands Analysis: The user executed commands related to updating the configuration file and implementing training strategies. The immediate pre-summarization state involved detailing the adjustments needed for the direction threshold and the methods to compensate for smaller training sets.]
1. Conversation Overview: - Primary Objectives: The user aims to recalibrate thresholds and enhance model training methods, specifically requesting to "increase direction threshold from 30 bps to 75-100 bps" and implement multi-pair pre-training. - Session Context: The conversation has progressed through various phases of model training adjustments, with the most recent focus on Phase 4, which involves recalibrating thresholds and compensating for reduced training data. - User Intent Evolution: The user's needs have evolved from general model training adjustments to specific technical implementations aimed at improving model performance and data handling.- Technical Foundation:
- YAML Configuration: The user is modifying config_improved_H1.yaml to adjust model parameters.
- Python Scripts: The user is utilizing joint_trainer.py and transformer_trainer.py for model training and augmentation techniques.
- Machine Learning: Concepts such as Random Forest and hyperparameter tuning are integral to the user's strategy.
- Codebase Status:
- config_improved_H1.yaml:
- Purpose: Configures model parameters for training.
- Current State: Needs modification to change direction_threshold from 0.003 to 0.0075.
- Key Code Segments: Line 73 for direction threshold.
- joint_trainer.py:
- Purpose: Contains the JointMultiPairTrainer class for pre-training models.
- Current State: Ready for implementation of multi-pair pre-training.
- transformer_trainer.py:
- Purpose: Contains the TransformerDirectionTrainer class for training models with data augmentation.
- Current State: Needs updates to include time-series augmentation techniques.
- Problem Resolution:
- Issues Encountered: The need to adjust the direction threshold and compensate for smaller training sets.
- Solutions Implemented: Proposed changes to configuration and training methods.
- Debugging Context: Ongoing adjustments to ensure model performance meets specified MAE targets.
- Lessons Learned: Importance of adapting training strategies to handle reduced data effectively.
- Progress Tracking:
- Completed Tasks: The user has outlined a detailed plan for recalibration and training enhancements.
- Partially Complete Work: Implementation of the proposed changes is pending.
- Validated Outcomes: None yet, as the changes have not been executed or tested.
- Active Work State:
- Current Focus: The user is working on recalibrating the direction threshold and implementing multi-pair pre-training...
Created from VS Code.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.