small fixes for backtest
This commit is contained in:
parent
6df32dc18b
commit
6cf3179092
16 changed files with 2180 additions and 16 deletions
|
|
@ -413,11 +413,11 @@ export class BacktestEngine extends EventEmitter {
|
|||
let trendDuration = 0;
|
||||
|
||||
while (currentTime <= endTime) {
|
||||
// Every 20-50 days, change trend
|
||||
// Every 10-30 days, change trend (more frequent for testing)
|
||||
if (trendDuration <= 0) {
|
||||
trend = Math.random() > 0.5 ? 1 : -1;
|
||||
trendStrength = 0.002 + Math.random() * 0.003; // 0.2% to 0.5% daily trend
|
||||
trendDuration = Math.floor(20 + Math.random() * 30);
|
||||
trendStrength = 0.003 + Math.random() * 0.005; // 0.3% to 0.8% daily trend
|
||||
trendDuration = Math.floor(10 + Math.random() * 20); // Shorter trends
|
||||
}
|
||||
|
||||
// Generate price movement with trend and noise
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue