17_STRATEGII/06_hammer_mbt10: toate cele 9 restante, plus cele 3 cosmetice
Cea mai grava, si cea care a cerut refacerea seriei: exemplul central de MBT-10 era luat de pe 60 de minute si bagat in procedura de daily, cu barele numite "zile", desi sursa spune explicit de ce nu merge pe daily. Pe langa asta, suportul fusese schimbat din 88.00 (testat de trei ori, cu compresie, cum e in sursa) in 87.50 cu un double bottom si o divergenta de volum imprumutate din alt exemplu. Seria e refacuta pe exemplul materialului, cu assert pe cele trei atingeri ale lui 88.00 si pe compresia varfurilor. Adaosurile au fost scoase, nu doar marcate: cu ele in desen, suportul din sursa n-ar fi avut sens. Aritmetica a supravietuit neatinsa. Restul: stopul de 60.40 sta acum sub o structura reala; pivotul daily nu mai e o linie fixa peste tot graficul, ci un segment peste ziua intrarii; SL-ul de pe LABU respecta regula proprie de 5 centi; citatul de la A2 nu mai e dat ca al autorului; pragul de 1-2% isi spune originea (cursul da 0,5%, pe 60 min); o singura conventie de distanta, impartirea la nivel; swing low definit la fel in pas si in glosar. eticheta_libera a prins 7 suprapuneri reale. La bh_aplus a trebuit rulat pe fiecare panou separat: wrapper-ul le muta cu <g transform>, pe care unealta nu-l citeste - de notat pentru data viitoare. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ThN7ixZrowca8aTGrK1MUJ
@@ -11,7 +11,8 @@ Același pattern ca formă (downtrend → hammer → confirmare), context opus:
|
||||
peste media ultimelor 10 bare — „acumulare";
|
||||
- dreapta (NU): fără downtrend real (range lateral 44–46), hammer-ul în
|
||||
mijlocul intervalului (o=45.00, c=h=45.10, l=44.10), departe de orice
|
||||
nivel (suportul construit 42.50 e la 3,6 % sub low), confirmarea închide
|
||||
nivel (suportul construit 42.50 e la 3,8 % sub nivel, cu aceeași convenție
|
||||
de măsurare ca la pasul A2: diferența împărțită la nivel), confirmarea închide
|
||||
tot 45.15 peste 45.10, dar pe volum slab — context invalid.
|
||||
|
||||
Nivelurile 42.00 / 42.50 și cifrele de preț sunt construite (materialul nu
|
||||
@@ -34,6 +35,8 @@ import sys
|
||||
from pathlib import Path
|
||||
|
||||
sys.path.insert(0, "/workspace/atm-curs-dl")
|
||||
sys.path.insert(0, "/workspace/atm-curs-dl/gen")
|
||||
from eticheta_libera import eticheta_libera # noqa: E402
|
||||
from svg_candles import Chart, Level, Mark, from_closes # noqa: E402
|
||||
|
||||
OUT = Path(__file__).resolve().parent / "hammer_mbt10_bh_aplus.svg"
|
||||
@@ -115,9 +118,16 @@ assert cds_a[HAM_A].c < cds_a[0].c - 5, "downtrendul A+ nu e vizibil"
|
||||
# 5. NU: (low[12] - 42.50) / 42.50 > 0.02 (hammer-ul NU e departe de nivel)
|
||||
dist_n = (ham_n.l - SUPORT_N) / SUPORT_N
|
||||
assert dist_n > 0.02, f"low hammer NU {ham_n.l} prea aproape de 42.50 ({dist_n:.1%})"
|
||||
# eticheta „la -3,6 %" din spec: (44.10 - 42.50) / 44.10
|
||||
pct_n = (ham_n.l - SUPORT_N) / ham_n.l * 100
|
||||
assert round(pct_n, 1) == 3.6, f"procentul NU e {pct_n:.2f} %, nu 3,6 %"
|
||||
# „cât de departe e nivelul" se măsoară la fel în tot capitolul: diferența
|
||||
# împărțită la NIVEL, nu la low-ul hammer-ului (pasul A2 face așa, iar
|
||||
# eticheta de aici împărțea la low și dădea alt număr — 3,6 % în loc de 3,8 %)
|
||||
pct_n = (ham_n.l - SUPORT_N) / SUPORT_N * 100
|
||||
assert round(pct_n, 1) == 3.8, f"procentul NU e {pct_n:.2f} %, nu 3,8 %"
|
||||
# aceeași convenție pe panoul A+: 0,24 % = (42.00 - 41.90) / 42.00
|
||||
assert round(abs(ham_a.l - SUPORT_A) / SUPORT_A * 100, 2) == 0.24
|
||||
ET_NIVEL_N = ("fără nivel apropiat (suport 42.50 la −"
|
||||
+ f"{pct_n:.1f}".replace(".", ",") + " %)")
|
||||
|
||||
# 6. NU: close[13] > high[12] (tehnic valid)
|
||||
assert conf_n.c > ham_n.h, f"NU close {conf_n.c} <= high hammer {ham_n.h}"
|
||||
assert abs(conf_n.c - 45.15) < 1e-9
|
||||
@@ -160,7 +170,7 @@ ch_a = Chart(
|
||||
)
|
||||
ch_n = Chart(
|
||||
candles=cds_n,
|
||||
levels=[Level(SUPORT_N, "fără nivel apropiat (suport 42.50 la −3,6 %)", GRAY,
|
||||
levels=[Level(SUPORT_N, ET_NIVEL_N, GRAY,
|
||||
label_at="left")],
|
||||
marks=[Mark(HAM_N, "hammer în mijloc de range", ORANGE, "below", dy=0),
|
||||
Mark(CONF_N, "volum slab", RED, "above", dy=0)],
|
||||
@@ -188,6 +198,16 @@ svg_a, svg_n = ch_a.render(), ch_n.render()
|
||||
|
||||
HA, HN = vb_height(svg_a), vb_height(svg_n)
|
||||
assert svg_a.count("\n\n") == 0 and svg_n.count("\n\n") == 0, "linie goală în panou"
|
||||
# pe fiecare panou separat: wrapper-ul le mută cu <g transform>, iar
|
||||
# `eticheta_libera` citește coordonate brute, deci nu merge pe el.
|
||||
# Etichetele de nivel stau lipite de linia lor prin construcție (segmente=False);
|
||||
# ce nu au voie e să cadă peste candele sau peste barele de volum.
|
||||
eticheta_libera(svg_a, "bh_aplus/A+",
|
||||
{"suport monthly 42.00", "hammer la nivel (low 41.90)", "acumulare"},
|
||||
rects=True, segmente=False)
|
||||
eticheta_libera(svg_n, "bh_aplus/NU",
|
||||
{ET_NIVEL_N, "hammer în mijloc de range", "volum slab"},
|
||||
rects=True, segmente=False)
|
||||
|
||||
TOTAL_W = PAD + PW + PANEL_GAP + PW + PAD
|
||||
TOTAL_H = PAD + TITLE_H + max(HA, HN) + FOOTER_H + PAD
|
||||
@@ -269,7 +289,7 @@ for i in range(len(all_txt)):
|
||||
|
||||
# etichetele cerute de spec există în desen
|
||||
for cheie in ("suport monthly 42.00", "hammer la nivel", "acumulare",
|
||||
"fără nivel apropiat (suport 42.50 la −3,6 %)", "volum slab",
|
||||
ET_NIVEL_N, "volum slab",
|
||||
"A+ — hammer la suport monthly",
|
||||
"Mediocru — hammer fără nivel"):
|
||||
assert cheie in wrapper, f"lipsește din desen: {cheie!r}"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<svg viewBox="0 0 900 501" width="900" height="501" xmlns="http://www.w3.org/2000/svg" style="width:100%;height:auto;font:12px sans-serif"><text x="450" y="20" fill="#333" text-anchor="middle" style="font-weight:bold">Buy hammer A+ vs. mediocru (două panouri, exemple construite)</text><g transform="translate(8,38)">
|
||||
<text x="24" y="48" fill="#333" style="font-weight:bold">A+ — hammer la suport monthly</text>
|
||||
<line x1="24" y1="286.1" x2="416" y2="286.1" stroke="#188a3e" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="30" y="280.1" fill="#188a3e">suport monthly 42.00</text>
|
||||
<line x1="24.0" y1="286.1" x2="416" y2="286.1" stroke="#188a3e" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="30.0" y="280.1" fill="#188a3e">suport monthly 42.00</text>
|
||||
<line x1="44.0" y1="56.0" x2="44.0" y2="85.9" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="39.5" y="62.5" width="9" height="15.6" fill="#c00"/>
|
||||
<line x1="59.0" y1="71.6" x2="59.0" y2="109.3" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
@@ -69,8 +69,8 @@
|
||||
<text x="24" y="405" fill="#555">bara 13: 42.95 peste 42.90, volum bun.</text>
|
||||
</g><g transform="translate(462,38)">
|
||||
<text x="24" y="48" fill="#333" style="font-weight:bold">Mediocru — hammer fără nivel</text>
|
||||
<line x1="24" y1="153.5" x2="416" y2="153.5" stroke="#777" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="30" y="147.5" fill="#777">fără nivel apropiat (suport 42.50 la −3,6 %)</text>
|
||||
<line x1="24.0" y1="153.5" x2="416" y2="153.5" stroke="#777" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="30.0" y="147.5" fill="#777">fără nivel apropiat (suport 42.50 la −3,8 %)</text>
|
||||
<line x1="44.0" y1="56.0" x2="44.0" y2="80.7" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="39.5" y="62.5" width="9" height="10.4" fill="#188a3e"/>
|
||||
<line x1="59.0" y1="56.0" x2="59.0" y2="88.5" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
|
||||
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
@@ -11,7 +11,8 @@ intrare.
|
||||
REAL din curs (`18_2025-09-23.md:721-726`): că e buy hammer la suportul
|
||||
monthly și că a dat +20 % în jumătate de lună. CONSTRUITE de sumarizator:
|
||||
suportul 80.00, cifrele hammer-ului (80.80/80.90/79.60), intrarea 81.30, SL
|
||||
79.60 și seria de prețuri — materialul nu dă entry, SL sau TP pentru cazul
|
||||
79.55 (low − 5 cenți, regula proprie a capitolului) și seria de prețuri —
|
||||
materialul nu dă entry, SL sau TP pentru cazul
|
||||
ăsta. Legenda din desen spune exact asta.
|
||||
|
||||
Rulare: python3 gen/strategii/hammer_mbt10_bh_labu.py
|
||||
@@ -21,6 +22,8 @@ import sys
|
||||
from pathlib import Path
|
||||
|
||||
sys.path.insert(0, "/workspace/atm-curs-dl")
|
||||
sys.path.insert(0, "/workspace/atm-curs-dl/gen")
|
||||
from eticheta_libera import eticheta_libera # noqa: E402
|
||||
from svg_candles import Chart, Level, MA, Mark, from_closes # noqa: E402
|
||||
|
||||
OUT = Path(__file__).with_suffix(".svg")
|
||||
@@ -28,9 +31,9 @@ OUT = Path(__file__).with_suffix(".svg")
|
||||
# --- nivelurile din specificație (toate CONSTRUITE) ------------------------
|
||||
SUPPORT = 80.00 # suport monthly (construit)
|
||||
HAMMER_H = 80.90 # high-ul hammer-ului = close (H=C)
|
||||
HAMMER_L = 79.60 # low-ul hammer-ului = SL propus
|
||||
HAMMER_L = 79.60 # low-ul hammer-ului
|
||||
ENTRY = 81.30 # intrare = close-ul confirmării, peste 80.90 (construit)
|
||||
SL = 79.60 # SL sub low-ul hammer-ului (construit)
|
||||
SL = 79.55 # low 79.60 − 5 cenți: marja folosită în tot capitolul
|
||||
PEAK = 97.56 # max close de după intrare: 97.56 / 81.30 = +20,0 % (real)
|
||||
|
||||
# --- seria de close-uri din specificație (38 bare, o = close precedent) ----
|
||||
@@ -89,10 +92,14 @@ assert cds[23].c == cds[23].h == HAMMER_H, "close[23] != high[23] == 80.90"
|
||||
assert abs(cds[24].c - ENTRY) < 1e-9, f"close[24]={cds[24].c} != intrare 81.30"
|
||||
assert cds[24].c > cds[23].h == HAMMER_H, "confirmarea nu închide peste 80.90"
|
||||
|
||||
# 4. SL = min(low[22:25]) = low-ul hammer-ului = 79.60
|
||||
# 4. SL = low-ul hammer-ului (cel mai jos din 22:25) minus marja de 5 cenți.
|
||||
# Prețurile LABU sunt construite, deci se aplică regula proprie din capitol
|
||||
# (summaries/17_STRATEGII/06_hammer_mbt10.md, pasul A4): stopul nu stă
|
||||
# exact pe low, ci cu 5 cenți sub el.
|
||||
min_22_25 = min(c.l for c in cds[22:25])
|
||||
assert abs(min_22_25 - SL) < 1e-9, f"min low[22:25]={min_22_25} != SL {SL}"
|
||||
assert abs(SL - cds[23].l) < 1e-9, "SL nu e low-ul hammer-ului"
|
||||
assert abs(min_22_25 - cds[23].l) < 1e-9, f"min low[22:25]={min_22_25} != low[23]"
|
||||
assert abs(SL - (cds[23].l - 0.05)) < 1e-9, f"SL {SL} nu e low 79.60 − 5 cenți"
|
||||
assert SL < min_22_25, "linia stopului trebuie să stea sub toate fitilele"
|
||||
|
||||
# 5. procentul REAL al cursului: +20,0 % de la intrare la vârf
|
||||
peak = max(c.c for c in cds[25:38])
|
||||
@@ -115,7 +122,7 @@ ch = Chart(
|
||||
levels=[
|
||||
Level(SUPPORT, "suport monthly 80.00", "#777",
|
||||
dash="4 3", label_at="left"),
|
||||
Level(SL, "SL sub low-ul hammer-ului 79.60 (construit)", "#c00",
|
||||
Level(SL, "SL 79.55 = low 79.60 − 5 cenți (construit)", "#c00",
|
||||
label_at="right"),
|
||||
Level(ENTRY, "intrare 81.30 (construit)", "#188a3e", label_at="right"),
|
||||
],
|
||||
@@ -140,6 +147,11 @@ cds[2].note = ("Procentul (+20 % în jumătate de lună) și contextul (suport "
|
||||
|
||||
svg = ch.render()
|
||||
assert "\n\n" not in svg and "<svg" in svg, "SVG invalid (linie goală?)"
|
||||
# eticheta de stop stă lipită de linia ei prin construcție: verificăm doar
|
||||
# candelele și media mobilă de sub ea
|
||||
eticheta_libera(svg, "bh_labu",
|
||||
{"SL 79.55 = low 79.60 − 5 cenți (construit)",
|
||||
"hammer 80.90 / 79.60 (construit)"}, rects=True, segmente=False)
|
||||
|
||||
# --- citirea SVG-ului: etichete în panză, fără suprapuneri -----------------
|
||||
TEXT = re.compile(r'<text x="([-\d.]+)" y="([-\d.]+)"([^>]*)>(.*?)</text>', re.S)
|
||||
@@ -171,7 +183,7 @@ assert xs[-1] + ch.body_w / 2 < w, f"ultima candelă iese din panză (x={xs[-1]}
|
||||
assert all(xs[i + 1] - xs[i] == ch.gap for i in range(len(xs) - 1)), "serie cu goluri"
|
||||
|
||||
print(f"LABU: {len(cds)} bare, hammer {cds[23].l:.2f}/{cds[23].h:.2f} pe suport "
|
||||
f"{SUPPORT:.2f}, intrare {entry:.2f}, SL {cds[23].l:.2f}, vârf {peak:.2f}")
|
||||
f"{SUPPORT:.2f}, intrare {entry:.2f}, SL {SL:.2f}, vârf {peak:.2f}")
|
||||
print(f"procent: {peak:.2f} / {entry:.2f} - 1 = +{pct:.1f} % (cifra cursului)")
|
||||
print(f"scris {OUT} ({w}x{H:.0f}); {len(labels)} etichete verificate, fără suprapuneri")
|
||||
OUT.write_text(svg, encoding="utf-8")
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<svg viewBox="0 0 760 391" xmlns="http://www.w3.org/2000/svg" style="width:100%;height:auto;font:12px sans-serif">
|
||||
<text x="24" y="48" fill="#333" style="font-weight:bold">LABU — daily</text>
|
||||
<line x1="24" y1="198.9" x2="746" y2="198.9" stroke="#777" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="30" y="192.9" fill="#777">suport monthly 80.00</text>
|
||||
<line x1="24" y1="202.1" x2="746" y2="202.1" stroke="#c00" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="732" y="196.1" fill="#c00" text-anchor="end">SL sub low-ul hammer-ului 79.60 (construit)</text>
|
||||
<line x1="24" y1="188.5" x2="746" y2="188.5" stroke="#188a3e" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<line x1="24.0" y1="198.9" x2="746" y2="198.9" stroke="#777" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="30.0" y="192.9" fill="#777">suport monthly 80.00</text>
|
||||
<line x1="24.0" y1="202.5" x2="746" y2="202.5" stroke="#c00" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="732" y="196.5" fill="#c00" text-anchor="end">SL 79.55 = low 79.60 − 5 cenți (construit)</text>
|
||||
<line x1="24.0" y1="188.5" x2="746" y2="188.5" stroke="#188a3e" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="732" y="182.5" fill="#188a3e" text-anchor="end">intrare 81.30 (construit)</text>
|
||||
<polyline points="329.0,159.1 344.0,163.9 359.0,167.8 374.0,172.0 389.0,175.4 404.0,178.1 419.0,180.8 434.0,182.6 449.0,183.5 464.0,184.4 479.0,184.3 494.0,183.3 509.0,181.5 524.0,179.4 539.0,176.4 554.0,172.5 569.0,168.2 584.0,162.8 599.0,156.1" fill="none" stroke="#b06000" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="605" y="150" fill="#b06000">SMA-20</text>
|
||||
@@ -84,50 +84,50 @@
|
||||
<rect x="579.5" y="90.9" width="9" height="12.0" fill="#188a3e"/>
|
||||
<line x1="599.0" y1="56.0" x2="599.0" y2="94.1" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="594.5" y="58.4" width="9" height="32.5" fill="#188a3e"/>
|
||||
<line x1="24" y1="298.1" x2="746" y2="298.1" stroke="#888"/>
|
||||
<rect x="39.5" y="256.7" width="9" height="41.4" fill="#c00" opacity="0.55"/>
|
||||
<rect x="54.5" y="258.3" width="9" height="39.8" fill="#c00" opacity="0.55"/>
|
||||
<rect x="69.5" y="260.7" width="9" height="37.4" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="84.5" y="259.1" width="9" height="39.0" fill="#c00" opacity="0.55"/>
|
||||
<rect x="99.5" y="262.3" width="9" height="35.8" fill="#c00" opacity="0.55"/>
|
||||
<rect x="114.5" y="261.5" width="9" height="36.6" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="129.5" y="263.9" width="9" height="34.2" fill="#c00" opacity="0.55"/>
|
||||
<rect x="144.5" y="262.3" width="9" height="35.8" fill="#c00" opacity="0.55"/>
|
||||
<rect x="159.5" y="265.5" width="9" height="32.6" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="174.5" y="263.9" width="9" height="34.2" fill="#c00" opacity="0.55"/>
|
||||
<rect x="189.5" y="263.1" width="9" height="35.0" fill="#c00" opacity="0.55"/>
|
||||
<rect x="204.5" y="260.7" width="9" height="37.4" fill="#c00" opacity="0.55"/>
|
||||
<rect x="219.5" y="264.7" width="9" height="33.4" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="234.5" y="262.3" width="9" height="35.8" fill="#c00" opacity="0.55"/>
|
||||
<rect x="249.5" y="259.9" width="9" height="38.2" fill="#c00" opacity="0.55"/>
|
||||
<rect x="264.5" y="261.5" width="9" height="36.6" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="279.5" y="258.3" width="9" height="39.8" fill="#c00" opacity="0.55"/>
|
||||
<rect x="294.5" y="263.1" width="9" height="35.0" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="309.5" y="263.9" width="9" height="34.2" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="324.5" y="261.5" width="9" height="36.6" fill="#c00" opacity="0.55"/>
|
||||
<rect x="339.5" y="257.5" width="9" height="40.6" fill="#c00" opacity="0.55"/>
|
||||
<rect x="354.5" y="259.1" width="9" height="39.0" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="369.5" y="254.3" width="9" height="43.8" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="384.5" y="228.1" width="9" height="70.0" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="399.5" y="231.3" width="9" height="66.8" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="414.5" y="242.4" width="9" height="55.7" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="429.5" y="248.8" width="9" height="49.3" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="444.5" y="251.9" width="9" height="46.1" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="459.5" y="255.1" width="9" height="43.0" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="474.5" y="256.7" width="9" height="41.4" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="489.5" y="258.3" width="9" height="39.8" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="504.5" y="259.9" width="9" height="38.2" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="519.5" y="261.5" width="9" height="36.6" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="534.5" y="262.3" width="9" height="35.8" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="549.5" y="260.7" width="9" height="37.4" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="564.5" y="254.3" width="9" height="43.8" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="579.5" y="248.8" width="9" height="49.3" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="594.5" y="240.8" width="9" height="57.3" fill="#188a3e" opacity="0.55"/>
|
||||
<text x="24" y="222.1" fill="#555">volum</text>
|
||||
<text x="389.0" y="216.1" fill="#b06000" text-anchor="middle" style="font-weight:bold">hammer 80.90 / 79.60 (construit)</text>
|
||||
<line x1="24" y1="298.5" x2="746" y2="298.5" stroke="#888"/>
|
||||
<rect x="39.5" y="257.1" width="9" height="41.4" fill="#c00" opacity="0.55"/>
|
||||
<rect x="54.5" y="258.7" width="9" height="39.8" fill="#c00" opacity="0.55"/>
|
||||
<rect x="69.5" y="261.1" width="9" height="37.4" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="84.5" y="259.5" width="9" height="39.0" fill="#c00" opacity="0.55"/>
|
||||
<rect x="99.5" y="262.7" width="9" height="35.8" fill="#c00" opacity="0.55"/>
|
||||
<rect x="114.5" y="261.9" width="9" height="36.6" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="129.5" y="264.3" width="9" height="34.2" fill="#c00" opacity="0.55"/>
|
||||
<rect x="144.5" y="262.7" width="9" height="35.8" fill="#c00" opacity="0.55"/>
|
||||
<rect x="159.5" y="265.9" width="9" height="32.6" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="174.5" y="264.3" width="9" height="34.2" fill="#c00" opacity="0.55"/>
|
||||
<rect x="189.5" y="263.5" width="9" height="35.0" fill="#c00" opacity="0.55"/>
|
||||
<rect x="204.5" y="261.1" width="9" height="37.4" fill="#c00" opacity="0.55"/>
|
||||
<rect x="219.5" y="265.1" width="9" height="33.4" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="234.5" y="262.7" width="9" height="35.8" fill="#c00" opacity="0.55"/>
|
||||
<rect x="249.5" y="260.3" width="9" height="38.2" fill="#c00" opacity="0.55"/>
|
||||
<rect x="264.5" y="261.9" width="9" height="36.6" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="279.5" y="258.7" width="9" height="39.8" fill="#c00" opacity="0.55"/>
|
||||
<rect x="294.5" y="263.5" width="9" height="35.0" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="309.5" y="264.3" width="9" height="34.2" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="324.5" y="261.9" width="9" height="36.6" fill="#c00" opacity="0.55"/>
|
||||
<rect x="339.5" y="257.9" width="9" height="40.6" fill="#c00" opacity="0.55"/>
|
||||
<rect x="354.5" y="259.5" width="9" height="39.0" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="369.5" y="254.7" width="9" height="43.8" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="384.5" y="228.5" width="9" height="70.0" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="399.5" y="231.7" width="9" height="66.8" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="414.5" y="242.8" width="9" height="55.7" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="429.5" y="249.2" width="9" height="49.3" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="444.5" y="252.3" width="9" height="46.1" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="459.5" y="255.5" width="9" height="43.0" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="474.5" y="257.1" width="9" height="41.4" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="489.5" y="258.7" width="9" height="39.8" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="504.5" y="260.3" width="9" height="38.2" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="519.5" y="261.9" width="9" height="36.6" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="534.5" y="262.7" width="9" height="35.8" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="549.5" y="261.1" width="9" height="37.4" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="564.5" y="254.7" width="9" height="43.8" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="579.5" y="249.2" width="9" height="49.3" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="594.5" y="241.2" width="9" height="57.3" fill="#188a3e" opacity="0.55"/>
|
||||
<text x="24" y="222.5" fill="#555">volum</text>
|
||||
<text x="389.0" y="216.5" fill="#b06000" text-anchor="middle" style="font-weight:bold">hammer 80.90 / 79.60 (construit)</text>
|
||||
<text x="599.0" y="46.0" fill="#188a3e" text-anchor="middle" style="font-weight:bold">+20 % (cifra cursului): 97.56 / 81.30</text>
|
||||
<text x="24" y="320.1" fill="#c00">bara 23 = hammer: o 80.80, h 80.90, l 79.60, c 80.90 — corp 0.10, fitil jos 1.20 (H=C), pe suportul 80.00</text>
|
||||
<text x="24" y="337.1" fill="#c00">bara 24 = confirmare: close 81.30 — close peste high-ul hammer-ului 80.90 = intrare 81.30 (construit)</text>
|
||||
<text x="24" y="354.1" fill="#188a3e">Procentul (+20 % în jumătate de lună) și contextul (suport monthly) sunt ale cursului;</text>
|
||||
<text x="24" y="320.5" fill="#c00">bara 23 = hammer: o 80.80, h 80.90, l 79.60, c 80.90 — corp 0.10, fitil jos 1.20 (H=C), pe suportul 80.00</text>
|
||||
<text x="24" y="337.5" fill="#c00">bara 24 = confirmare: close 81.30 — close peste high-ul hammer-ului 80.90 = intrare 81.30 (construit)</text>
|
||||
<text x="24" y="354.5" fill="#188a3e">Procentul (+20 % în jumătate de lună) și contextul (suport monthly) sunt ale cursului;</text>
|
||||
<text x="24" y="379" fill="#555">nivelurile de preț sunt construite de sumarizator.</text>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
@@ -3,8 +3,9 @@
|
||||
|
||||
Două panouri alăturate cu ACEEAȘI serie de 12 bare, pe aceeași scară și
|
||||
aceeași axă de preț (candelele stau la aceleași y). Stânga: suport monthly
|
||||
62.00, la 0,16 % sub low-ul hammer-ului. Dreapta: cel mai apropiat nivel de
|
||||
sub el e la 58.00, adică un gol de 7,07 %. Nivelurile se desenează de mână,
|
||||
62.00, la 0,16 % de low-ul hammer-ului (diferența împărțită la nivel, ca în
|
||||
tot capitolul). Dreapta: cel mai apropiat nivel de sub el e la 58.00, adică un
|
||||
gol de 7,07 %. Nivelurile se desenează de mână,
|
||||
cu coordonate absolute (liniile din Chart pornesc de la x=24 și ar trece
|
||||
peste panoul vecin).
|
||||
|
||||
@@ -90,7 +91,7 @@ def zone(px, p_top, p_bot, label, color, label_at_bottom=False):
|
||||
PCT_DA, PCT_NU = f"{d_da:.2f}".replace(".", ","), f"{d_nu:.2f}".replace(".", ",")
|
||||
y_bot = y(SUP_NU)
|
||||
parts = [
|
||||
f'<svg viewBox="0 0 {W} {y_bot + 80:.0f}" xmlns="http://www.w3.org/2000/svg" '
|
||||
f'<svg viewBox="0 0 {W} {y_bot + 96:.0f}" xmlns="http://www.w3.org/2000/svg" '
|
||||
f'style="width:100%;height:auto;font:12px sans-serif">',
|
||||
'<text x="24" y="22" fill="#333" style="font-weight:bold">Hammer la un nivel vs. hammer '
|
||||
'în mijlocul range-ului — daily, exemplu construit</text>',
|
||||
@@ -112,9 +113,11 @@ parts = [
|
||||
f'<text x="24" y="{y_bot + 34:.0f}" fill="{GREY}">Completare proprie: materialul cere '
|
||||
'„un nivel major (weekly / monthly / quarterly), nu mijlocul</text>',
|
||||
f'<text x="24" y="{y_bot + 50:.0f}" fill="{GREY}">range-ului", dar nu dă un prag numeric. '
|
||||
f'Pragul de 1-2 % e împrumutat de la buy doji, ca să ai ce</text>',
|
||||
f'<text x="24" y="{y_bot + 66:.0f}" fill="{GREY}">măsura: aici {PCT_DA} % în stânga, '
|
||||
f'{PCT_NU} % în dreapta.</text>',
|
||||
f'Cursul dă 0,5 %, la buy doji și pe 60 de minute; 1-2 % pe</text>',
|
||||
f'<text x="24" y="{y_bot + 66:.0f}" fill="{GREY}">daily e adaptarea mea, ca să ai ce '
|
||||
f'măsura: aici {PCT_DA} % în stânga, {PCT_NU} % în dreapta.</text>',
|
||||
f'<text x="24" y="{y_bot + 82:.0f}" fill="{GREY}">Distanța se împarte la nivel, nu la '
|
||||
f'low-ul hammer-ului — aceeași convenție în tot capitolul.</text>',
|
||||
"</svg>",
|
||||
]
|
||||
svg = "\n ".join(parts).replace("\n </svg>", "\n</svg>")
|
||||
@@ -122,4 +125,4 @@ assert "\n\n" not in svg, "linie goală în SVG"
|
||||
for m in re.finditer(r'<text x="([\d.]+)"[^>]*>(.*?)</text>', body_da):
|
||||
assert float(m.group(1)) < PX[1] - 14, f"text din DA trece în NU: {m.group(2)}"
|
||||
OUT.write_text(svg, encoding="utf-8")
|
||||
print(f"scris {OUT.name} ({W}x{y_bot + 80:.0f}); DA {d_da}% NU {d_nu}% (rezistență {d_rez}%)")
|
||||
print(f"scris {OUT.name} ({W}x{y_bot + 96:.0f}); DA {d_da}% NU {d_nu}% (rezistență {d_rez}%)")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<svg viewBox="0 0 760 450" xmlns="http://www.w3.org/2000/svg" style="width:100%;height:auto;font:12px sans-serif">
|
||||
<svg viewBox="0 0 760 466" xmlns="http://www.w3.org/2000/svg" style="width:100%;height:auto;font:12px sans-serif">
|
||||
<text x="24" y="22" fill="#333" style="font-weight:bold">Hammer la un nivel vs. hammer în mijlocul range-ului — daily, exemplu construit</text>
|
||||
<text x="24" y="48" fill="#188a3e" style="font-weight:bold">DA — hammer pe suportul monthly</text>
|
||||
<text x="402" y="48" fill="#c00" style="font-weight:bold">NU — hammer în mijlocul range-ului</text>
|
||||
@@ -75,6 +75,7 @@
|
||||
<text x="625.0" y="318.3" fill="#c00" text-anchor="middle" style="font-weight:bold">fitilul n-a fost oprit de un nivel,</text>
|
||||
<text x="625.0" y="332.3" fill="#c00" text-anchor="middle" style="font-weight:bold">ci s-a oprit singur</text>
|
||||
<text x="24" y="404" fill="#555">Completare proprie: materialul cere „un nivel major (weekly / monthly / quarterly), nu mijlocul</text>
|
||||
<text x="24" y="420" fill="#555">range-ului", dar nu dă un prag numeric. Pragul de 1-2 % e împrumutat de la buy doji, ca să ai ce</text>
|
||||
<text x="24" y="436" fill="#555">măsura: aici 0,16 % în stânga, 7,07 % în dreapta.</text>
|
||||
<text x="24" y="420" fill="#555">range-ului", dar nu dă un prag numeric. Cursul dă 0,5 %, la buy doji și pe 60 de minute; 1-2 % pe</text>
|
||||
<text x="24" y="436" fill="#555">daily e adaptarea mea, ca să ai ce măsura: aici 0,16 % în stânga, 7,07 % în dreapta.</text>
|
||||
<text x="24" y="452" fill="#555">Distanța se împarte la nivel, nu la low-ul hammer-ului — aceeași convenție în tot capitolul.</text>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 7.2 KiB |
@@ -1,53 +1,64 @@
|
||||
#!/usr/bin/env python3
|
||||
"""MBT-10, pasul „unde": ideea de bottom cu confluențe (exemplu construit).
|
||||
"""MBT-10, pasul „unde": ideea de bottom, pe exemplul materialului.
|
||||
|
||||
Seria de aici e SURSA UNICĂ a trade-ului MBT-10 din Nivelul 2:
|
||||
`hammer_mbt10_mbt_ppd`, `_mbt_stop` și `_mbt_iesire` importă `serie()` și
|
||||
pornesc din aceleași bare. Nivelurile 89.90 (intrare la close), 87.30 (SL) și
|
||||
95.20 (ținta, vârful de unde a pornit coborârea) sunt cifrele exemplului
|
||||
construit din fișierul principal; suportul weekly 87.50 și pivotul daily
|
||||
89.60 sunt puse de mine, ca acele cifre să aibă de unde ieși.
|
||||
pornesc din aceleași bare.
|
||||
|
||||
Diagrama asta arată doar contextul: double bottom pe suportul weekly, cu
|
||||
volum mai mic pe al doilea picior. Nicio intrare desenată — intrarea vine la
|
||||
pasul următor.
|
||||
Exemplul e al materialului (`08_ANALIZA_ZILNICA/02_mbt10.md:440-455`) și e pe
|
||||
**60 de minute**, nu pe daily: suport weekly **88.00**, testat de **trei ori**,
|
||||
cu vârfuri tot mai mici între teste (compresie); intrare **89.90** la close-ul
|
||||
barei în MBT-10; **SL 87.30** sub suport; **țintă 95.20**, vârful de unde a
|
||||
pornit coborârea. Materialul spune și de ce nu pe daily: „o bară daily în
|
||||
suport weekly poate avea un low cu 2-3 % sub suport, deci stopul ar sta
|
||||
departe".
|
||||
|
||||
Ale mele sunt doar forma exactă a barelor, volumul și pivotul daily 89.60 (pus
|
||||
ca să aibă ce verifica pasul B3). Nu există aici nici double bottom, nici
|
||||
divergență de volum: alea sunt din alt exemplu al materialului (gap up, cu
|
||||
picioarele 32.10 / 30.90) și nu se fuzionează cu ăsta.
|
||||
|
||||
Rulare: python3 gen/strategii/hammer_mbt10_mbt_confluente.py
|
||||
"""
|
||||
import re
|
||||
import sys; sys.path.insert(0, "/workspace/atm-curs-dl")
|
||||
sys.path.insert(0, "/workspace/atm-curs-dl/gen")
|
||||
from pathlib import Path
|
||||
from svg_candles import Arrow, Chart, Level, Zone, from_closes
|
||||
from eticheta_libera import eticheta_libera
|
||||
from svg_candles import Chart, Level, Mark, Zone, from_closes
|
||||
|
||||
OUT = Path(__file__).with_suffix(".svg")
|
||||
GREEN, RED, BLUE, ORANGE, GREY = "#188a3e", "#c00", "#1a5fb4", "#b06000", "#555"
|
||||
|
||||
SUP_W, PPD = 87.50, 89.60 # suport weekly, pivotul daily
|
||||
SUP_W, PPD = 88.00, 89.60 # suport weekly (materialul), pivotul daily (al meu)
|
||||
INTRARE, SL, TP = 89.90, 87.30, 95.20
|
||||
R = round(INTRARE - SL, 2)
|
||||
FUND1, FUND2 = 10, 15 # cele două picioare ale double bottom-ului
|
||||
TESTE = (9, 12, 15) # cele trei atingeri ale suportului weekly
|
||||
VARFURI = (10, 13) # vârfurile dintre teste: tot mai mici (compresie)
|
||||
VARF = 3 # ultimul maxim înainte de coborâre: high 95.20 = ținta
|
||||
CLOSE_I = 19 # bara care se închide peste pivotul daily
|
||||
BARE_PE_ZI = 7 # 60 de minute, sesiune US: 7 bare pe zi
|
||||
ZI_INTRARE = (14, 20) # barele zilei în care vine trigger-ul
|
||||
|
||||
CLOSES = [96.00, 95.00, 94.20, 95.00, 93.10, 92.00, 91.20, 90.10, 89.00, # 0-8
|
||||
88.20, 87.70, 88.40, 89.10, # 9-12
|
||||
88.60, 88.00, 87.65, 88.30, # 13-16
|
||||
88.90, 89.40, 89.90, # 17-19
|
||||
90.60, 91.40, 92.20, 91.80, 93.00, 94.10, 95.40] # 20-26
|
||||
88.20, 89.00, 88.60, # 9-11
|
||||
88.20, 89.00, 88.50, # 12-14
|
||||
88.20, 88.60, 89.00, 89.40, 89.90, # 15-19
|
||||
90.60, 91.40, 92.20, 91.80, 93.00, 94.10, 95.40] # 20-26
|
||||
VOLS = [60, 58, 55, 50, 62, 66, 70, 74, 80,
|
||||
86, 94, 62, 58,
|
||||
55, 60, 66, 54, # piciorul 2: volum vizibil mai mic
|
||||
58, 62, 96,
|
||||
86, 62, 58,
|
||||
84, 60, 56,
|
||||
82, 58, 62, 66, 96,
|
||||
70, 66, 64, 58, 68, 72, 80]
|
||||
|
||||
|
||||
def serie():
|
||||
w = [(0.20, 0.25)] * len(CLOSES)
|
||||
w[FUND1] = (0.20, 0.10) # low 87.60
|
||||
w[FUND2] = (0.20, 0.10) # low 87.55
|
||||
# barele imediat de după picioare pornesc din același preț: fără fitil lung
|
||||
# în jos, altfel ele ar face minimul, nu picioarele
|
||||
w[FUND1 + 1] = w[FUND2 + 1] = (0.20, 0.05)
|
||||
for t in TESTE:
|
||||
w[t] = (0.20, 0.20) # low exact pe 88.00: suportul ține, nu cedează
|
||||
w[t + 1] = (0.20, 0.05) # bara de după pornește din 88.20: fără fitil lung în jos
|
||||
w[VARFURI[0]] = (0.50, 0.05) # high 89.50
|
||||
w[VARFURI[1]] = (0.10, 0.05) # high 89.10 — vârf mai mic
|
||||
# bara 18 atinge pivotul intraday, dar se închide sub el: contraexemplul
|
||||
# de la pasul cu condiția de preț
|
||||
w[CLOSE_I - 1] = (0.30, 0.25)
|
||||
@@ -58,20 +69,30 @@ def serie():
|
||||
assert len(cds) == len(VOLS) == 27
|
||||
for i in range(1, len(cds)):
|
||||
assert abs(cds[i].o - cds[i - 1].c) < 1e-9, f"open[{i}] != close[{i-1}]"
|
||||
l1, l2 = round(cds[FUND1].l, 2), round(cds[FUND2].l, 2)
|
||||
assert (l1, l2) == (87.60, 87.55), (l1, l2)
|
||||
assert abs(l1 - l2) <= 0.05 and l2 < l1, "double bottom: al doilea picior, puțin mai jos"
|
||||
assert round(min(c.l for c in cds), 2) == l2, "cel mai jos low nu e al piciorului 2"
|
||||
assert l2 > SUP_W > SL, "picioarele trebuie să stea peste suport, iar stopul sub el"
|
||||
assert VOLS[FUND2] < VOLS[FUND1], "fără divergență de volum pe piciorul 2"
|
||||
# de la al doilea picior încoace, nicio bară nu închide peste pivotul zilei
|
||||
# suportul weekly e atins de exact trei ori și ține de fiecare dată
|
||||
atingeri = [i for i, c in enumerate(cds) if round(c.l, 2) <= SUP_W]
|
||||
assert atingeri == list(TESTE), atingeri
|
||||
for t in TESTE:
|
||||
assert round(cds[t].l, 2) == SUP_W, (t, cds[t].l)
|
||||
assert SUP_W > SL, "stopul trebuie să stea sub suport"
|
||||
# compresie: vârfurile dintre teste scad
|
||||
v1, v2 = (round(cds[i].h, 2) for i in VARFURI)
|
||||
assert v1 > v2, f"vârfurile dintre teste nu scad: {v1} > {v2}"
|
||||
assert (v1, v2) == (89.50, 89.10), (v1, v2)
|
||||
# de la primul test încoace, nicio bară nu închide peste pivotul zilei
|
||||
# intrării — altfel trigger-ul ar fi venit mai devreme
|
||||
assert max(c.c for c in cds[FUND2:CLOSE_I]) < PPD < cds[CLOSE_I].c, \
|
||||
assert max(c.c for c in cds[TESTE[0]:CLOSE_I]) < PPD < cds[CLOSE_I].c, \
|
||||
"o bară dinaintea trigger-ului închide deja peste pivotul daily"
|
||||
assert round(cds[CLOSE_I].c, 2) == INTRARE
|
||||
assert cds[CLOSE_I - 1].h > PPD > cds[CLOSE_I - 1].c, \
|
||||
"bara 18 trebuie să atingă pivotul intraday, dar să închidă sub el"
|
||||
assert min(c.l for c in cds[CLOSE_I:]) > SL, "stopul ar fi fost atins după intrare"
|
||||
# trigger-ul și contraexemplul lui stau în aceeași zi: pe 60 de minute
|
||||
# pivotul daily e un singur nivel pe toată ziua, dar se schimbă mâine
|
||||
assert ZI_INTRARE[0] <= CLOSE_I - 1 and CLOSE_I <= ZI_INTRARE[1]
|
||||
assert ZI_INTRARE[1] - ZI_INTRARE[0] + 1 == BARE_PE_ZI
|
||||
assert all(i // BARE_PE_ZI == ZI_INTRARE[0] // BARE_PE_ZI
|
||||
for i in range(*ZI_INTRARE)), "ziua intrării nu e un bloc de 7 bare"
|
||||
prim_tp = next(i for i in range(CLOSE_I + 1, len(cds)) if cds[i].h >= TP)
|
||||
assert prim_tp == 26, prim_tp
|
||||
# ținta 95.20 nu e un număr ales: e high-ul ultimului maxim dinaintea coborârii
|
||||
@@ -83,34 +104,32 @@ def serie():
|
||||
|
||||
if __name__ == "__main__":
|
||||
cds = serie()
|
||||
pct1 = round((cds[FUND1].l - SUP_W) / SUP_W * 100, 2)
|
||||
pct2 = round((cds[FUND2].l - SUP_W) / SUP_W * 100, 2)
|
||||
assert pct1 < 0.2 and pct2 < 0.2, (pct1, pct2)
|
||||
vis = cds[:CLOSE_I] # contextul, fără bara de trigger
|
||||
|
||||
ch = Chart(
|
||||
candles=vis,
|
||||
levels=[Level(SUP_W, "suport weekly 87.50", BLUE, label_at="left")],
|
||||
zones=[Zone(FUND1, FUND2, "double bottom: 87.60 și 87.55", ORANGE)],
|
||||
arrows=[
|
||||
Arrow(FUND1, "piciorul 1: low 87.60,\nla 0,11 % peste suport",
|
||||
where="below", color=GREY, dx=-150, dy=26),
|
||||
Arrow(FUND2, "piciorul 2: low 87.55, cu 5 cenți mai jos,\ndar cu volum mai mic decât "
|
||||
"la piciorul 1 —\nvânzarea a slăbit (divergență de volum)",
|
||||
where="below", color=RED, dx=-40, dy=64),
|
||||
],
|
||||
levels=[Level(SUP_W, "suport weekly 88.00", BLUE, label_at="left")],
|
||||
zones=[Zone(TESTE[0], TESTE[-1], "", ORANGE)],
|
||||
marks=[Mark(t, f"test {n}", ORANGE, "above", dy=-34)
|
||||
for n, t in enumerate(TESTE, 1)],
|
||||
scale=30.0, gap=22, body_w=12, left=54, width=700, vol_h=70, vol_label="volum",
|
||||
title="MBT-10, pasul „unde\" — double bottom pe suportul weekly (exemplu construit)",
|
||||
title="MBT-10, pasul „unde\" — suport weekly testat de trei ori, pe 60 de minute",
|
||||
)
|
||||
svg = ch.render()
|
||||
eticheta_libera(svg, "mbt_confluente", {"test 1", "test 2", "test 3"}, rects=True)
|
||||
m = re.search(r'viewBox="0 0 (\d+) (\d+)"', svg)
|
||||
W, H = int(m.group(1)), int(m.group(2))
|
||||
linii = [
|
||||
("Aici nu intri încă: diagrama arată doar ideea de bottom. MBT-10 e ultima piesă, și "
|
||||
"vine abia la close-ul unei bare.", "#333"),
|
||||
("Cifrele 89.90 / 87.30 / 95.20 ale trade-ului sunt din exemplul construit al "
|
||||
"materialului;", GREY),
|
||||
("suportul weekly 87.50, pivotul daily 89.60 și structura barelor sunt ale mele.", GREY),
|
||||
("Suportul 88.00 ține de trei ori, iar între teste vârfurile scad — 89.50, apoi "
|
||||
"89.10: compresie.", "#333"),
|
||||
("Exemplul e al materialului și e pe 60 de minute: suport 88.00, intrare 89.90, "
|
||||
"SL 87.30, țintă 95.20.", GREY),
|
||||
("Nu e double bottom și nu e divergență de volum — alea sunt din alt exemplu al lui "
|
||||
"(gap up, picioarele 32.10 / 30.90).", GREY),
|
||||
("Forma exactă a barelor și volumul sunt ale mele; la fel pivotul daily 89.60, pus ca "
|
||||
"să aibă ce verifica pasul B3.", GREY),
|
||||
]
|
||||
add = 16 * len(linii) + 10
|
||||
svg = svg.replace(f'viewBox="0 0 {W} {H}"', f'viewBox="0 0 {W} {H + add}"')
|
||||
@@ -119,4 +138,4 @@ if __name__ == "__main__":
|
||||
for i, (t, c) in enumerate(linii)) + "</svg>")
|
||||
assert "\n\n" not in svg, "linie goală în SVG"
|
||||
OUT.write_text(svg, encoding="utf-8")
|
||||
print(f"scris {OUT.name} ({W}x{H + add}); picioare {pct1}% / {pct2}% peste suport, R={R}")
|
||||
print(f"scris {OUT.name} ({W}x{H + add}); teste {TESTE} pe {SUP_W}, R={R}")
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<svg viewBox="0 0 700 658" xmlns="http://www.w3.org/2000/svg" style="width:100%;height:auto;font:12px sans-serif">
|
||||
<text x="24" y="48" fill="#333" style="font-weight:bold">MBT-10, pasul „unde" — double bottom pe suportul weekly (exemplu construit)</text>
|
||||
<rect x="263.0" y="273.0" width="132.0" height="68.5" fill="#b06000" fill-opacity="0.08" stroke="#b06000" stroke-width="1"/>
|
||||
<text x="263.0" y="268.0" fill="#b06000" style="font-weight:bold">double bottom: 87.60 și 87.55</text>
|
||||
<line x1="24" y1="335.0" x2="686" y2="335.0" stroke="#1a5fb4" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="30" y="329.0" fill="#1a5fb4">suport weekly 87.50</text>
|
||||
<svg viewBox="0 0 700 546" xmlns="http://www.w3.org/2000/svg" style="width:100%;height:auto;font:12px sans-serif">
|
||||
<text x="24" y="48" fill="#333" style="font-weight:bold">MBT-10, pasul „unde" — suport weekly testat de trei ori, pe 60 de minute</text>
|
||||
<rect x="241.0" y="267.0" width="154.0" height="61.0" fill="#b06000" fill-opacity="0.08" stroke="#b06000" stroke-width="1"/>
|
||||
<line x1="24.0" y1="320.0" x2="686" y2="320.0" stroke="#1a5fb4" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="30.0" y="314.0" fill="#1a5fb4">suport weekly 88.00</text>
|
||||
<line x1="54.0" y1="56.0" x2="54.0" y2="87.5" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="48.0" y="62.0" width="12" height="18.0" fill="#c00"/>
|
||||
<line x1="76.0" y1="74.0" x2="76.0" y2="117.5" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
@@ -22,54 +21,48 @@
|
||||
<rect x="202.0" y="224.0" width="12" height="33.0" fill="#c00"/>
|
||||
<line x1="230.0" y1="251.0" x2="230.0" y2="297.5" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="224.0" y="257.0" width="12" height="33.0" fill="#c00"/>
|
||||
<line x1="252.0" y1="284.0" x2="252.0" y2="321.5" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<line x1="252.0" y1="284.0" x2="252.0" y2="320.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="246.0" y="290.0" width="12" height="24.0" fill="#c00"/>
|
||||
<line x1="274.0" y1="308.0" x2="274.0" y2="332.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="268.0" y="314.0" width="12" height="15.0" fill="#c00"/>
|
||||
<line x1="296.0" y1="302.0" x2="296.0" y2="330.5" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="290.0" y="308.0" width="12" height="21.0" fill="#188a3e"/>
|
||||
<line x1="318.0" y1="281.0" x2="318.0" y2="315.5" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="312.0" y="287.0" width="12" height="21.0" fill="#188a3e"/>
|
||||
<line x1="340.0" y1="281.0" x2="340.0" y2="309.5" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="334.0" y="287.0" width="12" height="15.0" fill="#c00"/>
|
||||
<line x1="362.0" y1="296.0" x2="362.0" y2="327.5" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="356.0" y="302.0" width="12" height="18.0" fill="#c00"/>
|
||||
<line x1="384.0" y1="314.0" x2="384.0" y2="333.5" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="378.0" y="320.0" width="12" height="10.5" fill="#c00"/>
|
||||
<line x1="406.0" y1="305.0" x2="406.0" y2="332.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="400.0" y="311.0" width="12" height="19.5" fill="#188a3e"/>
|
||||
<line x1="428.0" y1="287.0" x2="428.0" y2="318.5" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="422.0" y="293.0" width="12" height="18.0" fill="#188a3e"/>
|
||||
<line x1="450.0" y1="269.0" x2="450.0" y2="300.5" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="444.0" y="278.0" width="12" height="15.0" fill="#188a3e"/>
|
||||
<line x1="24" y1="574.5" x2="686" y2="574.5" stroke="#888"/>
|
||||
<rect x="48.0" y="529.8" width="12" height="44.7" fill="#c00" opacity="0.55"/>
|
||||
<rect x="70.0" y="531.3" width="12" height="43.2" fill="#c00" opacity="0.55"/>
|
||||
<rect x="92.0" y="533.5" width="12" height="41.0" fill="#c00" opacity="0.55"/>
|
||||
<rect x="114.0" y="537.3" width="12" height="37.2" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="136.0" y="528.3" width="12" height="46.2" fill="#c00" opacity="0.55"/>
|
||||
<rect x="158.0" y="525.4" width="12" height="49.1" fill="#c00" opacity="0.55"/>
|
||||
<rect x="180.0" y="522.4" width="12" height="52.1" fill="#c00" opacity="0.55"/>
|
||||
<rect x="202.0" y="519.4" width="12" height="55.1" fill="#c00" opacity="0.55"/>
|
||||
<rect x="224.0" y="514.9" width="12" height="59.6" fill="#c00" opacity="0.55"/>
|
||||
<rect x="246.0" y="510.5" width="12" height="64.0" fill="#c00" opacity="0.55"/>
|
||||
<rect x="268.0" y="504.5" width="12" height="70.0" fill="#c00" opacity="0.55"/>
|
||||
<rect x="290.0" y="528.3" width="12" height="46.2" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="312.0" y="531.3" width="12" height="43.2" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="334.0" y="533.5" width="12" height="41.0" fill="#c00" opacity="0.55"/>
|
||||
<rect x="356.0" y="529.8" width="12" height="44.7" fill="#c00" opacity="0.55"/>
|
||||
<rect x="378.0" y="525.4" width="12" height="49.1" fill="#c00" opacity="0.55"/>
|
||||
<rect x="400.0" y="534.3" width="12" height="40.2" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="422.0" y="531.3" width="12" height="43.2" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="444.0" y="528.3" width="12" height="46.2" fill="#188a3e" opacity="0.55"/>
|
||||
<text x="24" y="498.5" fill="#555">volum</text>
|
||||
<line x1="124.0" y1="388.0" x2="266.4" y2="338.6" stroke="#555" stroke-width="1.8"/>
|
||||
<polygon points="274.0,336.0 267.8,342.4 265.1,334.8" fill="#555"/>
|
||||
<text x="124.0" y="402.0" fill="#555" text-anchor="middle" style="font-weight:bold">piciorul 1: low 87.60,</text>
|
||||
<text x="124.0" y="416.0" fill="#555" text-anchor="middle" style="font-weight:bold">la 0,11 % peste suport</text>
|
||||
<line x1="344.0" y1="427.5" x2="380.8" y2="344.8" stroke="#c00" stroke-width="1.8"/>
|
||||
<polygon points="384.0,337.5 384.4,346.4 377.1,343.2" fill="#c00"/>
|
||||
<text x="344.0" y="441.5" fill="#c00" text-anchor="middle" style="font-weight:bold">piciorul 2: low 87.55, cu 5 cenți mai jos,</text>
|
||||
<text x="344.0" y="455.5" fill="#c00" text-anchor="middle" style="font-weight:bold">dar cu volum mai mic decât la piciorul 1 —</text>
|
||||
<text x="344.0" y="469.5" fill="#c00" text-anchor="middle" style="font-weight:bold">vânzarea a slăbit (divergență de volum)</text>
|
||||
<text x="24" y="610" fill="#333">Aici nu intri încă: diagrama arată doar ideea de bottom. MBT-10 e ultima piesă, și vine abia la close-ul unei bare.</text><text x="24" y="626" fill="#555">Cifrele 89.90 / 87.30 / 95.20 ale trade-ului sunt din exemplul construit al materialului;</text><text x="24" y="642" fill="#555">suportul weekly 87.50, pivotul daily 89.60 și structura barelor sunt ale mele.</text></svg>
|
||||
<line x1="274.0" y1="275.0" x2="274.0" y2="315.5" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="268.0" y="290.0" width="12" height="24.0" fill="#188a3e"/>
|
||||
<line x1="296.0" y1="284.0" x2="296.0" y2="309.5" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="290.0" y="290.0" width="12" height="12.0" fill="#c00"/>
|
||||
<line x1="318.0" y1="296.0" x2="318.0" y2="320.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="312.0" y="302.0" width="12" height="12.0" fill="#c00"/>
|
||||
<line x1="340.0" y1="287.0" x2="340.0" y2="315.5" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="334.0" y="290.0" width="12" height="24.0" fill="#188a3e"/>
|
||||
<line x1="362.0" y1="284.0" x2="362.0" y2="312.5" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="356.0" y="290.0" width="12" height="15.0" fill="#c00"/>
|
||||
<line x1="384.0" y1="299.0" x2="384.0" y2="320.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="378.0" y="305.0" width="12" height="9.0" fill="#c00"/>
|
||||
<line x1="406.0" y1="296.0" x2="406.0" y2="315.5" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="400.0" y="302.0" width="12" height="12.0" fill="#188a3e"/>
|
||||
<line x1="428.0" y1="284.0" x2="428.0" y2="309.5" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="422.0" y="290.0" width="12" height="12.0" fill="#188a3e"/>
|
||||
<line x1="450.0" y1="269.0" x2="450.0" y2="297.5" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="444.0" y="278.0" width="12" height="12.0" fill="#188a3e"/>
|
||||
<line x1="24" y1="430.0" x2="686" y2="430.0" stroke="#888"/>
|
||||
<rect x="48.0" y="381.2" width="12" height="48.8" fill="#c00" opacity="0.55"/>
|
||||
<rect x="70.0" y="382.8" width="12" height="47.2" fill="#c00" opacity="0.55"/>
|
||||
<rect x="92.0" y="385.2" width="12" height="44.8" fill="#c00" opacity="0.55"/>
|
||||
<rect x="114.0" y="389.3" width="12" height="40.7" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="136.0" y="379.5" width="12" height="50.5" fill="#c00" opacity="0.55"/>
|
||||
<rect x="158.0" y="376.3" width="12" height="53.7" fill="#c00" opacity="0.55"/>
|
||||
<rect x="180.0" y="373.0" width="12" height="57.0" fill="#c00" opacity="0.55"/>
|
||||
<rect x="202.0" y="369.8" width="12" height="60.2" fill="#c00" opacity="0.55"/>
|
||||
<rect x="224.0" y="364.9" width="12" height="65.1" fill="#c00" opacity="0.55"/>
|
||||
<rect x="246.0" y="360.0" width="12" height="70.0" fill="#c00" opacity="0.55"/>
|
||||
<rect x="268.0" y="379.5" width="12" height="50.5" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="290.0" y="382.8" width="12" height="47.2" fill="#c00" opacity="0.55"/>
|
||||
<rect x="312.0" y="361.6" width="12" height="68.4" fill="#c00" opacity="0.55"/>
|
||||
<rect x="334.0" y="381.2" width="12" height="48.8" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="356.0" y="384.4" width="12" height="45.6" fill="#c00" opacity="0.55"/>
|
||||
<rect x="378.0" y="363.3" width="12" height="66.7" fill="#c00" opacity="0.55"/>
|
||||
<rect x="400.0" y="382.8" width="12" height="47.2" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="422.0" y="379.5" width="12" height="50.5" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="444.0" y="376.3" width="12" height="53.7" fill="#188a3e" opacity="0.55"/>
|
||||
<text x="24" y="354.0" fill="#555">volum</text>
|
||||
<text x="252.0" y="240.0" fill="#b06000" text-anchor="middle" style="font-weight:bold">test 1</text>
|
||||
<text x="318.0" y="252.0" fill="#b06000" text-anchor="middle" style="font-weight:bold">test 2</text>
|
||||
<text x="384.0" y="255.0" fill="#b06000" text-anchor="middle" style="font-weight:bold">test 3</text>
|
||||
<text x="24" y="466" fill="#333">Aici nu intri încă: diagrama arată doar ideea de bottom. MBT-10 e ultima piesă, și vine abia la close-ul unei bare.</text><text x="24" y="482" fill="#333">Suportul 88.00 ține de trei ori, iar între teste vârfurile scad — 89.50, apoi 89.10: compresie.</text><text x="24" y="498" fill="#555">Exemplul e al materialului și e pe 60 de minute: suport 88.00, intrare 89.90, SL 87.30, țintă 95.20.</text><text x="24" y="514" fill="#555">Nu e double bottom și nu e divergență de volum — alea sunt din alt exemplu al lui (gap up, picioarele 32.10 / 30.90).</text><text x="24" y="530" fill="#555">Forma exactă a barelor și volumul sunt ale mele; la fel pivotul daily 89.60, pus ca să aibă ce verifica pasul B3.</text></svg>
|
||||
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.2 KiB |
@@ -20,7 +20,8 @@ cu două excepții impuse de exemplu:
|
||||
o=c=66.40, wu=0.30 => high 66.70, wd=0.30 => low 66.10.
|
||||
|
||||
Wick-urile speciale: bara 16 wd=0.20 (low 64.60), bara 18 wd=0.20 (low
|
||||
63.20), bara 21 wd=0.20 (low 62.00); restul (0.30, 0.40).
|
||||
63.20), bara 21 wd=1.60 (low 60.60 = noul low al coborârii, ca SL-ul 60.40 din
|
||||
material să stea sub o structură desenată); restul (0.30, 0.40).
|
||||
|
||||
Rulează: python3 gen/strategii/hammer_mbt10_mbt_gapdown.py
|
||||
Scrie: gen/strategii/hammer_mbt10_mbt_gapdown.svg
|
||||
@@ -30,6 +31,8 @@ import sys
|
||||
from pathlib import Path
|
||||
|
||||
sys.path.insert(0, "/workspace/atm-curs-dl")
|
||||
sys.path.insert(0, "/workspace/atm-curs-dl/gen")
|
||||
from eticheta_libera import eticheta_libera # noqa: E402
|
||||
from svg_candles import Candle, Chart, Level, Mark, from_closes # noqa: E402
|
||||
|
||||
OUT = Path(__file__).resolve().parent / "hammer_mbt10_mbt_gapdown.svg"
|
||||
@@ -62,7 +65,10 @@ WICKS[13] = (0.40, 0.00) # high 71.00, low 70.60
|
||||
WICKS[14] = (0.30, 0.30) # high 66.70, low 66.10 (bara de gap)
|
||||
WICKS[16] = (0.30, 0.20) # low 64.60
|
||||
WICKS[18] = (0.30, 0.20) # low 63.20
|
||||
WICKS[21] = (0.30, 0.20) # low 62.00
|
||||
# bara lui MBT-10 #2 face și noul low al coborârii: flush la 60.60, închidere
|
||||
# înapoi la 62.20. Fără el, SL-ul 60.40 din material (`mbt`:729-732) ar pluti
|
||||
# sub orice structură desenată — exact reproșul din verificare.
|
||||
WICKS[21] = (0.30, 1.60) # low 60.60 = noul low; SL 60.40 stă sub el
|
||||
|
||||
# Volume relative, alese de generator (materialul nu dă volum aici):
|
||||
# în scădere pe piciorul coborârii după gap (14 -> 21), apoi recuperare.
|
||||
@@ -104,6 +110,12 @@ intrare2, sl2 = 62.20, 60.40
|
||||
assert abs(cds[21].c - intrare2) < 1e-9, f"close[21]={cds[21].c} != 62.20"
|
||||
assert abs(sl2 - 60.40) < 1e-9
|
||||
assert not any(c.l <= sl2 for c in cds[22:]), "un low atinge SL2 după bara 21"
|
||||
# stopul #2 numește o structură: e sub cel mai jos low al coborârii de după gap
|
||||
nou_low = min(c.l for c in cds[14:22])
|
||||
assert abs(nou_low - cds[21].l) < 1e-9, "noul low nu e al barei lui MBT-10 #2"
|
||||
assert sl2 < nou_low <= sl2 + 0.30, \
|
||||
f"SL2 {sl2} nu stă chiar sub noul low {nou_low:.2f}: nu mai numește o structură"
|
||||
assert nou_low < min(c.l for c in cds[14:21]), "low-ul barei 21 nu e cel mai jos"
|
||||
|
||||
# 4. riscuri
|
||||
risc1 = intrare1 - sl1 # 1.60
|
||||
@@ -141,7 +153,7 @@ ch = Chart(
|
||||
Level(intrare1, "#1 intrare 64.80", GRAY, label_at="right"),
|
||||
Level(sl1, "#1 SL 63.20", GRAY, label_at="right"),
|
||||
Level(intrare2, "#2 intrare 62.20", GRAY, label_at="right"),
|
||||
Level(sl2, "#2 SL 60.40", GRAY, label_at="right"),
|
||||
Level(sl2, "#2 SL 60.40, sub noul low 60.60", GRAY, label_at="right"),
|
||||
Level(TP, "TP 70.60 = 4.7R (gap închis)", BLUE, label_at="right"),
|
||||
],
|
||||
marks=[
|
||||
@@ -149,7 +161,7 @@ ch = Chart(
|
||||
Mark(14, "gap down", RED, "above", dy=-22),
|
||||
Mark(16, "MBT-10 #1", GRAY, "above", dy=-25),
|
||||
Mark(18, "stop #1 atins", RED, "below", dy=30),
|
||||
Mark(21, "MBT-10 #2", GREEN, "below", dy=25),
|
||||
Mark(21, "MBT-10 #2: flush la 60.60, închidere 62.20", GREEN, "below", dy=25),
|
||||
],
|
||||
scale=28.0, gap=15, body_w=9, left=44, width=820, vol_h=70,
|
||||
vol_label="volum",
|
||||
@@ -159,13 +171,18 @@ ch = Chart(
|
||||
|
||||
svg = ch.render()
|
||||
assert "<svg" in svg and "\n\n" not in svg, "linie goală în SVG"
|
||||
eticheta_libera(svg, "mbt_gapdown",
|
||||
{"MBT-10 #2: flush la 60.60, închidere 62.20",
|
||||
"#2 SL 60.40, sub noul low 60.60", "stop #1 atins", "gap down",
|
||||
"MBT-10 #1"}, rects=True, segmente=False)
|
||||
|
||||
# --- blocul de text de jos: cine are același risc + legenda -----------------
|
||||
m = re.search(r'viewBox="0 0 (\d+) (\d+)"', svg)
|
||||
W, H = int(m.group(1)), int(m.group(2))
|
||||
linii = [
|
||||
"MBT-10 #1: intrare 64.80 / SL 63.20 — risc 1R în bani",
|
||||
"MBT-10 #2: intrare 62.20 / SL 60.40 — risc 1R în bani (mărime ajustată)",
|
||||
"MBT-10 #2: intrare 62.20 / SL 60.40, sub noul low 60.60 — risc 1R în bani "
|
||||
"(mărime ajustată)",
|
||||
"Exemplu construit: #1 și #2 au același risc în bani; "
|
||||
"#2 singur dă 4.7R.",
|
||||
"De aceea mărimea se împarte pe 2-3 încercări.",
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<svg viewBox="0 0 820 573" xmlns="http://www.w3.org/2000/svg" style="width:100%;height:auto;font:12px sans-serif">
|
||||
<text x="24" y="48" fill="#333" style="font-weight:bold">După gap down — primul MBT-10 te scoate, al doilea merge (exemplu construit)</text>
|
||||
<line x1="24" y1="235.2" x2="806" y2="235.2" stroke="#777" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<line x1="24.0" y1="235.2" x2="806" y2="235.2" stroke="#777" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="792" y="229.2" fill="#777" text-anchor="end">#1 intrare 64.80</text>
|
||||
<line x1="24" y1="280.0" x2="806" y2="280.0" stroke="#777" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<line x1="24.0" y1="280.0" x2="806" y2="280.0" stroke="#777" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="792" y="274.0" fill="#777" text-anchor="end">#1 SL 63.20</text>
|
||||
<line x1="24" y1="308.0" x2="806" y2="308.0" stroke="#777" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<line x1="24.0" y1="308.0" x2="806" y2="308.0" stroke="#777" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="792" y="302.0" fill="#777" text-anchor="end">#2 intrare 62.20</text>
|
||||
<line x1="24" y1="358.4" x2="806" y2="358.4" stroke="#777" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="792" y="352.4" fill="#777" text-anchor="end">#2 SL 60.40</text>
|
||||
<line x1="24" y1="72.8" x2="806" y2="72.8" stroke="#1a5fb4" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<line x1="24.0" y1="358.4" x2="806" y2="358.4" stroke="#777" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="792" y="352.4" fill="#777" text-anchor="end">#2 SL 60.40, sub noul low 60.60</text>
|
||||
<line x1="24.0" y1="72.8" x2="806" y2="72.8" stroke="#1a5fb4" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="792" y="66.8" fill="#1a5fb4" text-anchor="end">TP 70.60 = 4.7R (gap închis)</text>
|
||||
<line x1="44.0" y1="361.2" x2="44.0" y2="380.8" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="39.5" y="369.6" width="9" height="1.6" fill="#188a3e"/>
|
||||
@@ -52,7 +52,7 @@
|
||||
<rect x="324.5" y="274.4" width="9" height="14.0" fill="#c00"/>
|
||||
<line x1="344.0" y1="280.0" x2="344.0" y2="310.8" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="339.5" y="288.4" width="9" height="11.2" fill="#c00"/>
|
||||
<line x1="359.0" y1="291.2" x2="359.0" y2="313.6" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<line x1="359.0" y1="291.2" x2="359.0" y2="352.8" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="354.5" y="299.6" width="9" height="8.4" fill="#c00"/>
|
||||
<line x1="374.0" y1="282.8" x2="374.0" y2="319.2" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="369.5" y="291.2" width="9" height="16.8" fill="#188a3e"/>
|
||||
@@ -114,5 +114,5 @@
|
||||
<text x="254.0" y="150.0" fill="#c00" text-anchor="middle" style="font-weight:bold">gap down</text>
|
||||
<text x="284.0" y="172.2" fill="#777" text-anchor="middle" style="font-weight:bold">MBT-10 #1</text>
|
||||
<text x="314.0" y="330.0" fill="#c00" text-anchor="middle" style="font-weight:bold">stop #1 atins</text>
|
||||
<text x="359.0" y="358.6" fill="#188a3e" text-anchor="middle" style="font-weight:bold">MBT-10 #2</text>
|
||||
<text x="24" y="515" fill="#555">MBT-10 #1: intrare 64.80 / SL 63.20 — risc 1R în bani</text><text x="24" y="531" fill="#555">MBT-10 #2: intrare 62.20 / SL 60.40 — risc 1R în bani (mărime ajustată)</text><text x="24" y="547" fill="#555">Exemplu construit: #1 și #2 au același risc în bani; #2 singur dă 4.7R.</text><text x="24" y="563" fill="#555">De aceea mărimea se împarte pe 2-3 încercări.</text></svg>
|
||||
<text x="359.0" y="394.8" fill="#188a3e" text-anchor="middle" style="font-weight:bold">MBT-10 #2: flush la 60.60, închidere 62.20</text>
|
||||
<text x="24" y="515" fill="#555">MBT-10 #1: intrare 64.80 / SL 63.20 — risc 1R în bani</text><text x="24" y="531" fill="#555">MBT-10 #2: intrare 62.20 / SL 60.40, sub noul low 60.60 — risc 1R în bani (mărime ajustată)</text><text x="24" y="547" fill="#555">Exemplu construit: #1 și #2 au același risc în bani; #2 singur dă 4.7R.</text><text x="24" y="563" fill="#555">De aceea mărimea se împarte pe 2-3 încercări.</text></svg>
|
||||
|
Before Width: | Height: | Size: 9.8 KiB After Width: | Height: | Size: 9.9 KiB |
@@ -49,7 +49,7 @@ ch = Chart(
|
||||
price=TP, where="below", color=BLUE, dx=-200, dy=54),
|
||||
],
|
||||
scale=26.0, gap=17, body_w=10, left=54, width=700, top=58, vol_h=60, vol_label="volum",
|
||||
title="MBT-10 — ieșirea la prima structură din stânga (exemplu construit)",
|
||||
title="MBT-10 — ieșirea la prima structură din stânga (60 de minute)",
|
||||
)
|
||||
svg = ch.render()
|
||||
m = re.search(r'viewBox="0 0 (\d+) (\d+)"', svg)
|
||||
@@ -59,8 +59,8 @@ linii = [
|
||||
"exemplele lui e că", "#333"),
|
||||
("ținta e o structură vizibilă în stânga: un vârf anterior, ultimul maxim mai jos, sau "
|
||||
"închiderea unui gap.", "#333"),
|
||||
(f"Aici: 89.90 → 95.20 = {R_TINTA:.1f}R, în {zile} bare. Cifrele trade-ului sunt din "
|
||||
"exemplul construit al materialului.", GREY),
|
||||
(f"Aici: 89.90 → 95.20 = {R_TINTA:.1f}R, în {zile} bare de 60 de minute. Cifrele "
|
||||
"trade-ului sunt din exemplul materialului.", GREY),
|
||||
]
|
||||
add = 16 * len(linii) + 10
|
||||
svg = svg.replace(f'viewBox="0 0 {W} {H}"', f'viewBox="0 0 {W} {H + add}"')
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<svg viewBox="0 0 700 603" xmlns="http://www.w3.org/2000/svg" style="width:100%;height:auto;font:12px sans-serif">
|
||||
<text x="24" y="72" fill="#333" style="font-weight:bold">MBT-10 — ieșirea la prima structură din stânga (exemplu construit)</text>
|
||||
<svg viewBox="0 0 700 592" xmlns="http://www.w3.org/2000/svg" style="width:100%;height:auto;font:12px sans-serif">
|
||||
<text x="24" y="72" fill="#333" style="font-weight:bold">MBT-10 — ieșirea la prima structură din stânga (60 de minute)</text>
|
||||
<rect x="95.0" y="103.4" width="20.0" height="58.7" fill="#b06000" fill-opacity="0.08" stroke="#b06000" stroke-width="1"/>
|
||||
<text x="95.0" y="98.4" fill="#b06000" style="font-weight:bold">de aici a pornit coborârea</text>
|
||||
<rect x="367.0" y="103.2" width="139.0" height="183.7" fill="#188a3e" fill-opacity="0.08" stroke="#188a3e" stroke-width="1"/>
|
||||
<text x="367.0" y="98.2" fill="#188a3e" style="font-weight:bold">drumul până la structură: 7 bare</text>
|
||||
<line x1="24" y1="121.6" x2="686" y2="121.6" stroke="#1a5fb4" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<line x1="24.0" y1="121.6" x2="686" y2="121.6" stroke="#1a5fb4" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="672" y="115.6" fill="#1a5fb4" text-anchor="end">ținta 95.20 = ultimul maxim dinaintea coborârii</text>
|
||||
<line x1="24" y1="259.4" x2="686" y2="259.4" stroke="#188a3e" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="30" y="253.4" fill="#188a3e">intrare 89.90</text>
|
||||
<line x1="24" y1="327.0" x2="686" y2="327.0" stroke="#c00" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="30" y="321.0" fill="#c00">SL 87.30</text>
|
||||
<line x1="24.0" y1="259.4" x2="686" y2="259.4" stroke="#188a3e" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="30.0" y="253.4" fill="#188a3e">intrare 89.90</text>
|
||||
<line x1="24.0" y1="327.0" x2="686" y2="327.0" stroke="#c00" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="30.0" y="321.0" fill="#c00">SL 87.30</text>
|
||||
<line x1="54.0" y1="80.0" x2="54.0" y2="107.3" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="49.0" y="85.2" width="10" height="15.6" fill="#c00"/>
|
||||
<line x1="71.0" y1="95.6" x2="71.0" y2="133.3" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
@@ -28,26 +28,26 @@
|
||||
<rect x="168.0" y="225.6" width="10" height="28.6" fill="#c00"/>
|
||||
<line x1="190.0" y1="249.0" x2="190.0" y2="289.3" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="185.0" y="254.2" width="10" height="28.6" fill="#c00"/>
|
||||
<line x1="207.0" y1="277.6" x2="207.0" y2="310.1" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<line x1="207.0" y1="277.6" x2="207.0" y2="308.8" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="202.0" y="282.8" width="10" height="20.8" fill="#c00"/>
|
||||
<line x1="224.0" y1="298.4" x2="224.0" y2="319.2" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="219.0" y="303.6" width="10" height="13.0" fill="#c00"/>
|
||||
<line x1="241.0" y1="293.2" x2="241.0" y2="317.9" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="236.0" y="298.4" width="10" height="18.2" fill="#188a3e"/>
|
||||
<line x1="258.0" y1="275.0" x2="258.0" y2="304.9" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="253.0" y="280.2" width="10" height="18.2" fill="#188a3e"/>
|
||||
<line x1="275.0" y1="275.0" x2="275.0" y2="299.7" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="270.0" y="280.2" width="10" height="13.0" fill="#c00"/>
|
||||
<line x1="292.0" y1="288.0" x2="292.0" y2="315.3" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="287.0" y="293.2" width="10" height="15.6" fill="#c00"/>
|
||||
<line x1="309.0" y1="303.6" x2="309.0" y2="320.5" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="304.0" y="308.8" width="10" height="9.1" fill="#c00"/>
|
||||
<line x1="326.0" y1="295.8" x2="326.0" y2="319.2" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="321.0" y="301.0" width="10" height="16.9" fill="#188a3e"/>
|
||||
<line x1="343.0" y1="280.2" x2="343.0" y2="307.5" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="338.0" y="285.4" width="10" height="15.6" fill="#188a3e"/>
|
||||
<line x1="360.0" y1="264.6" x2="360.0" y2="291.9" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="355.0" y="272.4" width="10" height="13.0" fill="#188a3e"/>
|
||||
<line x1="224.0" y1="269.8" x2="224.0" y2="304.9" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="219.0" y="282.8" width="10" height="20.8" fill="#188a3e"/>
|
||||
<line x1="241.0" y1="277.6" x2="241.0" y2="299.7" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="236.0" y="282.8" width="10" height="10.4" fill="#c00"/>
|
||||
<line x1="258.0" y1="288.0" x2="258.0" y2="308.8" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="253.0" y="293.2" width="10" height="10.4" fill="#c00"/>
|
||||
<line x1="275.0" y1="280.2" x2="275.0" y2="304.9" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="270.0" y="282.8" width="10" height="20.8" fill="#188a3e"/>
|
||||
<line x1="292.0" y1="277.6" x2="292.0" y2="302.3" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="287.0" y="282.8" width="10" height="13.0" fill="#c00"/>
|
||||
<line x1="309.0" y1="290.6" x2="309.0" y2="308.8" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="304.0" y="295.8" width="10" height="7.8" fill="#c00"/>
|
||||
<line x1="326.0" y1="288.0" x2="326.0" y2="304.9" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="321.0" y="293.2" width="10" height="10.4" fill="#188a3e"/>
|
||||
<line x1="343.0" y1="277.6" x2="343.0" y2="299.7" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="338.0" y="282.8" width="10" height="10.4" fill="#188a3e"/>
|
||||
<line x1="360.0" y1="264.6" x2="360.0" y2="289.3" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="355.0" y="272.4" width="10" height="10.4" fill="#188a3e"/>
|
||||
<line x1="377.0" y1="254.2" x2="377.0" y2="278.9" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="372.0" y="259.4" width="10" height="13.0" fill="#188a3e"/>
|
||||
<line x1="394.0" y1="236.0" x2="394.0" y2="265.9" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
@@ -64,38 +64,38 @@
|
||||
<rect x="474.0" y="150.2" width="10" height="28.6" fill="#188a3e"/>
|
||||
<line x1="496.0" y1="111.2" x2="496.0" y2="156.7" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="491.0" y="116.4" width="10" height="33.8" fill="#188a3e"/>
|
||||
<line x1="24" y1="519.5" x2="686" y2="519.5" stroke="#888"/>
|
||||
<rect x="49.0" y="482.0" width="10" height="37.5" fill="#c00" opacity="0.55"/>
|
||||
<rect x="66.0" y="483.2" width="10" height="36.2" fill="#c00" opacity="0.55"/>
|
||||
<rect x="83.0" y="485.1" width="10" height="34.4" fill="#c00" opacity="0.55"/>
|
||||
<rect x="100.0" y="488.2" width="10" height="31.3" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="117.0" y="480.7" width="10" height="38.8" fill="#c00" opacity="0.55"/>
|
||||
<rect x="134.0" y="478.2" width="10" height="41.2" fill="#c00" opacity="0.55"/>
|
||||
<rect x="151.0" y="475.7" width="10" height="43.8" fill="#c00" opacity="0.55"/>
|
||||
<rect x="168.0" y="473.2" width="10" height="46.2" fill="#c00" opacity="0.55"/>
|
||||
<rect x="185.0" y="469.5" width="10" height="50.0" fill="#c00" opacity="0.55"/>
|
||||
<rect x="202.0" y="465.7" width="10" height="53.8" fill="#c00" opacity="0.55"/>
|
||||
<rect x="219.0" y="460.7" width="10" height="58.8" fill="#c00" opacity="0.55"/>
|
||||
<rect x="236.0" y="480.7" width="10" height="38.8" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="253.0" y="483.2" width="10" height="36.2" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="270.0" y="485.1" width="10" height="34.4" fill="#c00" opacity="0.55"/>
|
||||
<rect x="287.0" y="482.0" width="10" height="37.5" fill="#c00" opacity="0.55"/>
|
||||
<rect x="304.0" y="478.2" width="10" height="41.2" fill="#c00" opacity="0.55"/>
|
||||
<rect x="321.0" y="485.7" width="10" height="33.8" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="338.0" y="483.2" width="10" height="36.2" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="355.0" y="480.7" width="10" height="38.8" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="372.0" y="459.5" width="10" height="60.0" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="389.0" y="475.7" width="10" height="43.8" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="406.0" y="478.2" width="10" height="41.2" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="423.0" y="479.5" width="10" height="40.0" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="440.0" y="483.2" width="10" height="36.2" fill="#c00" opacity="0.55"/>
|
||||
<rect x="457.0" y="477.0" width="10" height="42.5" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="474.0" y="474.5" width="10" height="45.0" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="491.0" y="469.5" width="10" height="50.0" fill="#188a3e" opacity="0.55"/>
|
||||
<text x="24" y="453.5" fill="#555">volum</text>
|
||||
<line x1="296.0" y1="382.5" x2="491.1" y2="131.9" stroke="#1a5fb4" stroke-width="1.8"/>
|
||||
<polygon points="496.0,125.6 494.2,134.4 487.9,129.5" fill="#1a5fb4"/>
|
||||
<text x="296.0" y="396.5" fill="#1a5fb4" text-anchor="middle" style="font-weight:bold">ieși la 95.20 (+2.0R):</text>
|
||||
<text x="296.0" y="410.5" fill="#1a5fb4" text-anchor="middle" style="font-weight:bold">prima structură care a oprit</text>
|
||||
<text x="296.0" y="424.5" fill="#1a5fb4" text-anchor="middle" style="font-weight:bold">prețul ultima dată</text>
|
||||
<text x="24" y="555" fill="#333">Materialul nu dă o regulă proprie de take-profit la MBT-10. Ce au în comun toate exemplele lui e că</text><text x="24" y="571" fill="#333">ținta e o structură vizibilă în stânga: un vârf anterior, ultimul maxim mai jos, sau închiderea unui gap.</text><text x="24" y="587" fill="#555">Aici: 89.90 → 95.20 = 2.0R, în 7 bare. Cifrele trade-ului sunt din exemplul construit al materialului.</text></svg>
|
||||
<line x1="24" y1="507.8" x2="686" y2="507.8" stroke="#888"/>
|
||||
<rect x="49.0" y="470.3" width="10" height="37.5" fill="#c00" opacity="0.55"/>
|
||||
<rect x="66.0" y="471.5" width="10" height="36.2" fill="#c00" opacity="0.55"/>
|
||||
<rect x="83.0" y="473.4" width="10" height="34.4" fill="#c00" opacity="0.55"/>
|
||||
<rect x="100.0" y="476.5" width="10" height="31.3" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="117.0" y="469.0" width="10" height="38.8" fill="#c00" opacity="0.55"/>
|
||||
<rect x="134.0" y="466.5" width="10" height="41.2" fill="#c00" opacity="0.55"/>
|
||||
<rect x="151.0" y="464.0" width="10" height="43.8" fill="#c00" opacity="0.55"/>
|
||||
<rect x="168.0" y="461.5" width="10" height="46.2" fill="#c00" opacity="0.55"/>
|
||||
<rect x="185.0" y="457.8" width="10" height="50.0" fill="#c00" opacity="0.55"/>
|
||||
<rect x="202.0" y="454.0" width="10" height="53.8" fill="#c00" opacity="0.55"/>
|
||||
<rect x="219.0" y="469.0" width="10" height="38.8" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="236.0" y="471.5" width="10" height="36.2" fill="#c00" opacity="0.55"/>
|
||||
<rect x="253.0" y="455.3" width="10" height="52.5" fill="#c00" opacity="0.55"/>
|
||||
<rect x="270.0" y="470.3" width="10" height="37.5" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="287.0" y="472.8" width="10" height="35.0" fill="#c00" opacity="0.55"/>
|
||||
<rect x="304.0" y="456.5" width="10" height="51.2" fill="#c00" opacity="0.55"/>
|
||||
<rect x="321.0" y="471.5" width="10" height="36.2" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="338.0" y="469.0" width="10" height="38.8" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="355.0" y="466.5" width="10" height="41.2" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="372.0" y="447.8" width="10" height="60.0" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="389.0" y="464.0" width="10" height="43.8" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="406.0" y="466.5" width="10" height="41.2" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="423.0" y="467.8" width="10" height="40.0" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="440.0" y="471.5" width="10" height="36.2" fill="#c00" opacity="0.55"/>
|
||||
<rect x="457.0" y="465.3" width="10" height="42.5" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="474.0" y="462.8" width="10" height="45.0" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="491.0" y="457.8" width="10" height="50.0" fill="#188a3e" opacity="0.55"/>
|
||||
<text x="24" y="441.8" fill="#555">volum</text>
|
||||
<line x1="296.0" y1="370.8" x2="490.9" y2="131.8" stroke="#1a5fb4" stroke-width="1.8"/>
|
||||
<polygon points="496.0,125.6 494.0,134.3 487.8,129.3" fill="#1a5fb4"/>
|
||||
<text x="296.0" y="384.8" fill="#1a5fb4" text-anchor="middle" style="font-weight:bold">ieși la 95.20 (+2.0R):</text>
|
||||
<text x="296.0" y="398.8" fill="#1a5fb4" text-anchor="middle" style="font-weight:bold">prima structură care a oprit</text>
|
||||
<text x="296.0" y="412.8" fill="#1a5fb4" text-anchor="middle" style="font-weight:bold">prețul ultima dată</text>
|
||||
<text x="24" y="544" fill="#333">Materialul nu dă o regulă proprie de take-profit la MBT-10. Ce au în comun toate exemplele lui e că</text><text x="24" y="560" fill="#333">ținta e o structură vizibilă în stânga: un vârf anterior, ultimul maxim mai jos, sau închiderea unui gap.</text><text x="24" y="576" fill="#555">Aici: 89.90 → 95.20 = 2.0R, în 7 bare de 60 de minute. Cifrele trade-ului sunt din exemplul materialului.</text></svg>
|
||||
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 8.7 KiB |
@@ -2,22 +2,33 @@
|
||||
"""MBT-10 — singura bucată reconstituibilă: close peste pivotul daily.
|
||||
|
||||
Aceleași bare ca la pasul „unde" (importate din `hammer_mbt10_mbt_confluente`),
|
||||
tăiate în jurul trigger-ului. Bara 18 atinge pivotul 89.60 în timpul zilei,
|
||||
dar se închide sub el: nu e semnal. Bara 19 se închide la 89.90, peste pivot:
|
||||
aici intri, la close.
|
||||
tăiate în jurul trigger-ului. Exemplul e pe 60 de minute, ca în material: bara
|
||||
18 atinge pivotul 89.60 în timpul zilei, dar se închide sub el (nu e semnal),
|
||||
iar bara 19 se închide la 89.90, peste pivot — aici intri.
|
||||
|
||||
Pivotul daily NU e un nivel fix pe grafic: se recalculează în fiecare zi. Pe
|
||||
60 de minute el e același pentru toate barele unei zile, așa că aici e desenat
|
||||
doar peste barele zilei de intrare, între două linii de separare de zi. În
|
||||
ziua dinainte era alt număr, pe care materialul nu-l dă — de aceea nu-l
|
||||
inventăm, doar spunem că era altul.
|
||||
|
||||
Rulare: python3 gen/strategii/hammer_mbt10_mbt_ppd.py
|
||||
"""
|
||||
import re
|
||||
import sys; sys.path.insert(0, "/workspace/atm-curs-dl")
|
||||
sys.path.insert(0, "/workspace/atm-curs-dl/gen")
|
||||
sys.path.insert(0, "/workspace/atm-curs-dl/gen/strategii")
|
||||
from pathlib import Path
|
||||
from hammer_mbt10_mbt_confluente import CLOSE_I, INTRARE, PPD, SUP_W, serie
|
||||
from eticheta_libera import eticheta_libera
|
||||
from hammer_mbt10_mbt_confluente import (CLOSE_I, INTRARE, PPD, SUP_W,
|
||||
ZI_INTRARE, serie)
|
||||
from svg_candles import Arrow, Chart, Level, Zone
|
||||
|
||||
OUT = Path(__file__).with_suffix(".svg")
|
||||
GREEN, RED, BLUE, ORANGE, GREY = "#188a3e", "#c00", "#1a5fb4", "#b06000", "#555"
|
||||
|
||||
ET_PIVOT = ("pivotul daily al zilei de", "intrare: 89.60 (ieri, altul) →")
|
||||
|
||||
cds = serie()
|
||||
I0, I1 = 9, 22
|
||||
w = cds[I0:I1 + 1]
|
||||
@@ -28,28 +39,54 @@ assert cds[NU].h > PPD > cds[NU].c, "bara 18 nu mai e contraexemplul așteptat"
|
||||
assert cds[DA].c > PPD and round(cds[DA].c, 2) == INTRARE
|
||||
assert 0 <= sh(NU) < len(w) and sh(DA) < len(w), "fereastra nu prinde cele două bare"
|
||||
assert max(c.c for c in cds[I0:DA]) < PPD, "o bară din fereastră închide deja peste pivot"
|
||||
assert I0 < ZI_INTRARE[0] and ZI_INTRARE[1] <= I1, \
|
||||
"ziua intrării trebuie să se vadă întreagă, cu bare de altă zi de o parte și de alta"
|
||||
|
||||
ch = Chart(
|
||||
candles=w,
|
||||
levels=[Level(PPD, "pivotul daily 89.60", BLUE),
|
||||
Level(SUP_W, "suport weekly 87.50", GREY, label_at="left")],
|
||||
levels=[Level(SUP_W, "suport weekly 88.00", GREY, label_at="right")],
|
||||
zones=[Zone(sh(NU), sh(DA), "", ORANGE, p_top=90.4)],
|
||||
arrows=[
|
||||
Arrow(sh(NU), "a atins 89.70 în timpul zilei,\ndar s-a închis la 89.40, sub pivot:\nnu e semnal",
|
||||
Arrow(sh(NU), "a atins 89.70 în timpul barei,\ndar s-a închis la 89.40, sub pivot:\nnu e semnal",
|
||||
where="below", color=RED, dx=-190, dy=40),
|
||||
Arrow(sh(DA), "s-a închis la 89.90, peste pivot:\naici intri, la close-ul zilei",
|
||||
Arrow(sh(DA), "s-a închis la 89.90, peste pivot:\naici intri, la close-ul barei",
|
||||
where="above", color=GREEN, dx=-70, dy=-20),
|
||||
],
|
||||
scale=44.0, gap=26, body_w=13, left=64, width=680, top=58, vol_h=60, vol_label="volum",
|
||||
title="MBT-10 — condiția de preț: close peste pivotul daily (exemplu construit)",
|
||||
title="MBT-10 — condiția de preț: close peste pivotul daily (60 de minute)",
|
||||
)
|
||||
svg = ch.render()
|
||||
|
||||
# --- pivotul daily: un segment peste ziua de intrare, nu o linie fixă -------
|
||||
# aceeași corecție de offset ca în `_mbt_stop`: `_render` mută `top` ca să facă
|
||||
# loc titlului și săgeților, deci `_y` singur nu nimerește coordonatele finale.
|
||||
OFF = float(re.search(r'<line x1="24\.0" y1="([\d.]+)"', svg).group(1)) - ch._y(SUP_W)
|
||||
OFFX = float(re.search(r'<line x1="([\d.]+)" y1="[\d.]+" x2="\1" [^/]*stroke="#1a1a1a"',
|
||||
svg).group(1)) - ch._cx(0)
|
||||
y_ppd = ch._y(PPD) + OFF
|
||||
x_zi0 = ch._cx(sh(ZI_INTRARE[0])) + OFFX - ch.gap / 2
|
||||
x_zi1 = ch._cx(sh(ZI_INTRARE[1])) + OFFX + ch.gap / 2
|
||||
y_sus, y_jos = ch._y(ch._pmax) + OFF, ch._y(SUP_W) + OFF + 10
|
||||
pivot = (
|
||||
f'<line x1="{x_zi0:.1f}" y1="{y_sus:.1f}" x2="{x_zi0:.1f}" y2="{y_jos:.1f}" '
|
||||
f'stroke="#bbb" stroke-width="1"/>'
|
||||
f'<line x1="{x_zi1:.1f}" y1="{y_sus:.1f}" x2="{x_zi1:.1f}" y2="{y_jos:.1f}" '
|
||||
f'stroke="#bbb" stroke-width="1"/>'
|
||||
f'<line x1="{x_zi0:.1f}" y1="{y_ppd:.1f}" x2="{x_zi1:.1f}" y2="{y_ppd:.1f}" '
|
||||
f'stroke="{BLUE}" stroke-width="1.5" stroke-dasharray="4 3"/>'
|
||||
+ "".join(
|
||||
f'<text x="{x_zi0 - 10:.1f}" y="{y_ppd - 20 + 14 * i:.1f}" fill="{BLUE}" '
|
||||
f'text-anchor="end">{t}</text>' for i, t in enumerate(ET_PIVOT))
|
||||
)
|
||||
svg = svg.replace("</svg>", pivot + "</svg>")
|
||||
m = re.search(r'viewBox="0 0 (\d+) (\d+)"', svg)
|
||||
W, H = int(m.group(1)), int(m.group(2))
|
||||
linii = [
|
||||
("Pivotul daily se recalculează în fiecare zi din maximul, minimul și închiderea zilei "
|
||||
"precedente;", "#333"),
|
||||
("linia desenată e valoarea din ziua intrării, 89.60, nu un nivel fix.", "#333"),
|
||||
"precedente.", "#333"),
|
||||
("Pe 60 de minute e același nivel pentru toate barele unei zile, așa că e desenat doar "
|
||||
"între cele două", "#333"),
|
||||
("linii subțiri care taie ziua intrării — nu peste tot graficul.", "#333"),
|
||||
("Asta e tot ce se poate verifica din MBT-10 fără indicatorul proprietar — „prima "
|
||||
"componentă\" din el,", GREY),
|
||||
("cum îi spune materialul; restul formulei nu e publicat nicăieri.", GREY),
|
||||
@@ -59,6 +96,8 @@ svg = svg.replace(f'viewBox="0 0 {W} {H}"', f'viewBox="0 0 {W} {H + add}"')
|
||||
svg = svg.replace("</svg>", "".join(
|
||||
f'<text x="24" y="{H + 10 + 16 * i}" fill="{c}">{t}</text>'
|
||||
for i, (t, c) in enumerate(linii)) + "</svg>")
|
||||
eticheta_libera(svg, "mbt_ppd",
|
||||
{ET_PIVOT}, rects=True)
|
||||
assert "\n\n" not in svg, "linie goală în SVG"
|
||||
OUT.write_text(svg, encoding="utf-8")
|
||||
print(f"scris {OUT.name} ({W}x{H + add})")
|
||||
|
||||
@@ -1,30 +1,28 @@
|
||||
<svg viewBox="0 0 686 578" xmlns="http://www.w3.org/2000/svg" style="width:100%;height:auto;font:12px sans-serif">
|
||||
<text x="24" y="72" fill="#333" style="font-weight:bold">MBT-10 — condiția de preț: close peste pivotul daily (exemplu construit)</text>
|
||||
<rect x="293.0" y="168.0" width="49.0" height="85.0" fill="#b06000" fill-opacity="0.08" stroke="#b06000" stroke-width="1"/>
|
||||
<line x1="24" y1="203.2" x2="672" y2="203.2" stroke="#1a5fb4" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="658" y="197.2" fill="#1a5fb4" text-anchor="end">pivotul daily 89.60</text>
|
||||
<line x1="24" y1="295.6" x2="672" y2="295.6" stroke="#555" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="30" y="289.6" fill="#555">suport weekly 87.50</text>
|
||||
<line x1="70.5" y1="220.8" x2="70.5" y2="275.8" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<svg viewBox="0 0 686 575" xmlns="http://www.w3.org/2000/svg" style="width:100%;height:auto;font:12px sans-serif">
|
||||
<text x="24" y="72" fill="#333" style="font-weight:bold">MBT-10 — condiția de preț: close peste pivotul daily (60 de minute)</text>
|
||||
<rect x="293.0" y="168.0" width="49.0" height="80.6" fill="#b06000" fill-opacity="0.08" stroke="#b06000" stroke-width="1"/>
|
||||
<line x1="24.0" y1="273.6" x2="672" y2="273.6" stroke="#555" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="658" y="267.6" fill="#555" text-anchor="end">suport weekly 88.00</text>
|
||||
<line x1="70.5" y1="220.8" x2="70.5" y2="273.6" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="64.0" y="229.6" width="13" height="35.2" fill="#c00"/>
|
||||
<line x1="96.5" y1="256.0" x2="96.5" y2="291.2" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="90.0" y="264.8" width="13" height="22.0" fill="#c00"/>
|
||||
<line x1="122.5" y1="247.2" x2="122.5" y2="289.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="116.0" y="256.0" width="13" height="30.8" fill="#188a3e"/>
|
||||
<line x1="148.5" y1="216.4" x2="148.5" y2="267.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="142.0" y="225.2" width="13" height="30.8" fill="#188a3e"/>
|
||||
<line x1="174.5" y1="216.4" x2="174.5" y2="258.2" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="168.0" y="225.2" width="13" height="22.0" fill="#c00"/>
|
||||
<line x1="200.5" y1="238.4" x2="200.5" y2="284.6" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="194.0" y="247.2" width="13" height="26.4" fill="#c00"/>
|
||||
<line x1="226.5" y1="264.8" x2="226.5" y2="293.4" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="220.0" y="273.6" width="13" height="15.4" fill="#c00"/>
|
||||
<line x1="252.5" y1="251.6" x2="252.5" y2="291.2" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="246.0" y="260.4" width="13" height="28.6" fill="#188a3e"/>
|
||||
<line x1="278.5" y1="225.2" x2="278.5" y2="271.4" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="272.0" y="234.0" width="13" height="26.4" fill="#188a3e"/>
|
||||
<line x1="304.5" y1="198.8" x2="304.5" y2="245.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="298.0" y="212.0" width="13" height="22.0" fill="#188a3e"/>
|
||||
<line x1="96.5" y1="207.6" x2="96.5" y2="267.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="90.0" y="229.6" width="13" height="35.2" fill="#188a3e"/>
|
||||
<line x1="122.5" y1="220.8" x2="122.5" y2="258.2" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="116.0" y="229.6" width="13" height="17.6" fill="#c00"/>
|
||||
<line x1="148.5" y1="238.4" x2="148.5" y2="273.6" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="142.0" y="247.2" width="13" height="17.6" fill="#c00"/>
|
||||
<line x1="174.5" y1="225.2" x2="174.5" y2="267.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="168.0" y="229.6" width="13" height="35.2" fill="#188a3e"/>
|
||||
<line x1="200.5" y1="220.8" x2="200.5" y2="262.6" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="194.0" y="229.6" width="13" height="22.0" fill="#c00"/>
|
||||
<line x1="226.5" y1="242.8" x2="226.5" y2="273.6" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="220.0" y="251.6" width="13" height="13.2" fill="#c00"/>
|
||||
<line x1="252.5" y1="238.4" x2="252.5" y2="267.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="246.0" y="247.2" width="13" height="17.6" fill="#188a3e"/>
|
||||
<line x1="278.5" y1="220.8" x2="278.5" y2="258.2" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="272.0" y="229.6" width="13" height="17.6" fill="#188a3e"/>
|
||||
<line x1="304.5" y1="198.8" x2="304.5" y2="240.6" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="298.0" y="212.0" width="13" height="17.6" fill="#188a3e"/>
|
||||
<line x1="330.5" y1="181.2" x2="330.5" y2="223.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="324.0" y="190.0" width="13" height="22.0" fill="#188a3e"/>
|
||||
<line x1="356.5" y1="150.4" x2="356.5" y2="201.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
@@ -33,29 +31,29 @@
|
||||
<rect x="376.0" y="124.0" width="13" height="35.2" fill="#188a3e"/>
|
||||
<line x1="408.5" y1="80.0" x2="408.5" y2="135.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="402.0" y="88.8" width="13" height="35.2" fill="#188a3e"/>
|
||||
<line x1="24" y1="478.4" x2="672" y2="478.4" stroke="#888"/>
|
||||
<rect x="64.0" y="424.6" width="13" height="53.8" fill="#c00" opacity="0.55"/>
|
||||
<rect x="90.0" y="419.6" width="13" height="58.8" fill="#c00" opacity="0.55"/>
|
||||
<rect x="116.0" y="439.6" width="13" height="38.8" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="142.0" y="442.1" width="13" height="36.2" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="168.0" y="444.0" width="13" height="34.4" fill="#c00" opacity="0.55"/>
|
||||
<rect x="194.0" y="440.9" width="13" height="37.5" fill="#c00" opacity="0.55"/>
|
||||
<rect x="220.0" y="437.1" width="13" height="41.2" fill="#c00" opacity="0.55"/>
|
||||
<rect x="246.0" y="444.6" width="13" height="33.8" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="272.0" y="442.1" width="13" height="36.2" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="298.0" y="439.6" width="13" height="38.8" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="324.0" y="418.4" width="13" height="60.0" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="350.0" y="434.6" width="13" height="43.8" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="376.0" y="437.1" width="13" height="41.2" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="402.0" y="438.4" width="13" height="40.0" fill="#188a3e" opacity="0.55"/>
|
||||
<text x="24" y="412.4" fill="#555">volum</text>
|
||||
<line x1="114.5" y1="341.4" x2="297.3" y2="252.5" stroke="#c00" stroke-width="1.8"/>
|
||||
<polygon points="304.5,249.0 299.1,256.1 295.6,248.9" fill="#c00"/>
|
||||
<text x="114.5" y="355.4" fill="#c00" text-anchor="middle" style="font-weight:bold">a atins 89.70 în timpul zilei,</text>
|
||||
<text x="114.5" y="369.4" fill="#c00" text-anchor="middle" style="font-weight:bold">dar s-a închis la 89.40, sub pivot:</text>
|
||||
<text x="114.5" y="383.4" fill="#c00" text-anchor="middle" style="font-weight:bold">nu e semnal</text>
|
||||
<line x1="24" y1="458.6" x2="672" y2="458.6" stroke="#888"/>
|
||||
<rect x="64.0" y="404.9" width="13" height="53.8" fill="#c00" opacity="0.55"/>
|
||||
<rect x="90.0" y="419.9" width="13" height="38.8" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="116.0" y="422.4" width="13" height="36.2" fill="#c00" opacity="0.55"/>
|
||||
<rect x="142.0" y="406.1" width="13" height="52.5" fill="#c00" opacity="0.55"/>
|
||||
<rect x="168.0" y="421.1" width="13" height="37.5" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="194.0" y="423.6" width="13" height="35.0" fill="#c00" opacity="0.55"/>
|
||||
<rect x="220.0" y="407.4" width="13" height="51.2" fill="#c00" opacity="0.55"/>
|
||||
<rect x="246.0" y="422.4" width="13" height="36.2" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="272.0" y="419.9" width="13" height="38.8" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="298.0" y="417.4" width="13" height="41.2" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="324.0" y="398.6" width="13" height="60.0" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="350.0" y="414.9" width="13" height="43.8" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="376.0" y="417.4" width="13" height="41.2" fill="#188a3e" opacity="0.55"/>
|
||||
<rect x="402.0" y="418.6" width="13" height="40.0" fill="#188a3e" opacity="0.55"/>
|
||||
<text x="24" y="392.6" fill="#555">volum</text>
|
||||
<line x1="114.5" y1="321.6" x2="297.1" y2="247.6" stroke="#c00" stroke-width="1.8"/>
|
||||
<polygon points="304.5,244.6 298.6,251.3 295.6,243.9" fill="#c00"/>
|
||||
<text x="114.5" y="335.6" fill="#c00" text-anchor="middle" style="font-weight:bold">a atins 89.70 în timpul barei,</text>
|
||||
<text x="114.5" y="349.6" fill="#c00" text-anchor="middle" style="font-weight:bold">dar s-a închis la 89.40, sub pivot:</text>
|
||||
<text x="114.5" y="363.6" fill="#c00" text-anchor="middle" style="font-weight:bold">nu e semnal</text>
|
||||
<line x1="260.5" y1="122.4" x2="324.2" y2="172.3" stroke="#188a3e" stroke-width="1.8"/>
|
||||
<polygon points="330.5,177.2 321.7,175.4 326.7,169.1" fill="#188a3e"/>
|
||||
<text x="260.5" y="103.4" fill="#188a3e" text-anchor="middle" style="font-weight:bold">s-a închis la 89.90, peste pivot:</text>
|
||||
<text x="260.5" y="117.4" fill="#188a3e" text-anchor="middle" style="font-weight:bold">aici intri, la close-ul zilei</text>
|
||||
<text x="24" y="514" fill="#333">Pivotul daily se recalculează în fiecare zi din maximul, minimul și închiderea zilei precedente;</text><text x="24" y="530" fill="#333">linia desenată e valoarea din ziua intrării, 89.60, nu un nivel fix.</text><text x="24" y="546" fill="#555">Asta e tot ce se poate verifica din MBT-10 fără indicatorul proprietar — „prima componentă" din el,</text><text x="24" y="562" fill="#555">cum îi spune materialul; restul formulei nu e publicat nicăieri.</text></svg>
|
||||
<text x="260.5" y="117.4" fill="#188a3e" text-anchor="middle" style="font-weight:bold">aici intri, la close-ul barei</text>
|
||||
<line x1="187.5" y1="80.0" x2="187.5" y2="283.6" stroke="#bbb" stroke-width="1"/><line x1="369.5" y1="80.0" x2="369.5" y2="283.6" stroke="#bbb" stroke-width="1"/><line x1="187.5" y1="203.2" x2="369.5" y2="203.2" stroke="#1a5fb4" stroke-width="1.5" stroke-dasharray="4 3"/><text x="177.5" y="183.2" fill="#1a5fb4" text-anchor="end">pivotul daily al zilei de</text><text x="177.5" y="197.2" fill="#1a5fb4" text-anchor="end">intrare: 89.60 (ieri, altul) →</text><text x="24" y="495" fill="#333">Pivotul daily se recalculează în fiecare zi din maximul, minimul și închiderea zilei precedente.</text><text x="24" y="511" fill="#333">Pe 60 de minute e același nivel pentru toate barele unei zile, așa că e desenat doar între cele două</text><text x="24" y="527" fill="#333">linii subțiri care taie ziua intrării — nu peste tot graficul.</text><text x="24" y="543" fill="#555">Asta e tot ce se poate verifica din MBT-10 fără indicatorul proprietar — „prima componentă" din el,</text><text x="24" y="559" fill="#555">cum îi spune materialul; restul formulei nu e publicat nicăieri.</text></svg>
|
||||
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 6.0 KiB |
@@ -1,20 +1,22 @@
|
||||
#!/usr/bin/env python3
|
||||
"""MBT-10 — stopul sub structură și mărimea poziției (exemplu construit).
|
||||
"""MBT-10 — stopul sub structură și mărimea poziției (60 de minute).
|
||||
|
||||
Zoom pe barele 8-21 din seria pasului „unde" (importată). Stopul 87.30 nu e
|
||||
ales la distanță, ci sub amândouă picioarele double bottom-ului și sub
|
||||
suportul weekly 87.50. Riscul iese 2.60 $ pe acțiune, iar mărimea din regula
|
||||
de 2 % pe același cont de 10.000 $ folosit în Partea A: 200 / 2.60 = 76 de
|
||||
acțiuni.
|
||||
ales la distanță, ci sub suportul weekly 88.00, cel testat de trei ori —
|
||||
amândouă cifrele sunt ale materialului. Riscul iese 2.60 $ pe acțiune, iar
|
||||
mărimea din regula de 2 % pe același cont de 10.000 $ folosit în Partea A:
|
||||
200 / 2.60 = 76 de acțiuni.
|
||||
|
||||
Rulare: python3 gen/strategii/hammer_mbt10_mbt_stop.py
|
||||
"""
|
||||
import re
|
||||
import sys; sys.path.insert(0, "/workspace/atm-curs-dl")
|
||||
sys.path.insert(0, "/workspace/atm-curs-dl/gen")
|
||||
sys.path.insert(0, "/workspace/atm-curs-dl/gen/strategii")
|
||||
from pathlib import Path
|
||||
from hammer_mbt10_mbt_confluente import (CLOSE_I, FUND1, FUND2, INTRARE, SL,
|
||||
SUP_W, serie)
|
||||
from eticheta_libera import eticheta_libera
|
||||
from hammer_mbt10_mbt_confluente import (CLOSE_I, INTRARE, SL, SUP_W, TESTE,
|
||||
serie)
|
||||
from svg_candles import Arrow, Chart, Level, Zone
|
||||
|
||||
OUT = Path(__file__).with_suffix(".svg")
|
||||
@@ -32,29 +34,32 @@ ACTIUNI = int(RISC_LEI // RISC)
|
||||
# --- verificări -------------------------------------------------------------
|
||||
assert RISC == 2.60, RISC
|
||||
assert ACTIUNI == 76 and ACTIUNI * RISC <= RISC_LEI, (ACTIUNI, ACTIUNI * RISC)
|
||||
assert SL < SUP_W < min(cds[FUND1].l, cds[FUND2].l), \
|
||||
"stopul trebuie să stea sub suport, iar suportul sub amândouă picioarele"
|
||||
assert SL < SUP_W <= min(cds[t].l for t in TESTE), \
|
||||
"stopul trebuie să stea sub suport, iar suportul la sau sub cele trei teste"
|
||||
assert SL < min(c.l for c in w), "linia stopului trebuie să stea sub toate fitilele"
|
||||
assert round(cds[CLOSE_I].c, 2) == INTRARE
|
||||
assert I0 <= FUND1 and FUND2 <= I1 and CLOSE_I <= I1, "fereastra nu prinde tot ce trebuie"
|
||||
assert I0 <= TESTE[0] and TESTE[-1] <= I1 and CLOSE_I <= I1, \
|
||||
"fereastra nu prinde tot ce trebuie"
|
||||
|
||||
ch = Chart(
|
||||
candles=w,
|
||||
levels=[Level(INTRARE, "intrare 89.90 (close-ul zilei)", GREEN, label_at="left"),
|
||||
Level(SUP_W, "suport weekly 87.50", BLUE),
|
||||
levels=[Level(INTRARE, "intrare 89.90 (close-ul barei)", GREEN, label_at="right"),
|
||||
Level(SUP_W, "suport weekly 88.00, testat de trei ori", BLUE),
|
||||
Level(SL, "SL 87.30", RED, label_at="left")],
|
||||
zones=[Zone(sh(FUND1), sh(FUND2), "structura care ține ideea", ORANGE)],
|
||||
# fără etichetă pe zonă: eticheta ei cădea peste linia intrării, iar
|
||||
# săgeata de mai jos spune deja ce e structura
|
||||
zones=[Zone(sh(TESTE[0]), sh(TESTE[-1]), "", ORANGE)],
|
||||
arrows=[
|
||||
Arrow(sh(FUND2), "sub 87.30 nu mai e double bottom:\nideea de la pasul 1 a murit,\nnu mai ai ce aștepta",
|
||||
Arrow(sh(TESTE[-1]), "sub 87.30 nu mai ține suportul weekly:\nideea de la pasul 1 a murit,\nnu mai ai ce aștepta",
|
||||
price=SL, where="below", color=RED, dx=-40, dy=34),
|
||||
],
|
||||
scale=40.0, gap=26, body_w=13, left=64, width=680, vol_h=0,
|
||||
title="MBT-10 — stopul sub structură (exemplu construit)",
|
||||
title="MBT-10 — stopul sub structură, pe 60 de minute",
|
||||
)
|
||||
svg = ch.render()
|
||||
m = re.search(r'viewBox="0 0 (\d+) (\d+)"', svg)
|
||||
W, H = int(m.group(1)), int(m.group(2))
|
||||
OFF = (float(re.search(r'<line x1="24" y1="([\d.]+)"', svg).group(1)) - ch._y(ch.levels[0].price))
|
||||
OFF = (float(re.search(r'<line x1="24\.0" y1="([\d.]+)"', svg).group(1)) - ch._y(ch.levels[0].price))
|
||||
y_in, y_sl = ch._y(INTRARE) + OFF, ch._y(SL) + OFF
|
||||
xp = ch._cx(len(w) - 2)
|
||||
brk = (f'<polyline points="{xp - 6:.1f},{y_in:.1f} {xp:.1f},{y_in:.1f} {xp:.1f},{y_sl:.1f} '
|
||||
@@ -66,12 +71,22 @@ linii = [
|
||||
"#333"),
|
||||
(f"200 / 2.60 = {RISC_LEI / RISC:.1f} → {ACTIUNI} de acțiuni, pierdere maximă "
|
||||
f"{ACTIUNI * RISC:.2f} $.", "#333"),
|
||||
("87.30 e cifra materialului, nu marja mea de 5 cenți; suportul weekly 87.50 e construit "
|
||||
"de mine ca stopul", GREY),
|
||||
("acela să aibă sub ce sta. Materialul nu dă niciun procent fix de stop pentru MBT-10.", GREY),
|
||||
("87.30 și suportul weekly 88.00 sunt cifrele materialului, pe exemplul lui de 60 de "
|
||||
"minute —", GREY),
|
||||
("nu marja mea de 5 cenți. Materialul nu dă niciun procent fix de stop pentru MBT-10:",
|
||||
GREY),
|
||||
("stopul numește structura de sub el.", GREY),
|
||||
]
|
||||
add = 16 * len(linii) + 10
|
||||
svg = svg.replace(f'viewBox="0 0 {W} {H}"', f'viewBox="0 0 {W} {H + add}"')
|
||||
# primul rând al unei săgeți e locul de care se prinde coada ei: acolo
|
||||
# suprapunerea e prin construcție, nu o greșeală. Verificăm restul.
|
||||
eticheta_libera(svg, "mbt_stop",
|
||||
{"ideea de la pasul 1 a murit,", "nu mai ai ce aștepta"}, rects=True)
|
||||
# etichetele de nivel stau lipite de linia lor prin construcție
|
||||
eticheta_libera(svg, "mbt_stop",
|
||||
{"intrare 89.90 (close-ul barei)", "suport weekly 88.00, testat de trei ori",
|
||||
"SL 87.30"}, rects=True, segmente=False)
|
||||
svg = svg.replace("</svg>", brk + "".join(
|
||||
f'<text x="24" y="{H + 10 + 16 * i}" fill="{c}">{t}</text>'
|
||||
for i, (t, c) in enumerate(linii)) + "</svg>")
|
||||
|
||||
@@ -1,35 +1,34 @@
|
||||
<svg viewBox="0 0 680 443" xmlns="http://www.w3.org/2000/svg" style="width:100%;height:auto;font:12px sans-serif">
|
||||
<text x="24" y="48" fill="#333" style="font-weight:bold">MBT-10 — stopul sub structură (exemplu construit)</text>
|
||||
<rect x="104.5" y="140.0" width="153.0" height="86.0" fill="#b06000" fill-opacity="0.08" stroke="#b06000" stroke-width="1"/>
|
||||
<text x="104.5" y="135.0" fill="#b06000" style="font-weight:bold">structura care ține ideea</text>
|
||||
<line x1="24" y1="124.0" x2="666" y2="124.0" stroke="#188a3e" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="30" y="118.0" fill="#188a3e">intrare 89.90 (close-ul zilei)</text>
|
||||
<line x1="24" y1="220.0" x2="666" y2="220.0" stroke="#1a5fb4" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="652" y="214.0" fill="#1a5fb4" text-anchor="end">suport weekly 87.50</text>
|
||||
<line x1="24" y1="228.0" x2="666" y2="228.0" stroke="#c00" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="30" y="222.0" fill="#c00">SL 87.30</text>
|
||||
<svg viewBox="0 0 680 459" xmlns="http://www.w3.org/2000/svg" style="width:100%;height:auto;font:12px sans-serif">
|
||||
<text x="24" y="48" fill="#333" style="font-weight:bold">MBT-10 — stopul sub structură, pe 60 de minute</text>
|
||||
<rect x="78.5" y="132.0" width="179.0" height="76.0" fill="#b06000" fill-opacity="0.08" stroke="#b06000" stroke-width="1"/>
|
||||
<line x1="24.0" y1="124.0" x2="666" y2="124.0" stroke="#188a3e" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="652" y="118.0" fill="#188a3e" text-anchor="end">intrare 89.90 (close-ul barei)</text>
|
||||
<line x1="24.0" y1="200.0" x2="666" y2="200.0" stroke="#1a5fb4" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="652" y="194.0" fill="#1a5fb4" text-anchor="end">suport weekly 88.00, testat de trei ori</text>
|
||||
<line x1="24.0" y1="228.0" x2="666" y2="228.0" stroke="#c00" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="30.0" y="222.0" fill="#c00">SL 87.30</text>
|
||||
<line x1="64.0" y1="108.0" x2="64.0" y2="170.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="57.5" y="116.0" width="13" height="44.0" fill="#c00"/>
|
||||
<line x1="90.0" y1="152.0" x2="90.0" y2="202.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<line x1="90.0" y1="152.0" x2="90.0" y2="200.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="83.5" y="160.0" width="13" height="32.0" fill="#c00"/>
|
||||
<line x1="116.0" y1="184.0" x2="116.0" y2="216.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="109.5" y="192.0" width="13" height="20.0" fill="#c00"/>
|
||||
<line x1="142.0" y1="176.0" x2="142.0" y2="214.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="135.5" y="184.0" width="13" height="28.0" fill="#188a3e"/>
|
||||
<line x1="168.0" y1="148.0" x2="168.0" y2="194.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="161.5" y="156.0" width="13" height="28.0" fill="#188a3e"/>
|
||||
<line x1="194.0" y1="148.0" x2="194.0" y2="186.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="187.5" y="156.0" width="13" height="20.0" fill="#c00"/>
|
||||
<line x1="220.0" y1="168.0" x2="220.0" y2="210.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="213.5" y="176.0" width="13" height="24.0" fill="#c00"/>
|
||||
<line x1="246.0" y1="192.0" x2="246.0" y2="218.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="239.5" y="200.0" width="13" height="14.0" fill="#c00"/>
|
||||
<line x1="272.0" y1="180.0" x2="272.0" y2="216.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="265.5" y="188.0" width="13" height="26.0" fill="#188a3e"/>
|
||||
<line x1="298.0" y1="156.0" x2="298.0" y2="198.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="291.5" y="164.0" width="13" height="24.0" fill="#188a3e"/>
|
||||
<line x1="324.0" y1="132.0" x2="324.0" y2="174.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="317.5" y="144.0" width="13" height="20.0" fill="#188a3e"/>
|
||||
<line x1="116.0" y1="140.0" x2="116.0" y2="194.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="109.5" y="160.0" width="13" height="32.0" fill="#188a3e"/>
|
||||
<line x1="142.0" y1="152.0" x2="142.0" y2="186.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="135.5" y="160.0" width="13" height="16.0" fill="#c00"/>
|
||||
<line x1="168.0" y1="168.0" x2="168.0" y2="200.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="161.5" y="176.0" width="13" height="16.0" fill="#c00"/>
|
||||
<line x1="194.0" y1="156.0" x2="194.0" y2="194.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="187.5" y="160.0" width="13" height="32.0" fill="#188a3e"/>
|
||||
<line x1="220.0" y1="152.0" x2="220.0" y2="190.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="213.5" y="160.0" width="13" height="20.0" fill="#c00"/>
|
||||
<line x1="246.0" y1="172.0" x2="246.0" y2="200.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="239.5" y="180.0" width="13" height="12.0" fill="#c00"/>
|
||||
<line x1="272.0" y1="168.0" x2="272.0" y2="194.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="265.5" y="176.0" width="13" height="16.0" fill="#188a3e"/>
|
||||
<line x1="298.0" y1="152.0" x2="298.0" y2="186.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="291.5" y="160.0" width="13" height="16.0" fill="#188a3e"/>
|
||||
<line x1="324.0" y1="132.0" x2="324.0" y2="170.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="317.5" y="144.0" width="13" height="16.0" fill="#188a3e"/>
|
||||
<line x1="350.0" y1="116.0" x2="350.0" y2="154.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
<rect x="343.5" y="124.0" width="13" height="20.0" fill="#188a3e"/>
|
||||
<line x1="376.0" y1="88.0" x2="376.0" y2="134.0" stroke="#1a1a1a" stroke-width="1.2"/>
|
||||
@@ -38,7 +37,7 @@
|
||||
<rect x="395.5" y="64.0" width="13" height="32.0" fill="#188a3e"/>
|
||||
<line x1="206.0" y1="292.0" x2="241.6" y2="238.7" stroke="#c00" stroke-width="1.8"/>
|
||||
<polygon points="246.0,232.0 244.9,240.9 238.2,236.4" fill="#c00"/>
|
||||
<text x="206.0" y="306.0" fill="#c00" text-anchor="middle" style="font-weight:bold">sub 87.30 nu mai e double bottom:</text>
|
||||
<text x="206.0" y="306.0" fill="#c00" text-anchor="middle" style="font-weight:bold">sub 87.30 nu mai ține suportul weekly:</text>
|
||||
<text x="206.0" y="320.0" fill="#c00" text-anchor="middle" style="font-weight:bold">ideea de la pasul 1 a murit,</text>
|
||||
<text x="206.0" y="334.0" fill="#c00" text-anchor="middle" style="font-weight:bold">nu mai ai ce aștepta</text>
|
||||
<polyline points="370.0,124.0 376.0,124.0 376.0,228.0 370.0,228.0" fill="none" stroke="#c00" stroke-width="1.5"/><text x="382.0" y="180.0" fill="#c00" style="font-weight:bold">1R = 2.60 $</text><text x="24" y="379" fill="#333">Mărimea, cu aceeași regulă ca la buy hammer: 2 % dintr-un cont de 10.000 $ = 200 $;</text><text x="24" y="395" fill="#333">200 / 2.60 = 76.9 → 76 de acțiuni, pierdere maximă 197.60 $.</text><text x="24" y="411" fill="#555">87.30 e cifra materialului, nu marja mea de 5 cenți; suportul weekly 87.50 e construit de mine ca stopul</text><text x="24" y="427" fill="#555">acela să aibă sub ce sta. Materialul nu dă niciun procent fix de stop pentru MBT-10.</text></svg>
|
||||
<polyline points="370.0,124.0 376.0,124.0 376.0,228.0 370.0,228.0" fill="none" stroke="#c00" stroke-width="1.5"/><text x="382.0" y="180.0" fill="#c00" style="font-weight:bold">1R = 2.60 $</text><text x="24" y="379" fill="#333">Mărimea, cu aceeași regulă ca la buy hammer: 2 % dintr-un cont de 10.000 $ = 200 $;</text><text x="24" y="395" fill="#333">200 / 2.60 = 76.9 → 76 de acțiuni, pierdere maximă 197.60 $.</text><text x="24" y="411" fill="#555">87.30 și suportul weekly 88.00 sunt cifrele materialului, pe exemplul lui de 60 de minute —</text><text x="24" y="427" fill="#555">nu marja mea de 5 cenți. Materialul nu dă niciun procent fix de stop pentru MBT-10:</text><text x="24" y="443" fill="#555">stopul numește structura de sub el.</text></svg>
|
||||
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |