Refine strategy simulation with pyramiding, partial exits, and fixed marker logic

- Implement position pyramiding and 15% partial profit-taking
- Add mutual exclusion between entry and exit in the same candle
- Optimize simulation to use cached indicator results
- Revert Hurst Bands signal logic to cross-down (dip entry)
- Add safety filter for chart markers to prevent rendering errors
This commit is contained in:
DiTus
2026-03-03 15:39:59 +01:00
parent d92af6903d
commit 633a146e8e
3 changed files with 120 additions and 99 deletions

View File

@ -70,21 +70,21 @@ function calculateHurstSignal(indicator, lastCandle, prevCandle, values, prevVal
return null;
}
// BUY: Price crosses DOWN through lower Hurst Band
// BUY: Price crosses DOWN through lower Hurst Band (dip entry)
if (prevClose > prevLower && close <= lower) {
return {
type: 'buy',
strength: 75,
strength: 80,
value: close,
reasoning: `Price crossed DOWN through lower Hurst Band`
};
}
// SELL: Price crosses DOWN through upper Hurst Band (reversal from top)
// SELL: Price crosses DOWN through upper Hurst Band (reversal entry)
if (prevClose > prevUpper && close <= upper) {
return {
type: 'sell',
strength: 75,
strength: 80,
value: close,
reasoning: `Price crossed DOWN through upper Hurst Band`
};