feat(Core/UI): 백테스트 전역 엔진 선택 버튼 추가 및 스캘핑 Rust 방어로직 포팅 1차 완료
This commit is contained in:
11
scratch/fix_avg.js
Normal file
11
scratch/fix_avg.js
Normal file
@@ -0,0 +1,11 @@
|
||||
function formatWhipParam(r, k, prefix, suffix, dec, stats) {
|
||||
if (r[k] == null) return null;
|
||||
const v = Number(r[k]);
|
||||
let text = `${prefix}${v.toFixed(dec)}${suffix}`;
|
||||
if (!stats || !stats[k]) return text;
|
||||
const s = stats[k];
|
||||
const dist = Math.abs(v - s.avg);
|
||||
const ratio = 1 - (dist / s.maxDist);
|
||||
const alpha = 0.1 + (0.8 * ratio);
|
||||
return `<span style="background:rgba(255, 165, 0, ${alpha.toFixed(2)}); color:${alpha > 0.4 ? '#000' : 'inherit'}; border-radius:3px; padding:0 2px;">${text}</span>`;
|
||||
}
|
||||
Reference in New Issue
Block a user