feat: add force-close exit trigger and round journal real RR to 2dp
复盘离场触发增加强制清仓;填入复盘与自动计算实际盈亏比保留两位小数。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -417,7 +417,7 @@ function setJournalField(name, value){
|
||||
el.value = String(value);
|
||||
}
|
||||
|
||||
const EARLY_EXIT_TRIGGERS = new Set(["止盈","保本止盈","移动止盈","时间平仓","手动平仓","止损","其他"]);
|
||||
const EARLY_EXIT_TRIGGERS = new Set(["止盈","保本止盈","移动止盈","时间平仓","强制清仓","手动平仓","止损","其他"]);
|
||||
const KEY_ENTRY_REASON_BY_SIGNAL = {
|
||||
"箱体突破": "关键位箱体突破",
|
||||
"收敛突破": "关键位收敛突破",
|
||||
@@ -552,7 +552,7 @@ function fillJournalFromTrade(t){
|
||||
}
|
||||
}
|
||||
const er = String(t.result || "").trim();
|
||||
const exitTrigMap = { 止盈: "止盈", 保本止盈: "保本止盈", 移动止盈: "移动止盈", 时间平仓: "时间平仓", 手动平仓: "手动平仓", 止损: "止损" };
|
||||
const exitTrigMap = { 止盈: "止盈", 保本止盈: "保本止盈", 移动止盈: "移动止盈", 时间平仓: "时间平仓", 强制清仓: "强制清仓", 手动平仓: "手动平仓", 止损: "止损" };
|
||||
if(exitTrigMap[er]) setJournalField("early_exit_trigger", exitTrigMap[er]);
|
||||
const note = `来自交易记录自动填充:${t.symbol || "-"} ${t.direction || "-"} | 入场:${entryPx || "-"} 止损:${slPx || "-"} 止盈:${tpPx || "-"} | 类型:${t.monitor_type || "-"}`;
|
||||
setJournalField("note", note);
|
||||
@@ -575,7 +575,7 @@ function recomputeJournalRealRr(){
|
||||
const pnl = Number(String(pnlEl.value || "").trim());
|
||||
const risk = Number(String(riskHint.value || "").trim());
|
||||
if(Number.isFinite(pnl) && Number.isFinite(risk) && risk > 0){
|
||||
rrEl.value = (pnl / risk).toFixed(4);
|
||||
rrEl.value = (pnl / risk).toFixed(2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user