Fájl részletek

Ezen az oldalon egy konkrét fájl aktuális állapotát tudod megnézni.

Vissza a fájltérképhez Csak változott Stratégia-labor Monitor főoldal ← Előző módosult Következő módosult →
Fájl útvonala
/opt/bots/saturnus/app/templates/settings.html
Létezik most?
IGEN
Aktuális státusz
MODIFIED
Méret
20110
Módosítás ideje
1777145322.1557987
Korábbi baseline időpont
1775632396.0517697
SHA256 rövid

Előnézet (első 120 sor)

{% extends "base.html" %}

{% block title %}Saturnus Bot – Beállítások{% endblock %}
{% block brand_title %}Saturnus Bot – Beállítások{% endblock %}

{% block extra_css %}
.settings-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
}
.settings-form{
  display:grid;
  gap:12px;
}
.settings-row{
  display:grid;
  grid-template-columns: 1fr 180px;
  gap:12px;
  align-items:center;
}
.settings-row label{
  font-size:13px;
  color:var(--muted);
}
.settings-row input,
.settings-row select{
  width:100%;
  background:rgba(255,255,255,.04);
  color:var(--text);
  border:1px solid var(--line);
  border-radius:10px;
  padding:10px 12px;
  font-size:14px;
}
.settings-actions{
  display:flex;
  gap:10px;
  align-items:center;
  margin-top:8px;
  flex-wrap:wrap;
}
.msg{
  font-size:13px;
  color:var(--muted);
}
.msg.ok{ color:var(--good); }
.msg.err{ color:var(--bad); }

.helper{
  font-size:12px;
  color:var(--muted);
  margin-top:4px;
}

.section-title{
  margin:0 0 10px 0;
  font-size:14px;
  font-weight:800;
}

.level-grid{
  display:grid;
  grid-template-columns: 1fr 180px;
  gap:10px 12px;
  align-items:center;
}
.level-grid .k{
  font-size:13px;
  color:var(--muted);
}
.level-grid .v{
  font-size:14px;
  font-weight:700;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:rgba(255,255,255,.03);
}
.level-box{
  margin-top:14px;
}
.level-note{
  font-size:12px;
  color:var(--muted);
  margin-top:10px;
}

@media (max-width: 900px){
  .settings-grid{
    grid-template-columns: 1fr;
  }
  .settings-row,
  .level-grid{
    grid-template-columns: 1fr;
  }
}
{% endblock %}

{% block content %}
<div class="card">
  <h2 class="title">Saturnus runner beállítások</h2>
  <div class="muted" style="margin-bottom:12px;">
    Itt a Saturnus runner aktív rendszer- és V2 szabálybeállításai állíthatók.
    Mentés után a runner automatikusan újraindul.
  </div>

  <div class="settings-grid">
    <div class="card">
      <h3 class="section-title">Általános futási beállítások</h3>
      <div class="settings-form">
        <div class="settings-row">
          <label for="tick_seconds">TICK_SECONDS</label>
          <input id="tick_seconds" type="number" step="0.1">
        </div>

        <div class="settings-row">
          <label for="pair">PAIR</label>
          <input id="pair" type="text">
        </div>

Csak változott diff sorok

--- baseline +++ current @@ -176,9 +176,17 @@ - <h3 class="section-title">V2 szabályszázalékok</h3> + <h3 class="section-title">V2 stratégiai beállítások</h3> + <div class="settings-row"> + <label for="std_sell_enabled">STANDARD SELL engedélyezve</label> + <select id="std_sell_enabled"> + <option value="true">Igen</option> + <option value="false">Nem</option> + </select> + </div> + @@ -190,16 +198,42 @@ + <label for="recovery_profit_target_pct">RECOVERY profit cél %</label> + <input id="recovery_profit_target_pct" type="number" step="0.01"> + </div> + + <div class="settings-row"> + <label for="panic_sell_enabled">PANIC SELL engedélyezve</label> + <select id="panic_sell_enabled"> + <option value="true">Igen</option> + <option value="false">Nem</option> + </select> + </div> + + <div class="settings-row"> + <label for="sell_reversal_min_pct">SELL REVERSAL MIN %</label> + <input id="sell_reversal_min_pct" type="number" step="0.01"> + </div> + + <div class="settings-row"> + <label for="std_buy_enabled">STANDARD BUY engedélyezve</label> + <select id="std_buy_enabled"> + <option value="true">Igen</option> + <option value="false">Nem</option> + </select> + </div> + + <div class="settings-row"> @@ -210,18 +244,49 @@ + <label for="panic_buy_enabled">PANIC BUY engedélyezve</label> + <select id="panic_buy_enabled"> + <option value="true">Igen</option> + <option value="false">Nem</option> + </select> + </div> + + <div class="settings-row"> + <label for="panic_buy_confirm_ticks">PANIC BUY megerősítő tick</label> + <input id="panic_buy_confirm_ticks" type="number" step="1"> + </div> + + <div class="settings-row"> + <div class="settings-row"> + <label for="ma_filter_enabled">MA filter engedélyezve</label> + <select id="ma_filter_enabled"> + <option value="true">Igen</option> + <option value="false">Nem</option> + </select> + </div> + + <div class="settings-row"> + <label for="ma_period">MA periódus</label> + <input id="ma_period" type="number" step="1"> + </div> + + <div class="settings-row"> + <label for="ma_sideways_band_pct">MA oldalazási sáv %</label> + <input id="ma_sideways_band_pct" type="number" step="0.01"> + </div> + - V2 logika: SELL oldalon STANDARD / RECOVERY / PANIC, BUY oldalon STANDARD / RECOVERY / PANIC. - A katasztrófa szintek arming / hard-risk zónák. + A stratégiai mezőknek a Strategy Lab felületével 1:1-ben egyezniük kell. + Az itt megadott értékek az éles motorhoz tartoznak; a Labor külön paraméterkészlettel fut. @@ -285,6 +350,53 @@ +function normalizeDecimalInputValue(value) { + if (value === null || value === undefined) return ""; + return String(value).replace(",", "."); +} + +function setNormalizedValue(id, value) { + const el = document.getElementById(id); + if (!el) return; + if (value === null || value === undefined || value === "") { + el.value = ""; + return; + } + el.value = normalizeDecimalInputValue(value); +} + +function getNormalizedFloat(id) { + const el = document.getElementById(id); + if (!el) return NaN; + const raw = normalizeDecimalInputValue(el.value).trim(); + el.value = raw; + return parseFloat(raw); +} + +function getNormalizedInt(id) { + const el = document.getElementById(id); + if (!el) return NaN; + return parseInt(String(el.value).trim(), 10); +} + +function attachDecimalNormalizer(ids) { + ids.forEach((id) => { + const el = document.getElementById(id); + if (!el) return; + el.addEventListener("input", () => { + const start = el.selectionStart; + const end = el.selectionEnd; + const normalized = normalizeDecimalInputValue(el.value); + if (normalized !== el.value) { + el.value = normalized; + try { + el.setSelectionRange(start, end); + } catch (e) {} + } + }); + }); +} + @@ -309,26 +421,42 @@ - document.getElementById("tick_seconds").value = data.tick_seconds; - document.getElementById("pair").value = data.pair; - document.getElementById("timeframe").value = data.timeframe; - document.getElementById("limit").value = data.limit; - document.getElementById("execution_enabled").value = boolToSelectValue(data.execution_enabled); - document.getElementById("execution_log_only").value = boolToSelectValue(data.execution_log_only); - document.getElementById("buy_lock_ttl_sec").value = data.buy_lock_ttl_sec; - document.getElementById("kill_switch").value = boolToSelectValue(data.kill_switch); - document.getElementById("max_trades_per_day").value = data.max_trades_per_day; - document.getElementById("daily_loss_cap_pct").value = data.daily_loss_cap_pct; - document.getElementById("ft_url").value = data.ft_url; - - document.getElementById("std_sell_pct").value = data.std_sell_pct; - document.getElementById("recovery_sell_retrace_pct").value = data.recovery_sell_retrace_pct; - document.getElementById("panic_sell_pct").value = data.panic_sell_pct; - document.getElementById("catastrophe_sell_pct").value = data.catastrophe_sell_pct; - document.getElementById("std_buy_pct").value = data.std_buy_pct; - document.getElementById("recovery_buy_rebound_pct").value = data.recovery_buy_rebound_pct; - document.getElementById("panic_buy_pct").value = data.panic_buy_pct; - document.getElementById("catastrophe_buy_pct").value = data.catastrophe_buy_pct; + document.getElementById("tick_seconds").value = data.tick_seconds ?? ""; + document.getElementById("pair").value = data.pair ?? ""; + document.getElementById("timeframe").value = data.timeframe ?? ""; + document.getElementById("limit").value = data.limit ?? ""; + document.getElementById("execution_enabled").value = boolToSelectValue(Boolean(data.execution_enabled)); + document.getElementById("execution_log_only").value = boolToSelectValue(Boolean(data.execution_log_only));

Teljes diff

--- baseline +++ current @@ -176,9 +176,17 @@ </div> <div class="card"> - <h3 class="section-title">V2 szabályszázalékok</h3> + <h3 class="section-title">V2 stratégiai beállítások</h3> <div class="settings-form"> + <div class="settings-row"> + <label for="std_sell_enabled">STANDARD SELL engedélyezve</label> + <select id="std_sell_enabled"> + <option value="true">Igen</option> + <option value="false">Nem</option> + </select> + </div> + <div class="settings-row"> <label for="std_sell_pct">STD SELL %</label> <input id="std_sell_pct" type="number" step="0.01"> @@ -190,16 +198,42 @@ </div> <div class="settings-row"> + <label for="recovery_profit_target_pct">RECOVERY profit cél %</label> + <input id="recovery_profit_target_pct" type="number" step="0.01"> + </div> + + <div class="settings-row"> + <label for="panic_sell_enabled">PANIC SELL engedélyezve</label> + <select id="panic_sell_enabled"> + <option value="true">Igen</option> + <option value="false">Nem</option> + </select> + </div> + + <div class="settings-row"> <label for="panic_sell_pct">PANIC SELL %</label> <input id="panic_sell_pct" type="number" step="0.01"> </div> <div class="settings-row"> + <label for="sell_reversal_min_pct">SELL REVERSAL MIN %</label> + <input id="sell_reversal_min_pct" type="number" step="0.01"> + </div> + + <div class="settings-row"> <label for="catastrophe_sell_pct">CATASTROPHE SELL %</label> <input id="catastrophe_sell_pct" type="number" step="0.01"> </div> <div class="settings-row"> + <label for="std_buy_enabled">STANDARD BUY engedélyezve</label> + <select id="std_buy_enabled"> + <option value="true">Igen</option> + <option value="false">Nem</option> + </select> + </div> + + <div class="settings-row"> <label for="std_buy_pct">STD BUY %</label> <input id="std_buy_pct" type="number" step="0.01"> </div> @@ -210,18 +244,49 @@ </div> <div class="settings-row"> + <label for="panic_buy_enabled">PANIC BUY engedélyezve</label> + <select id="panic_buy_enabled"> + <option value="true">Igen</option> + <option value="false">Nem</option> + </select> + </div> + + <div class="settings-row"> <label for="panic_buy_pct">PANIC BUY %</label> <input id="panic_buy_pct" type="number" step="0.01"> </div> <div class="settings-row"> + <label for="panic_buy_confirm_ticks">PANIC BUY megerősítő tick</label> + <input id="panic_buy_confirm_ticks" type="number" step="1"> + </div> + + <div class="settings-row"> <label for="catastrophe_buy_pct">CATASTROPHE BUY %</label> <input id="catastrophe_buy_pct" type="number" step="0.01"> </div> + <div class="settings-row"> + <label for="ma_filter_enabled">MA filter engedélyezve</label> + <select id="ma_filter_enabled"> + <option value="true">Igen</option> + <option value="false">Nem</option> + </select> + </div> + + <div class="settings-row"> + <label for="ma_period">MA periódus</label> + <input id="ma_period" type="number" step="1"> + </div> + + <div class="settings-row"> + <label for="ma_sideways_band_pct">MA oldalazási sáv %</label> + <input id="ma_sideways_band_pct" type="number" step="0.01"> + </div> + <div class="helper"> - V2 logika: SELL oldalon STANDARD / RECOVERY / PANIC, BUY oldalon STANDARD / RECOVERY / PANIC. - A katasztrófa szintek arming / hard-risk zónák. + A stratégiai mezőknek a Strategy Lab felületével 1:1-ben egyezniük kell. + Az itt megadott értékek az éles motorhoz tartoznak; a Labor külön paraméterkészlettel fut. </div> </div> </div> @@ -285,6 +350,53 @@ {% block extra_js %} <script> +function normalizeDecimalInputValue(value) { + if (value === null || value === undefined) return ""; + return String(value).replace(",", "."); +} + +function setNormalizedValue(id, value) { + const el = document.getElementById(id); + if (!el) return; + if (value === null || value === undefined || value === "") { + el.value = ""; + return; + } + el.value = normalizeDecimalInputValue(value); +} + +function getNormalizedFloat(id) { + const el = document.getElementById(id); + if (!el) return NaN; + const raw = normalizeDecimalInputValue(el.value).trim(); + el.value = raw; + return parseFloat(raw); +} + +function getNormalizedInt(id) { + const el = document.getElementById(id); + if (!el) return NaN; + return parseInt(String(el.value).trim(), 10); +} + +function attachDecimalNormalizer(ids) { + ids.forEach((id) => { + const el = document.getElementById(id); + if (!el) return; + el.addEventListener("input", () => { + const start = el.selectionStart; + const end = el.selectionEnd; + const normalized = normalizeDecimalInputValue(el.value); + if (normalized !== el.value) { + el.value = normalized; + try { + el.setSelectionRange(start, end); + } catch (e) {} + } + }); + }); +} + function boolToSelectValue(v){ return v ? "true" : "false"; } @@ -309,26 +421,42 @@ const res = await fetch("/api/settings", {cache:"no-store"}); const data = await res.json(); - document.getElementById("tick_seconds").value = data.tick_seconds; - document.getElementById("pair").value = data.pair; - document.getElementById("timeframe").value = data.timeframe; - document.getElementById("limit").value = data.limit; - document.getElementById("execution_enabled").value = boolToSelectValue(data.execution_enabled); - document.getElementById("execution_log_only").value = boolToSelectValue(data.execution_log_only); - document.getElementById("buy_lock_ttl_sec").value = data.buy_lock_ttl_sec; - document.getElementById("kill_switch").value = boolToSelectValue(data.kill_switch); - document.getElementById("max_trades_per_day").value = data.max_trades_per_day; - document.getElementById("daily_loss_cap_pct").value = data.daily_loss_cap_pct; - document.getElementById("ft_url").value = data.ft_url; - - document.getElementById("std_sell_pct").value = data.std_sell_pct; - document.getElementById("recovery_sell_retrace_pct").value = data.recovery_sell_retrace_pct; - document.getElementById("panic_sell_pct").value = data.panic_sell_pct; - document.getElementById("catastrophe_sell_pct").value = data.catastrophe_sell_pct; - document.getElementById("std_buy_pct").value = data.std_buy_pct; - document.getElementById("recovery_buy_rebound_pct").value = data.recovery_buy_rebound_pct; - document.getElementById("panic_buy_pct").value = data.panic_buy_pct; - document.getElementById("catastrophe_buy_pct").value = data.catastrophe_buy_pct; + document.getElementById("tick_seconds").value = data.tick_seconds ?? ""; + document.getElementById("pair").value = data.pair ?? ""; + document.getElementById("timeframe").value = data.timeframe ?? ""; + document.getElementById("limit").value = data.limit ?? ""; + document.getElementById("execution_enabled").value = boolToSelectValue(Boolean(data.execution_enabled)); + document.getElementById("execution_log_only").value = boolToSelectValue(Boolean(data.execution_log_only)); ... [DIFF LEVÁGVA] további sorok: 91