期权复盘支持纯期权自动生成标的永续双周期K线,按时间标记进场出场。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -626,6 +626,24 @@
|
||||
return base + encodeURIComponent(name);
|
||||
}
|
||||
|
||||
function chartTfLabel(tf) {
|
||||
if (tf === "auto") return "自动K线";
|
||||
if (tf === "_") return "截图";
|
||||
return tf;
|
||||
}
|
||||
|
||||
function setChartOptionsVisible(visible) {
|
||||
var box = $("or-chart-options");
|
||||
var hint = $("or-chart-hint");
|
||||
if (box) box.classList.toggle("hidden", !visible);
|
||||
if (hint) hint.classList.toggle("hidden", !visible);
|
||||
}
|
||||
|
||||
function resetChartOptions() {
|
||||
var cb = $("or-exchange-chart");
|
||||
if (cb) cb.checked = false;
|
||||
}
|
||||
|
||||
function renderDetailImages(images) {
|
||||
var imagesHost = $("or-detail-images");
|
||||
if (!imagesHost) return;
|
||||
@@ -637,7 +655,7 @@
|
||||
var key = tf || "_";
|
||||
byTf[key] = file;
|
||||
});
|
||||
var order = ["5m", "15m", "1h", "4h"];
|
||||
var order = ["auto", "5m", "15m", "1h", "4h"];
|
||||
var keys = order.slice();
|
||||
Object.keys(byTf).forEach(function (k) {
|
||||
if (keys.indexOf(k) < 0) keys.push(k);
|
||||
@@ -646,7 +664,7 @@
|
||||
.map(function (tf) {
|
||||
var file = byTf[tf];
|
||||
if (!file) {
|
||||
if (order.indexOf(tf) < 0) return "";
|
||||
if (order.indexOf(tf) < 0 || tf === "auto") return "";
|
||||
return (
|
||||
'<div class="or-detail-img-cell">' +
|
||||
'<span class="or-detail-img-label">' +
|
||||
@@ -657,7 +675,7 @@
|
||||
);
|
||||
}
|
||||
var src = optionsJournalImgSrc(file);
|
||||
var label = escapeHtml(tf === "_" ? "截图" : tf);
|
||||
var label = escapeHtml(chartTfLabel(tf));
|
||||
return (
|
||||
'<div class="or-detail-img-cell">' +
|
||||
'<span class="or-detail-img-label">' +
|
||||
@@ -992,6 +1010,8 @@
|
||||
($("or-f-note") || {}).value = "";
|
||||
setMoodTags("");
|
||||
resetUploadSlots();
|
||||
resetChartOptions();
|
||||
setChartOptionsVisible(false);
|
||||
var summary = $("or-journal-summary");
|
||||
if (summary) {
|
||||
summary.textContent = "截图槽位与合约复盘相同(5m / 15m / 1h / 4h).";
|
||||
@@ -1053,6 +1073,8 @@
|
||||
setSelectValue($("or-f-entry"), e.entry_logic || "");
|
||||
($("or-f-note") || {}).value = e.note || "";
|
||||
setMoodTags(e.mistake_tags);
|
||||
resetChartOptions();
|
||||
setChartOptionsVisible(t.source_type === "option_spot");
|
||||
|
||||
var summary = $("or-journal-summary");
|
||||
if (summary) {
|
||||
@@ -1068,6 +1090,8 @@
|
||||
}
|
||||
|
||||
(e.images || []).forEach(function (img) {
|
||||
var tf = String((img && img.tf) || "").trim();
|
||||
if (tf === "auto") return;
|
||||
var hidden = document.querySelector(
|
||||
'#or-upload-slots .or-upload-hidden[data-tf="' + img.tf + '"]'
|
||||
);
|
||||
@@ -1167,6 +1191,15 @@
|
||||
note: ($("or-f-note") || {}).value || "",
|
||||
images: collectImages(),
|
||||
};
|
||||
var chartBox = $("or-chart-options");
|
||||
var chartVisible = chartBox && !chartBox.classList.contains("hidden");
|
||||
if (chartVisible && ($("or-exchange-chart") || {}).checked) {
|
||||
payload.journal_exchange_chart = true;
|
||||
payload.journal_chart_tf1 = ($("or-chart-tf1") || {}).value || "";
|
||||
payload.journal_chart_tf2 = ($("or-chart-tf2") || {}).value || "";
|
||||
payload.journal_chart_limit = ($("or-chart-limit") || {}).value || "";
|
||||
payload.journal_chart_anchor = ($("or-chart-anchor") || {}).value || "close";
|
||||
}
|
||||
($("or-save-status") || {}).textContent = "保存中…";
|
||||
fetch("/api/options/review/entry", {
|
||||
method: "POST",
|
||||
@@ -1182,7 +1215,9 @@
|
||||
($("or-save-status") || {}).textContent = data.msg || "保存失败";
|
||||
return;
|
||||
}
|
||||
($("or-save-status") || {}).textContent = "已保存";
|
||||
($("or-save-status") || {}).textContent = data.chart_queued
|
||||
? "已保存,K线图后台生成中"
|
||||
: "已保存";
|
||||
hideJournalForm();
|
||||
reloadAll();
|
||||
openDetail(tradeId);
|
||||
|
||||
Reference in New Issue
Block a user