[{"id":"f40ddbc","elType":"container","settings":{"flex_direction":"row"},"elements":[{"id":"a63b7b5","elType":"widget","settings":{"html":"<html lang=\"hu\">\r\n<head>\r\n<meta charset=\"utf-8\" \/>\r\n<meta name=\"viewport\" content=\"width=device-width,initial-scale=1\" \/>\r\n<title>Multi-Instrument Poz\u00edci\u00f3meret Kalkul\u00e1tor<\/title>\r\n<style>\r\n  :root{\r\n    --bg:#081512;\r\n    --panel:#0f1c17;\r\n    --muted:#b9b5b5;\r\n    --text:#e8f6f1;\r\n    --accent:#0d8461;\r\n    --good:#19c089;\r\n    --warn:#e7b547;\r\n    --bad:#d96e6e;\r\n    --line:#13352d;\r\n  }\r\n  *{box-sizing:border-box}\r\n  body{\r\n    margin:0;\r\n    background:radial-gradient(1200px 800px at 20% -10%, #13241e 0%, var(--bg) 60%),var(--bg);\r\n    color:var(--text);\r\n    font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;\r\n    line-height:1.45\r\n  }\r\n  header{padding:26px 16px 6px;text-align:center}\r\n  header h1{margin:0 0 6px;font-size:24px}\r\n  header p{margin:0;color:var(--muted);font-size:13px}\r\n  main{max-width:960px;margin:18px auto 50px;padding:0 14px;display:grid;grid-template-columns:1fr 1fr;gap:16px}\r\n  @media(max-width:900px){main{grid-template-columns:1fr}}\r\n  .card{\r\n    background:linear-gradient(180deg,rgba(255,255,255,.02),rgba(255,255,255,0));\r\n    border:1px solid var(--line);\r\n    border-radius:14px;\r\n    padding:14px;\r\n    box-shadow:0 10px 30px rgba(0,0,0,.25)\r\n  }\r\n  .card h2{margin:2px 0 12px;font-size:15px;color:var(--text);text-transform:uppercase;letter-spacing:.5px}\r\n  .grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}\r\n  @media(max-width:560px){.grid{grid-template-columns:1fr}}\r\n  label{display:block;font-size:12px;color:var(--muted);margin:6px 0 4px}\r\n  input, select{\r\n    width:100%;\r\n    padding:10px 12px;\r\n    border-radius:10px;\r\n    border:1px solid var(--line);\r\n    background:#0b1411;\r\n    color:var(--text);\r\n    font-size:14px\r\n  }\r\n  select{cursor:pointer}\r\n  input:focus, select:focus{\r\n    border-color:var(--accent);\r\n    box-shadow:0 0 0 3px rgba(13,132,97,.28);\r\n    outline:0\r\n  }\r\n  .metric{\r\n    border:1px dashed var(--line);\r\n    border-radius:12px;\r\n    padding:12px;\r\n    background:rgba(13,132,97,.07);\r\n    margin-bottom:8px\r\n  }\r\n  .metric h3{margin:0 0 4px;font-size:12px;color:var(--muted)}\r\n  .val{font-size:22px;font-weight:700}\r\n  .mono{font-variant-numeric:tabular-nums;font-family:ui-monospace,Menlo,Consolas,monospace}\r\n  .good{color:var(--good)}\r\n  .warn{color:var(--warn)}\r\n  .bad{color:var(--bad)}\r\n  .note{font-size:12px;color:var(--muted)}\r\n  .row{display:grid;grid-template-columns:1fr 1fr;gap:10px}\r\n  .hr{height:1px;background:var(--line);margin:10px 0;border-radius:1px}\r\n  .kicker{font-size:12px;color:var(--muted)}\r\n  .btn{\r\n    border:1px solid var(--line);\r\n    background:#0f201a;\r\n    color:var(--text);\r\n    padding:8px 12px;\r\n    border-radius:10px;\r\n    cursor:pointer;\r\n    font-weight:600\r\n  }\r\n  .btn:hover{border-color:var(--accent)}\r\n  .pill{\r\n    display:inline-block;\r\n    border:1px solid var(--line);\r\n    padding:3px 8px;\r\n    border-radius:999px;\r\n    font-size:11px;\r\n    color:var(--muted)\r\n  }\r\n  .grid > div{\r\n    display:flex;\r\n    flex-direction:column;\r\n    gap:6px;\r\n  }\r\n  label{margin-left:4px;}\r\n  .instrument-select{\r\n    grid-column: 1 \/ -1;\r\n    margin-bottom:8px;\r\n  }\r\n  .info-box{\r\n    background:rgba(13,132,97,.1);\r\n    border:1px solid var(--accent);\r\n    border-radius:10px;\r\n    padding:10px;\r\n    margin-bottom:12px;\r\n    font-size:12px;\r\n  }\r\n<\/style>\r\n<\/head>\r\n<body>\r\n<header>\r\n  <h1>Multi-Instrument Poz\u00edci\u00f3meret Kalkul\u00e1tor<\/h1>\r\n  <p>Futures & Forex keresked\u00e9shez - Stop & Take Profit pontban \u00e9s tickben<\/p>\r\n<\/header>\r\n\r\n<main>\r\n  <!-- Bemenetek -->\r\n  <section class=\"card\">\r\n    <h2>Bemenetek<\/h2>\r\n    \r\n    <div class=\"instrument-select\">\r\n      <label>V\u00e1lassz instrumentumot<\/label>\r\n      <select id=\"instrument\">\r\n        <optgroup label=\"Equity Index Futures\">\r\n          <option value=\"ES\">ES - E-mini S&P 500<\/option>\r\n          <option value=\"MES\">MES - Micro E-mini S&P 500<\/option>\r\n          <option value=\"NQ\">NQ - E-mini Nasdaq-100<\/option>\r\n          <option value=\"MNQ\" selected>MNQ - Micro E-mini Nasdaq-100<\/option>\r\n          <option value=\"RTY\">RTY - E-mini Russell 2000<\/option>\r\n          <option value=\"M2K\">M2K - Micro E-mini Russell 2000<\/option>\r\n          <option value=\"YM\">YM - E-mini Dow ($5)<\/option>\r\n          <option value=\"MYM\">MYM - Micro E-mini Dow<\/option>\r\n        <\/optgroup>\r\n        <optgroup label=\"Treasury Futures\">\r\n          <option value=\"ZN\">ZN - 10-Year T-Note<\/option>\r\n          <option value=\"ZB\">ZB - 30-Year T-Bond<\/option>\r\n          <option value=\"ZF\">ZF - 5-Year T-Note<\/option>\r\n          <option value=\"ZT\">ZT - 2-Year T-Note<\/option>\r\n        <\/optgroup>\r\n        <optgroup label=\"Energy Futures\">\r\n          <option value=\"CL\">CL - Crude Oil<\/option>\r\n          <option value=\"MCL\">MCL - Micro Crude Oil<\/option>\r\n          <option value=\"NG\">NG - Natural Gas<\/option>\r\n          <option value=\"RB\">RB - RBOB Gasoline<\/option>\r\n          <option value=\"HO\">HO - Heating Oil<\/option>\r\n        <\/optgroup>\r\n        <optgroup label=\"Metal Futures\">\r\n          <option value=\"GC\">GC - Gold<\/option>\r\n          <option value=\"MGC\">MGC - Micro Gold<\/option>\r\n          <option value=\"SI\">SI - Silver<\/option>\r\n          <option value=\"SIL\">SIL - Micro Silver<\/option>\r\n          <option value=\"HG\">HG - Copper<\/option>\r\n          <option value=\"QO\">QO - Micro Gold (alt)<\/option>\r\n        <\/optgroup>\r\n        <optgroup label=\"Currency Futures\">\r\n          <option value=\"6E\">6E - Euro FX<\/option>\r\n          <option value=\"M6E\">M6E - Micro Euro FX<\/option>\r\n          <option value=\"6B\">6B - British Pound<\/option>\r\n          <option value=\"M6B\">M6B - Micro British Pound<\/option>\r\n          <option value=\"6A\">6A - Australian Dollar<\/option>\r\n          <option value=\"6C\">6C - Canadian Dollar<\/option>\r\n          <option value=\"6J\">6J - Japanese Yen<\/option>\r\n          <option value=\"6S\">6S - Swiss Franc<\/option>\r\n        <\/optgroup>\r\n        <optgroup label=\"Forex (Lot alap\u00fa)\">\r\n          <option value=\"EURUSD\">EUR\/USD<\/option>\r\n          <option value=\"GBPUSD\">GBP\/USD<\/option>\r\n          <option value=\"USDJPY\">USD\/JPY<\/option>\r\n          <option value=\"USDCHF\">USD\/CHF<\/option>\r\n          <option value=\"AUDUSD\">AUD\/USD<\/option>\r\n          <option value=\"USDCAD\">USD\/CAD<\/option>\r\n          <option value=\"NZDUSD\">NZD\/USD<\/option>\r\n        <\/optgroup>\r\n      <\/select>\r\n    <\/div>\r\n\r\n    <div class=\"info-box\" id=\"instrumentInfo\">\r\n      <strong id=\"instrName\">MNQ<\/strong>: <span id=\"instrDetails\">Tick = 0.25 pont, Tick \u00e9rt\u00e9k = $0.50<\/span>\r\n    <\/div>\r\n\r\n    <div class=\"grid\">\r\n      <div>\r\n        <label>K\u00edv\u00e1nt kock\u00e1zat \/ trade (USD)<\/label>\r\n        <input id=\"riskUsd\" type=\"number\" value=\"250\" min=\"1\" step=\"1\">\r\n      <\/div>\r\n      <div>\r\n        <label>Max napi vesztes\u00e9g (USD) <span class=\"kicker\">(opcion\u00e1lis)<\/span><\/label>\r\n        <input id=\"maxDaily\" type=\"number\" value=\"500\" min=\"0\" step=\"1\">\r\n      <\/div>\r\n\r\n      <div>\r\n        <label>Stop (pont)<\/label>\r\n        <input id=\"stopPts\" type=\"number\" value=\"25\" min=\"0.01\" step=\"0.01\">\r\n      <\/div>\r\n      <div>\r\n        <label>Stop (tick)<\/label>\r\n        <input id=\"stopTicks\" type=\"number\" value=\"100\" min=\"1\" step=\"1\">\r\n      <\/div>\r\n\r\n      <div>\r\n        <label>Take profit (pont)<\/label>\r\n        <input id=\"tpPts\" type=\"number\" value=\"40\" min=\"0.01\" step=\"0.01\">\r\n      <\/div>\r\n      <div>\r\n        <label>Take profit (tick)<\/label>\r\n        <input id=\"tpTicks\" type=\"number\" value=\"160\" min=\"1\" step=\"1\">\r\n      <\/div>\r\n    <\/div>\r\n  <\/section>\r\n\r\n  <!-- Eredm\u00e9nyek -->\r\n  <section class=\"card\">\r\n    <h2>Eredm\u00e9nyek<\/h2>\r\n\r\n    <div class=\"row\">\r\n      <div class=\"metric\">\r\n        <h3>USD\/pont \/ kontraktus<\/h3>\r\n        <div id=\"usdPerPoint\" class=\"val mono\">\u2014<\/div>\r\n        <div class=\"kicker\">USD\/tick: <span id=\"usdPerTick\" class=\"pill\">\u2014<\/span><\/div>\r\n      <\/div>\r\n      <div class=\"metric\">\r\n        <h3>RR ar\u00e1ny (TP \/ Stop)<\/h3>\r\n        <div id=\"rrOut\" class=\"val mono\">\u2014<\/div>\r\n        <div class=\"kicker\">Pontban \u00e9s tickben azonos ar\u00e1ny<\/div>\r\n      <\/div>\r\n    <\/div>\r\n\r\n    <div class=\"row\">\r\n      <div class=\"metric\">\r\n        <h3>Kock\u00e1zat 1 kontraktuson<\/h3>\r\n        <div id=\"riskPerContract\" class=\"val mono\">\u2014<\/div>\r\n        <div id=\"riskPerContractSub\" class=\"kicker\"><\/div>\r\n      <\/div>\r\n      <div class=\"metric\">\r\n        <h3>Sz\u00fcks\u00e9ges kontraktussz\u00e1m<\/h3>\r\n        <div id=\"contracts\" class=\"val mono\">\u2014<\/div>\r\n        <div id=\"contractsHint\" class=\"kicker\"><\/div>\r\n      <\/div>\r\n    <\/div>\r\n\r\n    <div class=\"row\">\r\n      <div class=\"metric\">\r\n        <h3>Val\u00f3s risk (kerek\u00edtett kontraktussal)<\/h3>\r\n        <div id=\"actualRisk\" class=\"val mono\">\u2014<\/div>\r\n        <div id=\"actualRiskDiff\" class=\"kicker\"><\/div>\r\n      <\/div>\r\n      <div class=\"metric\">\r\n        <h3>Profitc\u00e9l (TP alapj\u00e1n)<\/h3>\r\n        <div id=\"tpUsdTotal\" class=\"val mono\">\u2014<\/div>\r\n        <div id=\"tpPerContract\" class=\"kicker\"><\/div>\r\n      <\/div>\r\n    <\/div>\r\n\r\n    <div class=\"metric\">\r\n      <h3>Biztons\u00e1gi inf\u00f3<\/h3>\r\n      <div id=\"safety\" class=\"val mono\">\u2014<\/div>\r\n      <div class=\"kicker\">A sz\u00e1m\u00edt\u00e1shoz a stopot \u00e9s TP-t a legk\u00f6zelebbi <strong>eg\u00e9sz tickre<\/strong> kerek\u00edtj\u00fck.<\/div>\r\n    <\/div>\r\n\r\n    <div class=\"note\">\r\n      K\u00e9pletek: USD\/pont = TickValue \u00f7 TickSize. Risk\/kontraktus = Stop(tick) \u00d7 USD\/tick.  \r\n      Kontraktus = K\u00edv\u00e1ntRisk \u00f7 Risk\/kontraktus \u2192 lefel\u00e9 kerek\u00edtj\u00fck, hogy ne l\u00e9pd t\u00fal a megadott risket.\r\n    <\/div>\r\n  <\/section>\r\n<\/main>\r\n\r\n<script>\r\n(function(){\r\n  const $ = id => document.getElementById(id);\r\n  const fmt = (n,d=2)=> Number(n).toLocaleString('hu-HU',{minimumFractionDigits:d,maximumFractionDigits:d});\r\n\r\n  const instruments = {\r\n    \/\/ Equity Index Futures\r\n    ES: {name:'ES - E-mini S&P 500', tick:0.25, value:12.50, desc:'Tick = 0.25 pont, Tick \u00e9rt\u00e9k = $12.50'},\r\n    MES: {name:'MES - Micro E-mini S&P 500', tick:0.25, value:1.25, desc:'Tick = 0.25 pont, Tick \u00e9rt\u00e9k = $1.25'},\r\n    NQ: {name:'NQ - E-mini Nasdaq-100', tick:0.25, value:5.00, desc:'Tick = 0.25 pont, Tick \u00e9rt\u00e9k = $5.00'},\r\n    MNQ: {name:'MNQ - Micro E-mini Nasdaq-100', tick:0.25, value:0.50, desc:'Tick = 0.25 pont, Tick \u00e9rt\u00e9k = $0.50'},\r\n    RTY: {name:'RTY - E-mini Russell 2000', tick:0.10, value:5.00, desc:'Tick = 0.10 pont, Tick \u00e9rt\u00e9k = $5.00'},\r\n    M2K: {name:'M2K - Micro E-mini Russell 2000', tick:0.10, value:0.50, desc:'Tick = 0.10 pont, Tick \u00e9rt\u00e9k = $0.50'},\r\n    YM: {name:'YM - E-mini Dow ($5)', tick:1.00, value:5.00, desc:'Tick = 1.00 pont, Tick \u00e9rt\u00e9k = $5.00'},\r\n    MYM: {name:'MYM - Micro E-mini Dow', tick:1.00, value:0.50, desc:'Tick = 1.00 pont, Tick \u00e9rt\u00e9k = $0.50'},\r\n    \r\n    \/\/ Treasury Futures\r\n    ZN: {name:'ZN - 10-Year T-Note', tick:0.015625, value:15.625, desc:'Tick = 1\/64 (0.015625), Tick \u00e9rt\u00e9k = $15.625'},\r\n    ZB: {name:'ZB - 30-Year T-Bond', tick:0.03125, value:31.25, desc:'Tick = 1\/32 (0.03125), Tick \u00e9rt\u00e9k = $31.25'},\r\n    ZF: {name:'ZF - 5-Year T-Note', tick:0.0078125, value:7.8125, desc:'Tick = 1\/128 (0.0078125), Tick \u00e9rt\u00e9k = $7.8125'},\r\n    ZT: {name:'ZT - 2-Year T-Note', tick:0.00390625, value:7.8125, desc:'Tick = 1\/256 (0.00390625), Tick \u00e9rt\u00e9k = $7.8125'},\r\n    \r\n    \/\/ Energy Futures\r\n    CL: {name:'CL - Crude Oil', tick:0.01, value:10.00, desc:'Tick = 0.01 pont, Tick \u00e9rt\u00e9k = $10.00'},\r\n    MCL: {name:'MCL - Micro Crude Oil', tick:0.01, value:1.00, desc:'Tick = 0.01 pont, Tick \u00e9rt\u00e9k = $1.00'},\r\n    NG: {name:'NG - Natural Gas', tick:0.001, value:10.00, desc:'Tick = 0.001 pont, Tick \u00e9rt\u00e9k = $10.00'},\r\n    RB: {name:'RB - RBOB Gasoline', tick:0.0001, value:4.20, desc:'Tick = 0.0001 pont, Tick \u00e9rt\u00e9k = $4.20'},\r\n    HO: {name:'HO - Heating Oil', tick:0.0001, value:4.20, desc:'Tick = 0.0001 pont, Tick \u00e9rt\u00e9k = $4.20'},\r\n    \r\n    \/\/ Metal Futures\r\n    GC: {name:'GC - Gold', tick:0.10, value:10.00, desc:'Tick = 0.10 pont, Tick \u00e9rt\u00e9k = $10.00'},\r\n    MGC: {name:'MGC - Micro Gold', tick:0.10, value:1.00, desc:'Tick = 0.10 pont, Tick \u00e9rt\u00e9k = $1.00'},\r\n    SI: {name:'SI - Silver', tick:0.005, value:25.00, desc:'Tick = 0.005 pont, Tick \u00e9rt\u00e9k = $25.00'},\r\n    SIL: {name:'SIL - Micro Silver', tick:0.005, value:2.50, desc:'Tick = 0.005 pont, Tick \u00e9rt\u00e9k = $2.50'},\r\n    HG: {name:'HG - Copper', tick:0.0005, value:12.50, desc:'Tick = 0.0005 pont, Tick \u00e9rt\u00e9k = $12.50'},\r\n    QO: {name:'QO - Micro Gold', tick:0.25, value:2.50, desc:'Tick = 0.25 pont, Tick \u00e9rt\u00e9k = $2.50'},\r\n    \r\n    \/\/ Currency Futures\r\n    '6E': {name:'6E - Euro FX', tick:0.00005, value:6.25, desc:'Tick = 0.00005 pont, Tick \u00e9rt\u00e9k = $6.25'},\r\n    M6E: {name:'M6E - Micro Euro FX', tick:0.00005, value:0.625, desc:'Tick = 0.00005 pont, Tick \u00e9rt\u00e9k = $0.625'},\r\n    '6B': {name:'6B - British Pound', tick:0.0001, value:6.25, desc:'Tick = 0.0001 pont, Tick \u00e9rt\u00e9k = $6.25'},\r\n    M6B: {name:'M6B - Micro British Pound', tick:0.0001, value:0.625, desc:'Tick = 0.0001 pont, Tick \u00e9rt\u00e9k = $0.625'},\r\n    '6A': {name:'6A - Australian Dollar', tick:0.0001, value:10.00, desc:'Tick = 0.0001 pont, Tick \u00e9rt\u00e9k = $10.00'},\r\n    '6C': {name:'6C - Canadian Dollar', tick:0.0001, value:10.00, desc:'Tick = 0.0001 pont, Tick \u00e9rt\u00e9k = $10.00'},\r\n    '6J': {name:'6J - Japanese Yen', tick:0.0000005, value:6.25, desc:'Tick = 0.0000005 pont, Tick \u00e9rt\u00e9k = $6.25'},\r\n    '6S': {name:'6S - Swiss Franc', tick:0.0001, value:12.50, desc:'Tick = 0.0001 pont, Tick \u00e9rt\u00e9k = $12.50'},\r\n    \r\n    \/\/ Forex (pip = 0.0001 for most, 0.01 for JPY pairs)\r\n    EURUSD: {name:'EUR\/USD', tick:0.0001, value:10.00, desc:'1 pip = 0.0001, Standard lot pip \u00e9rt\u00e9k = $10.00'},\r\n    GBPUSD: {name:'GBP\/USD', tick:0.0001, value:10.00, desc:'1 pip = 0.0001, Standard lot pip \u00e9rt\u00e9k = $10.00'},\r\n    USDJPY: {name:'USD\/JPY', tick:0.01, value:10.00, desc:'1 pip = 0.01, Standard lot pip \u00e9rt\u00e9k = $10.00'},\r\n    USDCHF: {name:'USD\/CHF', tick:0.0001, value:10.00, desc:'1 pip = 0.0001, Standard lot pip \u00e9rt\u00e9k = $10.00'},\r\n    AUDUSD: {name:'AUD\/USD', tick:0.0001, value:10.00, desc:'1 pip = 0.0001, Standard lot pip \u00e9rt\u00e9k = $10.00'},\r\n    USDCAD: {name:'USD\/CAD', tick:0.0001, value:10.00, desc:'1 pip = 0.0001, Standard lot pip \u00e9rt\u00e9k = $10.00'},\r\n    NZDUSD: {name:'NZD\/USD', tick:0.0001, value:10.00, desc:'1 pip = 0.0001, Standard lot pip \u00e9rt\u00e9k = $10.00'}\r\n  };\r\n\r\n  let syncing = false;\r\n\r\n  function loadInstrument(){\r\n    const code = $('instrument').value;\r\n    const instr = instruments[code];\r\n    if(!instr) return;\r\n    \r\n    $('instrName').textContent = instr.name;\r\n    $('instrDetails').textContent = instr.desc;\r\n    \r\n    syncing = true;\r\n    snapFromPts('stop');\r\n    snapFromPts('tp');\r\n    syncing = false;\r\n    calc();\r\n  }\r\n\r\n  function getTickSize(){\r\n    const code = $('instrument').value;\r\n    return instruments[code]?.tick || 0.25;\r\n  }\r\n\r\n  function getTickValue(){\r\n    const code = $('instrument').value;\r\n    return instruments[code]?.value || 0.50;\r\n  }\r\n\r\n  function snapFromPts(which){\r\n    if(syncing) return; syncing = true;\r\n    const ts = getTickSize();\r\n    if(which==='stop'){\r\n      const pts = +$('stopPts').value;\r\n      const ticks = Math.max(1, Math.round(pts\/ts));\r\n      $('stopTicks').value = ticks;\r\n      $('stopPts').value = (ticks*ts).toFixed(8);\r\n    }else if(which==='tp'){\r\n      const pts = +$('tpPts').value;\r\n      const ticks = Math.max(1, Math.round(pts\/ts));\r\n      $('tpTicks').value = ticks;\r\n      $('tpPts').value = (ticks*ts).toFixed(8);\r\n    }\r\n    syncing = false;\r\n  }\r\n\r\n  function syncFromTicks(which){\r\n    if(syncing) return; syncing = true;\r\n    const ts = getTickSize();\r\n    if(which==='stop'){\r\n      const ticks = +$('stopTicks').value;\r\n      $('stopPts').value = (ticks*ts).toFixed(8);\r\n    }else if(which==='tp'){\r\n      const ticks = +$('tpTicks').value;\r\n      $('tpPts').value = (ticks*ts).toFixed(8);\r\n    }\r\n    syncing = false;\r\n  }\r\n\r\n  function calc(){\r\n    const riskUsd   = +$('riskUsd').value;\r\n    const maxDaily  = +$('maxDaily').value || 0;\r\n    const tickSize  = getTickSize();\r\n    const tickValue = getTickValue();\r\n\r\n    const stopTicks = Math.max(1, Math.round(+$('stopTicks').value));\r\n    const tpTicks   = Math.max(1, Math.round(+$('tpTicks').value));\r\n\r\n    const usdPerTick  = tickValue;\r\n    const usdPerPoint = tickValue \/ tickSize;\r\n\r\n    const riskPerContract = stopTicks * usdPerTick;\r\n    const rawContracts = riskUsd \/ Math.max(1e-9, riskPerContract);\r\n    const contracts = Math.max(0, Math.floor(rawContracts));\r\n    const actualRisk = contracts * riskPerContract;\r\n    const diff = riskUsd - actualRisk;\r\n\r\n    const tpPerContractUsd = tpTicks * usdPerTick;\r\n    const tpUsdTotal = tpPerContractUsd * contracts;\r\n\r\n    const rr = tpTicks \/ stopTicks;\r\n\r\n    let safetyText = 'Param\u00e9terek rendben.', safetyClass = 'good';\r\n    if (!isFinite(usdPerPoint) || usdPerPoint<=0 || stopTicks<=0 || riskUsd<=0) {\r\n      safetyText = 'Hi\u00e1nyos vagy hib\u00e1s bemenet.'; safetyClass = 'bad';\r\n    } else if (contracts < 1) {\r\n      safetyText = 'A k\u00edv\u00e1nt risk t\u00fal kicsi 1 kontraktushoz (vagy t\u00fal nagy a stop).'; safetyClass = 'warn';\r\n    } else if (maxDaily>0 && actualRisk>maxDaily){\r\n      safetyText = 'A kerek\u00edtett risk meghaladja a max napi vesztes\u00e9get.'; safetyClass = 'bad';\r\n    }\r\n\r\n    $('usdPerPoint').textContent = isFinite(usdPerPoint) ? fmt(usdPerPoint,2)+' USD\/pont' : '\u2014';\r\n    $('usdPerTick').textContent  = isFinite(usdPerTick)  ? fmt(usdPerTick,2)+' USD\/tick'  : '\u2014';\r\n\r\n    $('rrOut').textContent = isFinite(rr) ? fmt(rr,2) + ' RR' : '\u2014';\r\n\r\n    $('riskPerContract').textContent = isFinite(riskPerContract) ? fmt(riskPerContract,2)+' USD' : '\u2014';\r\n    $('riskPerContractSub').textContent = `${stopTicks} tick \u00d7 ${fmt(usdPerTick,2)} USD\/tick`;\r\n\r\n    $('contracts').textContent = isFinite(contracts) ? contracts+' kontraktus' : '\u2014';\r\n    $('contractsHint').textContent = `Nyers eredm\u00e9ny: ${fmt(rawContracts,2)} \u2192 lefel\u00e9 kerek\u00edtve.`;\r\n\r\n    $('actualRisk').textContent = isFinite(actualRisk) ? fmt(actualRisk,2)+' USD' : '\u2014';\r\n    $('actualRiskDiff').textContent = `K\u00fcl\u00f6nbs\u00e9g a c\u00e9lhoz k\u00e9pest: ${fmt(diff,2)} USD`;\r\n\r\n    $('tpUsdTotal').textContent = isFinite(tpUsdTotal) ? fmt(tpUsdTotal,2)+' USD' : '\u2014';\r\n    $('tpPerContract').textContent = `TP\/kontraktus: ${tpTicks} tick = ${fmt(tpPerContractUsd,2)} USD`;\r\n\r\n    const s = $('safety'); s.textContent = safetyText; s.className = 'val mono ' + (safetyClass==='good'?'good':(safetyClass==='warn'?'warn':'bad'));\r\n  }\r\n\r\n  $('instrument').addEventListener('change', loadInstrument);\r\n\r\n  ['stopPts','tpPts'].forEach(id=>{\r\n    $(id).addEventListener('input', ()=>{\r\n      if(id==='stopPts') snapFromPts('stop');\r\n      if(id==='tpPts')   snapFromPts('tp');\r\n      calc();\r\n    });\r\n    $(id).addEventListener('change', ()=>{\r\n      if(id==='stopPts') snapFromPts('stop');\r\n      if(id==='tpPts')   snapFromPts('tp');\r\n      calc();\r\n    });\r\n  });\r\n  ['stopTicks','tpTicks'].forEach(id=>{\r\n    $(id).addEventListener('input', ()=>{\r\n      if(id==='stopTicks') syncFromTicks('stop');\r\n      if(id==='tpTicks')   syncFromTicks('tp');\r\n      calc();\r\n    });\r\n    $(id).addEventListener('change', ()=>{\r\n      if(id==='stopTicks') syncFromTicks('stop');\r\n      if(id==='tpTicks')   syncFromTicks('tp');\r\n      calc();\r\n    });\r\n  });\r\n  ['riskUsd','maxDaily'].forEach(id=>{\r\n    $(id).addEventListener('input', calc);\r\n    $(id).addEventListener('change', calc);\r\n  });\r\n\r\n  loadInstrument();\r\n})();\r\n<\/script>\r\n<\/body>\r\n<\/html>"},"elements":[],"widgetType":"html"}],"isInner":false}]