buy_doji: reparatiile de diagrame din verificare (11 puncte)

doji_forma nu mai foloseste 49.20 ca low al dojiului — era fix pretul
stopului, in prima diagrama pe care o vede un incepator. Bara e pe
50.10/49.25, cu procentele recalculate.

LABU: stopul e etichetat "pe cel mai jos dintre cele trei minime", nu
"sub minime"; zonele arata doua teste ale pivotului, cu "revenire peste
pivot 88.90" intre ele; numarul barei a iesit din desen, nota spune
"a 6-a bara dupa intrare", derivat din serie.

perechi_tf nu mai pune pretul TF-ului mare pe panoul TF-ului mic. aplus
nu mai numeste un nivel care nu e desenat. directie nu mai zice
"saptamanile" pe un panou daily. sell acopera toata cresterea, 14 bare.

transe: cele trei sageti nu mai converg intr-un ghem — fiecare are linia
ei cu pretul la capat; linia de intrare e desenata, ca parantezele de
risc sa plece de undeva. locatie arata 49.25, cifra din care iese 0,51 %.
stop si iesire: linii si sageti care taiau texte, mutate.

Jumatate din probleme erau aceeasi greseala: un pret scris de mana intr-o
eticheta, ramas in urma cand se schimba seria. Sunt acum aserttiuni care
o fac imposibila; PROGRESS.md spune care merita generalizata.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ThN7ixZrowca8aTGrK1MUJ
This commit is contained in:
Claude Agent
2026-09-19 21:33:15 +00:00
parent f71cbf5a86
commit a92a12a65c
31 changed files with 888 additions and 658 deletions

View File

@@ -8,7 +8,7 @@ Același pattern (trend → doji → confirmare), context opus:
ultimelor 10 bare — acumulare;
- dreapta (NU): uptrend 70 → 76.80, gap-up la open 78.20, doji lipit de
rezistența 78.50, confirmare close 79.30 pe volum sub medie („varză"), apoi
prețul cade înapoi sub 78.00.
prețul cade înapoi sub rezistența 78.50, de unde plecase.
Nivelurile 42.00 / 78.50 și cifrele de preț sunt construite de mine ca să
susțină etichetele și assert-urile din spec (materialul nu dă prețuri pentru
@@ -31,6 +31,8 @@ GRAY, RED, GREEN, BLUE, ORANGE = "#777", "#c00", "#188a3e", "#1a5fb4", "#b06000"
DOJI_A, CONF_A = 10, 11 # indicii în panoul A+
DOJI_N, CONF_N = 14, 15 # indicii în panoul NU
SUPORT_A = 42.00 # singurele prețuri DESENATE ca nivel; etichetele
REZIST_N = 78.50 # se scriu din ele, ca textul să nu ia altă cifră
# ============================================================ PANOUL A+ (24 bare)
# 10 bare de downtrend de la 52.00 spre 42.60, apoi doji, apoi confirmare.
@@ -56,7 +58,7 @@ doji_a, conf_a = cds_a[DOJI_A], cds_a[CONF_A]
# ============================================================ PANOUL NU (24 bare)
# uptrend 70 → 76.80 (14 bare), gap-up la open 78.20 + doji, confirmare 79.30
# pe volum slab, apoi cădere înapoi sub 78.00. Lista e manuală pentru că gap-ul
# pe volum slab, apoi cădere înapoi sub rezistența 78.50. Lista e manuală pentru că gap-ul
# (open > high-ul barei precedente) nu iese din `from_closes`.
BARE_NU = [
# o, h, l, c, vol
@@ -105,8 +107,12 @@ for tag, d in (("A+", doji_a), ("NU", doji_n)):
# suplimentare: structura promisă de spec
assert min(c.l for c in cds_a[:10]) > doji_a.l, "low-ul dojiului A+ nu e minimul"
assert cds_a[9].c < cds_a[0].c - 8, "downtrend A+ prea mic"
assert cds_n[CONF_N].c > 78.50 and cds_n[-1].c < 78.00, "NU nu cade sub 78.00 la final"
assert cds_n[13].c < 78.00 < cds_n[DOJI_N].o, "NU: uptrendul nu se oprește sub 78.00"
assert cds_n[CONF_N].c > REZIST_N, "NU: confirmarea nu iese peste rezistență"
assert cds_n[-1].c < REZIST_N, "NU: prețul nu cade înapoi sub rezistență la final"
assert cds_n[13].c < REZIST_N <= doji_n.h, "NU: uptrendul nu se oprește sub rezistență"
# bara pe care stă săgeata „cade înapoi sub …" trebuie chiar să fie sub nivel
CADE_N = next(i for i in range(CONF_N + 1, len(BARE_NU)) if cds_n[i].c < REZIST_N)
assert CADE_N == 17 and cds_n[18].c < REZIST_N, f"prima cădere sub nivel e bara {CADE_N}"
print(f"A+ doji {doji_a.h:.2f}/{doji_a.l:.2f} conf {conf_a.c:.2f} "
f"vol {VOLS_A[CONF_A]} > medie {media_a:.1f}")
@@ -117,7 +123,7 @@ print(f"NU doji {doji_n.h:.2f}/{doji_n.l:.2f} conf {conf_n.c:.2f} "
PW = 560 # lățimea fiecărui panou
ch_a = Chart(
candles=cds_a,
levels=[Level(42.00, "suport 42.00", GREEN, label_at="left")],
levels=[Level(SUPORT_A, f"suport {SUPORT_A:.2f}", GREEN, label_at="left")],
zones=[Zone(DOJI_A, DOJI_A, "", GREEN, p_top=43.2, p_bot=41.7)],
arrows=[Arrow(DOJI_A, "doji chiar pe nivel:\nvânzarea s-a oprit pe suport",
where="below", color=GREEN, dx=-40),
@@ -128,13 +134,14 @@ ch_a = Chart(
)
ch_n = Chart(
candles=cds_n,
levels=[Level(78.50, "rezistență 78.50", RED, label_at="right")],
levels=[Level(REZIST_N, f"rezistență {REZIST_N:.2f}", RED, label_at="right")],
# eticheta zonei ar urca peste titlul panoului (zona e chiar în vârf):
# textul stă pe săgeata din stânga
zones=[Zone(DOJI_N - 1, CONF_N, "", RED, p_top=79.62)],
arrows=[Arrow(DOJI_N, "gap-up în rezistență:\naici cumpără cei întârziați",
where="left", color=RED, dx=-30, dy=30),
Arrow(18, "cade înapoi sub 78.00:\nsemnalul a mințit", where="below", color=RED, dx=40)],
Arrow(18, f"cade înapoi sub rezistența {REZIST_N:.2f}:\nsemnalul a mințit",
where="below", color=RED, dx=40)],
mas=[], scale=22.0, gap=15, body_w=9, left=44, width=PW, vol_h=60,
vol_label="volum", title="Mediocru — gap-up în rezistență, volum varză",
)
@@ -268,13 +275,21 @@ for i in range(len(all_txt)):
# etichetele cerute de spec există în desen
assert "Surse" not in wrapper and ".md:" not in wrapper, "trimiteri la surse în SVG"
for cheie in ("suport 42.00", "doji chiar pe nivel", "vânzarea s-a oprit", "volum în creștere = acumulare",
"rezistență 78.50", "gap-up în rezistență", "cei întârziați",
for cheie in (f"suport {SUPORT_A:.2f}", "doji chiar pe nivel", "vânzarea s-a oprit", "volum în creștere = acumulare",
f"rezistență {REZIST_N:.2f}",
f"cade înapoi sub rezistența {REZIST_N:.2f}", "gap-up în rezistență", "cei întârziați",
"semnalul a mințit", "volum slab: nimeni mare nu cumpără",
"A+ — doji la suport, volum în acumulare",
"Mediocru — gap-up în rezistență, volum varză"):
assert cheie in wrapper, f"lipsește din desen: {cheie!r}"
# nicio etichetă nu are voie să numească un preț care nu e desenat ca nivel —
# exact bug-ul „cade înapoi sub 78.00" lângă singurul nivel desenat, 78.50
NIVELURI = {f"{SUPORT_A:.2f}", f"{REZIST_N:.2f}"}
for _, _, _, t in all_txt:
for n in re.findall(r"\d+\.\d\d", t):
assert n in NIVELURI, f"eticheta {t!r} numește prețul {n}, nedesenat ca nivel"
OUT.write_text(wrapper, encoding="utf-8")
print(f"scris {OUT.name}: {TOTAL_W}x{TOTAL_H:.0f}, "
f"{len(all_txt)} etichete, verificare OK")

View File

@@ -9,7 +9,7 @@ context opus:
- A+ : downtrend de 10 candele care se oprește pe suport/pivotul 42.00;
doji chiar pe nivel; confirmare peste high, cu volum în creștere
(acumulare). E „doji la nivel".
- Mediocru/NU: uptrend scurt, gap-up, doji în rezistența 78.00; confirmarea
- Mediocru/NU: uptrend scurt, gap-up, doji în rezistența 78.50; confirmarea
închide peste high, dar pe volum slab („varză") — miros de blow-off top.
Ambele au, tehnic, un Buy Doji valid; contextul e ce le separă.
@@ -36,10 +36,10 @@ mare: cumpărătorii mari intră"). Level „suport 42.00".
Panoul NU (24 candele): uptrend de la 70 la ~77, apoi un gap-up de la 76.80
la open 78.20, doji cu high 79.00 / low 78.10 chiar sub rezistența 78.50,
apoi confirmare close 79.30 pe volum sub media pe 10 bare, după care prețul
cade înapoi sub 78.00. Adnotări: zonă roșie peste gap-up + doji + confirmare, cu săgeata „gap-up în
cade înapoi sub rezistența 78.50. Adnotări: zonă roșie peste gap-up + doji + confirmare, cu săgeata „gap-up în
rezistență: aici cumpără cei întârziați"; săgeată spre volumul confirmării
(„volum slab: nimeni mare nu cumpără"); săgeată spre căderea de după („cade
înapoi sub 78.00: semnalul a mințit"). Level „rezistență 78.50".
înapoi sub rezistența 78.50: semnalul a mințit"). Level „rezistență 78.50".
Fără linie de surse în SVG — trimiterile stau la finalul capitolului.
Nivelurile 42.00 / 78.50 / cifrele de preț sunt construite (materialul nu dă
prețuri pentru acest contrast); regulile și citatele de mai sus sunt din curs.

View File

@@ -170,6 +170,6 @@
<text x="181.5" y="128.2" fill="#c00" text-anchor="end" style="font-weight:bold">aici cumpără cei întârziați</text>
<line x1="354.0" y1="154.6" x2="319.6" y2="119.0" stroke="#c00" stroke-width="1.8"/>
<polygon points="314.0,113.2 322.4,116.2 316.7,121.8" fill="#c00"/>
<text x="354.0" y="168.6" fill="#c00" text-anchor="middle" style="font-weight:bold">cade înapoi sub 78.00:</text>
<text x="354.0" y="168.6" fill="#c00" text-anchor="middle" style="font-weight:bold">cade înapoi sub rezistența 78.50:</text>
<text x="354.0" y="182.6" fill="#c00" text-anchor="middle" style="font-weight:bold">semnalul a mințit</text>
<text x="260.5" y="392.0" fill="#c00" style="font-weight:bold">volum slab: nimeni mare nu cumpără</text></g></svg>

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -125,8 +125,8 @@ candles(WK, WX0, WGAP, yw)
text(xw(7), yw(WK[7][2]) + 16, "doji weekly", fill=ORANGE, anchor="middle", bold=True)
# săgeata weekly: ce + de ce
arrow(300, yw(WK[8][3]) - 6, xw(8) + 12, yw(WK[8][3]) - 6, GREEN)
text(306, yw(WK[8][3]) - 10, "weekly: Buy Doji confirmat (close 81.30, peste high-ul doji-ului 79.80)",
fill=GREEN, bold=True)
text(306, yw(WK[8][3]) - 10, f"weekly: Buy Doji confirmat (close {WK[8][3]:.2f}, "
f"peste high-ul doji-ului {WK[7][1]:.2f})", fill=GREEN, bold=True)
text(306, yw(WK[8][3]) + 8, "deci direcția permisă e LONG: pe daily cauți doar Buy Doji",
fill=GREEN)
w_bottom = yw(min(b[2] for b in WK))
@@ -138,8 +138,8 @@ dmax = max(b[1] for b in DY)
yd = lambda p: DT + (dmax - p) * DS # noqa: E731
xd = lambda i: DX0 + i * DGAP # noqa: E731
line(20, w_bottom + 34, W - 20, w_bottom + 34, "#ddd", 1)
text(20, w_bottom + 56, "daily: săptămânile de după confirmare (open 81.30 = close-ul ei)",
fill="#555", bold=True)
text(20, w_bottom + 56, f"daily: zilele de după confirmarea weekly "
f"(open {DY[0][0]:.2f} = close-ul ei)", fill="#555", bold=True)
LX1, LX2, COL = xd(9) - 10, 392, 400
y_sl, y_e, y_tp = yd(SL), yd(ENTRY), yd(TP1)
@@ -148,9 +148,9 @@ rect(xd(9) - 8, yd(DY[9][1]) - 3, DGAP + 16, yd(DY[10][2]) - yd(DY[9][1]) + 6, O
line(LX1, y_sl, LX2, y_sl, RED, 1.5, "6 3")
line(xd(10) - 8, y_e, LX2, y_e, ORANGE, 1.5, "6 3")
line(xd(10) - 8, y_tp, LX2, y_tp, GRAY, 1.5, "2 3")
text(COL, y_sl + 4, "stop 84.85 = 5 cenți peste high-ul de 4 candele", fill=RED, size=11)
text(COL, y_e + 4, "intrare short 83.60", fill=ORANGE, size=11)
text(COL, y_tp + 4, "ținta 82.35 — neatinsă (a scăzut o zi, la 83.00)",
text(COL, y_sl + 4, f"stop {SL:.2f} = 5 cenți peste high-ul de 4 candele", fill=RED, size=11)
text(COL, y_e + 4, f"intrare short {ENTRY:.2f}", fill=ORANGE, size=11)
text(COL, y_tp + 4, f"ținta {TP1:.2f} — neatinsă (a scăzut o zi, la {LOW_AFTER:.2f})",
fill=GRAY, size=11)
candles(DY, DX0, DGAP, yd)
@@ -160,16 +160,16 @@ out.append(f'<circle cx="{cx14:.1f}" cy="{y_sl:.1f}" r="7" fill="none" stroke="{
f'stroke-width="2"/>')
y_hit = DT - 40
arrow(560, y_hit + 6, cx14 + 9, y_sl - 9, RED)
text(568, y_hit, "aici te-a scos: stopul 84.85, lovit a patra zi", fill=RED, bold=True)
text(568, y_hit, f"aici te-a scos: stopul {SL:.2f}, lovit a {HIT - 10}-a zi", fill=RED, bold=True)
text(568, y_hit + 18, "banii mari de pe weekly cumpără mai departe", fill=RED)
# intrarea short: săgeată de jos-dreapta spre close-ul confirmării
y_bot = yd(min(b[2] for b in DY))
x_e = xd(12) + 6
arrow(x_e, y_tp + 30, xd(10) + 7, y_e + 4, ORANGE)
text(x_e + 6, y_tp + 28, "aici ai intrat SHORT, la 83.60: Sell Doji corect ca formă",
text(x_e + 6, y_tp + 28, f"aici ai intrat SHORT, la {ENTRY:.2f}: Sell Doji corect ca formă",
fill=ORANGE, bold=True)
text(x_e + 6, y_tp + 46, "(close sub low-ul doji-ului 83.95) — dar contra weekly-ului",
text(x_e + 6, y_tp + 46, f"(close sub low-ul doji-ului {DY[9][2]:.2f}) — dar contra weekly-ului",
fill=ORANGE)
y0 = max(y_bot, y_tp + 46) + 34

View File

@@ -28,7 +28,7 @@
<text x="306.0" y="150.2" fill="#188a3e" style="font-weight:bold">weekly: Buy Doji confirmat (close 81.30, peste high-ul doji-ului 79.80)</text>
<text x="306.0" y="168.2" fill="#188a3e">deci direcția permisă e LONG: pe daily cauți doar Buy Doji</text>
<line x1="20.0" y1="238.6" x2="880.0" y2="238.6" stroke="#ddd" stroke-width="1"/>
<text x="20.0" y="260.6" fill="#555" style="font-weight:bold">daily: săptămânile de după confirmare (open 81.30 = close-ul ei)</text>
<text x="20.0" y="260.6" fill="#555" style="font-weight:bold">daily: zilele de după confirmarea weekly (open 81.30 = close-ul ei)</text>
<rect x="214.0" y="371.6" width="34.0" height="60.0" fill="#d06a00" fill-opacity="0.15" stroke="#d06a00" rx="3"/>
<line x1="212.0" y1="372.6" x2="392.0" y2="372.6" stroke="#c00" stroke-width="1.5" stroke-dasharray="6 3"/>
<line x1="232.0" y1="422.6" x2="392.0" y2="422.6" stroke="#d06a00" stroke-width="1.5" stroke-dasharray="6 3"/>
@@ -73,7 +73,7 @@
<circle cx="312.0" cy="372.6" r="7" fill="none" stroke="#c00" stroke-width="2"/>
<line x1="560.0" y1="280.6" x2="329.5" y2="360.6" stroke="#c00" stroke-width="1.8"/>
<polygon points="321.0,363.6 328.0,356.4 331.0,364.9" fill="#c00"/>
<text x="568.0" y="274.6" fill="#c00" style="font-weight:bold">aici te-a scos: stopul 84.85, lovit a patra zi</text>
<text x="568.0" y="274.6" fill="#c00" style="font-weight:bold">aici te-a scos: stopul 84.85, lovit a 4-a zi</text>
<text x="568.0" y="292.6" fill="#c00">banii mari de pe weekly cumpără mai departe</text>
<line x1="282.0" y1="502.6" x2="250.8" y2="434.8" stroke="#d06a00" stroke-width="1.8"/>
<polygon points="247.0,426.6 254.9,432.9 246.7,436.7" fill="#d06a00"/>

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env python3
"""Ce e un doji și ce nu — patru candele cu același high 50.10 și low 49.20.
"""Ce e un doji și ce nu — patru candele cu același high 50.10 și low 49.25.
Citește `gen/strategii/buy_doji_doji_forma.spec.txt` și scrie
`gen/strategii/buy_doji_doji_forma.svg`. E prima imagine din capitol: cine o
@@ -18,21 +18,21 @@ from pathlib import Path
OUT = Path(__file__).with_suffix(".svg")
GREEN, RED, GREY, BLUE = "#188a3e", "#c00", "#555", "#1a5fb4"
H, L = 50.10, 49.20
H, L = 50.10, 49.25
RNG = H - L
# (nume, o, h, l, c, verdict, rânduri de etichetă sub candelă)
CANDLES = [
("A", 49.60, 50.10, 49.20, 49.55, "DA", ["DA: corp 0.05", "= 5,6 % din înălțime"]),
("B", 49.62, 50.10, 49.20, 49.53, "DA", ["DA, la limită:", "corp 0.09 = 10 %"]),
("C", 49.80, 50.10, 49.20, 49.50, "NU", ["NU: corp 0.30", "= 33 %"]),
("D", 50.05, 50.10, 49.20, 50.10, "NU", ["NU: corp mic (5,6 %),", "dar fără fitil sus"]),
("A", 49.60, 50.10, 49.25, 49.55, "DA", ["DA: corp 0.05", "= 5,9 % din înălțime"]),
("B", 49.62, 50.10, 49.25, 49.54, "DA", ["DA, la limită:", "corp 0.08 = 9,4 %"]),
("C", 49.80, 50.10, 49.25, 49.50, "NU", ["NU: corp 0.30", "= 35 %"]),
("D", 50.05, 50.10, 49.25, 50.10, "NU", ["NU: corp mic (5,9 %),", "dar fără fitil sus"]),
]
# --- assert-urile din spec --------------------------------------------------
ratio = {n: round(abs(c - o) / (h - l), 4) for n, o, h, l, c, *_ in CANDLES}
for n, o, h, l, c, *_ in CANDLES:
assert h == H and l == L, (n, h, l) # 1
assert ratio == {"A": 0.0556, "B": 0.1000, "C": 0.3333, "D": 0.0556}, ratio # 2
assert ratio == {"A": 0.0588, "B": 0.0941, "C": 0.3529, "D": 0.0588}, ratio # 2
for n, o, h, l, c, *_ in CANDLES[:2]: # 3
assert ratio[n] <= 0.10 and min(o, c) > l and max(o, c) < h, n
assert ratio["C"] > 0.10 # 4
@@ -85,7 +85,7 @@ def arrow(x1, y1, x2, y2, color, lines, anchor="start"):
text(x1 + dx, y0 + 14 * k, s, color, anchor, bold=(k == 0))
text(24, 30, "Ce e un doji și ce nu — aceeași bară, 50.10 sus și 49.20 jos", "#333",
text(24, 30, "Ce e un doji și ce nu — aceeași bară, 50.10 sus și 49.25 jos", "#333",
bold=True, size=14)
# zonele: A+B sunt doji, C+D nu
@@ -99,7 +99,7 @@ for p in (H, L):
t(f'<line x1="{XS[0] - 100}" y1="{y(p):.1f}" x2="{W - 24}" y2="{y(p):.1f}" '
f'stroke="#bbb" stroke-dasharray="4 3"/>')
text(24, y(H) - 6, "cât de sus a urcat prețul: 50.10")
text(24, y(L) + 14, "cât de jos a coborât: 49.20")
text(24, y(L) + 14, "cât de jos a coborât: 49.25")
for (n, o, h, l, c, verdict, lines), x in zip(CANDLES, XS):
color = GREEN if c >= o else RED
@@ -128,7 +128,7 @@ text(xA + 20, y(cA) + 10, "close 49.55")
# --- săgețile pe contraexemple ----------------------------------------------
xC, xD = XS[2], XS[3]
arrow(xC + 34, y(H) - 112, xC + 14, y(49.78), RED,
lines=["corp prea gros (33 %)", "aici una din tabere a câștigat —", "nu mai e indecizie"])
lines=["corp prea gros (35 %)", "aici una din tabere a câștigat —", "nu mai e indecizie"])
arrow(xD, y(H) - 34, xD, y(H) - 4, RED, anchor="middle",
lines=["fără fitil sus", "regula cere fitil în ambele părți"])

View File

@@ -5,24 +5,29 @@ tip: DEFINIȚIE de o candelă (stil vechi permis de STYLE.md: 4 cande
proști": 2 zone dreptunghiulare + 5 săgeți cu text (CE + DE CE).
destinație: summaries/17_STRATEGII/01_buy_doji.md, nivelul 1 („Ce e un doji")
cheie markdown: <!-- DIAGRAMA: doji_forma -->
titlu SVG: „Ce e un doji și ce nu — aceeași bară, 50.10 sus și 49.20 jos"
titlu SVG: „Ce e un doji și ce nu — aceeași bară, 50.10 sus și 49.25 jos"
CE TREBUIE SĂ DEMONSTREZE
-------------------------
Testul „corp ≤ 10 % din range, fitil în ambele părți", pe patru candele cu
ACELAȘI high 50.10 și ACELAȘI low 49.20 (range 0.90). Diferă doar corpul.
ACELAȘI high 50.10 și ACELAȘI low 49.25 (range 0.85). Diferă doar corpul.
Low-ul e 49.25, nu 49.20: 49.20 e PREȚUL STOPULUI în restul capitolului, iar
prima diagramă a capitolului nu are voie să-l confunde cu low-ul dojiului
(corectat 19.09.2026).
CANDELELE (o, h, l, c) și eticheta de sub fiecare
-------------------------------------------------
A (49.60, 50.10, 49.20, 49.55) „DA: corp 0.05 = 5.6 % din range"
B (49.62, 50.10, 49.20, 49.53) „DA, la limită: corp 0.09 = 10 % (parametrul 10)"
C (49.80, 50.10, 49.20, 49.50) „NU: corp 0.30 = 33 %"
D (50.05, 50.10, 49.20, 50.10) „NU: corp mic (5.6 %), dar fără fitil sus"
A (49.60, 50.10, 49.25, 49.55) „DA: corp 0.05 = 5,9 % din range"
B (49.62, 50.10, 49.25, 49.54) „DA, la limită: corp 0.08 = 9,4 % (parametrul 10)"
C (49.80, 50.10, 49.25, 49.50) „NU: corp 0.30 = 35 %"
D (50.05, 50.10, 49.25, 50.10) „NU: corp mic (5,9 %), dar fără fitil sus"
B nu mai pică rotund pe 10 % (ar fi cerut corp 0.085, preț urât); regula
„corpul <= 10 % din înălțime" e ce contează, nu cifra rotundă.
Verdictul e în eticheta de sub candelă („DA: …" verde / „NU: …" roșu) și în
eticheta zonei; nu se mai scrie DA/NU mare deasupra barei (se bătea cap în cap
cu textul săgeților).
Etichete de preț pe A: „cât de sus a urcat prețul: 50.10", „cât de jos a
coborât: 49.20", „open 49.60", „close 49.55" (open deasupra lui close, pentru
coborât: 49.25", „open 49.60", „close 49.55" (open deasupra lui close, pentru
că open > close; verifică ordinea pe axă).
ZONE (dreptunghiuri de evidențiere, fill-opacity 0.10)
@@ -35,13 +40,13 @@ pe A, din stânga: spre fitilul de sus („fitilul de sus / cumpărătorii au
împins, dar n-au ținut"); spre corp („corpul: aproape o linie / open și close
aproape egale — nimeni n-a câștigat ziua"); spre fitilul de jos („fitilul de
jos / vânzătorii au împins, dar n-au ținut").
pe C, de sus: „corp prea gros (33 %) / aici una din tabere a câștigat — nu mai
pe C, de sus: „corp prea gros (35 %) / aici una din tabere a câștigat — nu mai
e indecizie". pe D, de sus: „fără fitil sus / regula cere fitil în ambele părți".
ASSERT-URI
----------
1. Toate patru: h == 50.10, l == 49.20.
2. corp/range: A 0.0556, B 0.1000, C 0.3333, D 0.0556 (4 zecimale).
1. Toate patru: h == 50.10, l == 49.25.
2. corp/range: A 0.0588, B 0.0941, C 0.3529, D 0.0588 (4 zecimale).
3. A, B: corp/range <= 0.10 și min(o,c) > l și max(o,c) < h (fitil ambele părți).
4. C: corp/range > 0.10. D: max(o,c) == h (fitil sus zero).
5. y(open A) < y(close A) în pixeli (open mai sus pe ecran, fiindcă e preț mai mare).
@@ -49,7 +54,7 @@ ASSERT-URI
SURSA
-----
- Doji: open ≈ close, corp foarte mic față de range, fitil în ambele părți:
summaries/03_MODUL_2/13_strategia_3_byh.md:15-30 (candela 50.10/49.20/49.60/49.55
summaries/03_MODUL_2/13_strategia_3_byh.md:15-30 (candela 50.10/49.25/49.60/49.55
e cea din lecție, cu cifrele sumarizatorului).
- Parametrul standard de doji pe 10 (nu 5): summaries/09_QA/28_2025-05-27.md:343-349.
- Candelele B, C, D sunt CONSTRUITE pentru contrast.

View File

@@ -1,29 +1,29 @@
<svg viewBox="0 0 1000 546" xmlns="http://www.w3.org/2000/svg" style="width:100%;height:auto;font:12px sans-serif">
<text x="24.0" y="30.0" fill="#333" text-anchor="start" style="font-weight:bold;font-size:14px">Ce e un doji și ce nu — aceeași bară, 50.10 sus și 49.20 jos</text>
<rect x="292.0" y="180.0" width="260.0" height="320.0" fill="#188a3e" fill-opacity="0.10" stroke="#188a3e" stroke-width="1"/>
<svg viewBox="0 0 1000 533" xmlns="http://www.w3.org/2000/svg" style="width:100%;height:auto;font:12px sans-serif">
<text x="24.0" y="30.0" fill="#333" text-anchor="start" style="font-weight:bold;font-size:14px">Ce e un doji și ce nu — aceeași bară, 50.10 sus și 49.25 jos</text>
<rect x="292.0" y="180.0" width="260.0" height="307.0" fill="#188a3e" fill-opacity="0.10" stroke="#188a3e" stroke-width="1"/>
<text x="298.0" y="173.0" fill="#188a3e" text-anchor="start" style="font-weight:bold;font-size:12px">doji</text>
<rect x="628.0" y="180.0" width="306.0" height="320.0" fill="#c00" fill-opacity="0.10" stroke="#c00" stroke-width="1"/>
<rect x="628.0" y="180.0" width="306.0" height="307.0" fill="#c00" fill-opacity="0.10" stroke="#c00" stroke-width="1"/>
<text x="634.0" y="173.0" fill="#c00" text-anchor="start" style="font-weight:bold;font-size:12px">nu e doji</text>
<line x1="250" y1="210.0" x2="976" y2="210.0" stroke="#bbb" stroke-dasharray="4 3"/>
<line x1="250" y1="444.0" x2="976" y2="444.0" stroke="#bbb" stroke-dasharray="4 3"/>
<line x1="250" y1="431.0" x2="976" y2="431.0" stroke="#bbb" stroke-dasharray="4 3"/>
<text x="24.0" y="204.0" fill="#555" text-anchor="start">cât de sus a urcat prețul: 50.10</text>
<text x="24.0" y="458.0" fill="#555" text-anchor="start">cât de jos a coborât: 49.20</text>
<line x1="350" y1="210.0" x2="350" y2="444.0" stroke="#1a1a1a" stroke-width="1.4"/>
<text x="24.0" y="445.0" fill="#555" text-anchor="start">cât de jos a coborât: 49.25</text>
<line x1="350" y1="210.0" x2="350" y2="431.0" stroke="#1a1a1a" stroke-width="1.4"/>
<rect x="337.0" y="340.0" width="26" height="13.0" fill="#c00"/>
<text x="350.0" y="472.0" fill="#188a3e" text-anchor="middle" style="font-weight:bold;font-size:12px">DA: corp 0.05</text>
<text x="350.0" y="488.0" fill="#188a3e" text-anchor="middle">= 5,6 % din înălțime</text>
<line x1="490" y1="210.0" x2="490" y2="444.0" stroke="#1a1a1a" stroke-width="1.4"/>
<rect x="477.0" y="334.8" width="26" height="23.4" fill="#c00"/>
<text x="490.0" y="472.0" fill="#188a3e" text-anchor="middle" style="font-weight:bold;font-size:12px">DA, la limită:</text>
<text x="490.0" y="488.0" fill="#188a3e" text-anchor="middle">corp 0.09 = 10 %</text>
<line x1="690" y1="210.0" x2="690" y2="444.0" stroke="#1a1a1a" stroke-width="1.4"/>
<text x="350.0" y="459.0" fill="#188a3e" text-anchor="middle" style="font-weight:bold;font-size:12px">DA: corp 0.05</text>
<text x="350.0" y="475.0" fill="#188a3e" text-anchor="middle">= 5,9 % din înălțime</text>
<line x1="490" y1="210.0" x2="490" y2="431.0" stroke="#1a1a1a" stroke-width="1.4"/>
<rect x="477.0" y="334.8" width="26" height="20.8" fill="#c00"/>
<text x="490.0" y="459.0" fill="#188a3e" text-anchor="middle" style="font-weight:bold;font-size:12px">DA, la limită:</text>
<text x="490.0" y="475.0" fill="#188a3e" text-anchor="middle">corp 0.08 = 9,4 %</text>
<line x1="690" y1="210.0" x2="690" y2="431.0" stroke="#1a1a1a" stroke-width="1.4"/>
<rect x="677.0" y="288.0" width="26" height="78.0" fill="#c00"/>
<text x="690.0" y="472.0" fill="#c00" text-anchor="middle" style="font-weight:bold;font-size:12px">NU: corp 0.30</text>
<text x="690.0" y="488.0" fill="#c00" text-anchor="middle">= 33 %</text>
<line x1="860" y1="210.0" x2="860" y2="444.0" stroke="#1a1a1a" stroke-width="1.4"/>
<text x="690.0" y="459.0" fill="#c00" text-anchor="middle" style="font-weight:bold;font-size:12px">NU: corp 0.30</text>
<text x="690.0" y="475.0" fill="#c00" text-anchor="middle">= 35 %</text>
<line x1="860" y1="210.0" x2="860" y2="431.0" stroke="#1a1a1a" stroke-width="1.4"/>
<rect x="847.0" y="210.0" width="26" height="13.0" fill="#188a3e"/>
<text x="860.0" y="472.0" fill="#c00" text-anchor="middle" style="font-weight:bold;font-size:12px">NU: corp mic (5,6 %),</text>
<text x="860.0" y="488.0" fill="#c00" text-anchor="middle">dar fără fitil sus</text>
<text x="860.0" y="459.0" fill="#c00" text-anchor="middle" style="font-weight:bold;font-size:12px">NU: corp mic (5,9 %),</text>
<text x="860.0" y="475.0" fill="#c00" text-anchor="middle">dar fără fitil sus</text>
<line x1="290.0" y1="256.8" x2="339.4" y2="272.6" stroke="#1a5fb4" stroke-width="1.6"/>
<polygon points="347.0,275.0 338.2,276.4 340.6,268.8" fill="#1a5fb4"/>
<text x="284.0" y="253.8" fill="#1a5fb4" text-anchor="end" style="font-weight:bold;font-size:12px">fitilul de sus</text>
@@ -41,12 +41,12 @@
<text x="370.0" y="363.0" fill="#555" text-anchor="start">close 49.55</text>
<line x1="724.0" y1="98.0" x2="704.8" y2="285.2" stroke="#c00" stroke-width="1.6"/>
<polygon points="704.0,293.2 700.8,284.8 708.8,285.6" fill="#c00"/>
<text x="730.0" y="88.0" fill="#c00" text-anchor="start" style="font-weight:bold;font-size:12px">corp prea gros (33 %)</text>
<text x="730.0" y="88.0" fill="#c00" text-anchor="start" style="font-weight:bold;font-size:12px">corp prea gros (35 %)</text>
<text x="730.0" y="102.0" fill="#c00" text-anchor="start">aici una din tabere a câștigat —</text>
<text x="730.0" y="116.0" fill="#c00" text-anchor="start">nu mai e indecizie</text>
<line x1="860.0" y1="176.0" x2="860.0" y2="198.0" stroke="#c00" stroke-width="1.6"/>
<polygon points="860.0,206.0 856.0,198.0 864.0,198.0" fill="#c00"/>
<text x="860.0" y="152.0" fill="#c00" text-anchor="middle" style="font-weight:bold;font-size:12px">fără fitil sus</text>
<text x="860.0" y="166.0" fill="#c00" text-anchor="middle">regula cere fitil în ambele părți</text>
<text x="24.0" y="530.0" fill="#555" text-anchor="start">Doji = corpul e cel mult 10 % din înălțimea totală a barei (aici înălțimea e 0.90) și are fitil și sus, și jos.</text>
<text x="24.0" y="517.0" fill="#555" text-anchor="start">Doji = corpul e cel mult 10 % din înălțimea totală a barei (aici înălțimea e 0.85) și are fitil și sus, și jos.</text>
</svg>

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

@@ -75,8 +75,9 @@ ch_a = Chart(
where="below", price=steps[0][1], color=ORANGE, dx=130, dy=40),
Arrow(steps[1][0] - S, "încă un gap: linia urcă la 52.60\nurcă doar, nu coboară niciodată",
where="above", price=steps[1][1], color=ORANGE, dx=150),
# dx mare: cu dx=110 tija săgeții trecea peste textul portocaliu al gap-ului
Arrow(iesire - S, "prima închidere sub linie: ieși\ncu a doua treime, la 52.30 (+1.58R)",
where="below", price=EXIT_A, color=RED, dx=110, dy=96),
where="below", price=EXIT_A, color=RED, dx=250, dy=96),
],
title="A — prima treime la țintă, a doua pe trailing stop",
**common,
@@ -95,8 +96,6 @@ ch_b = Chart(
title="B — limita de 8 candele: nici ținta, nici stopul",
**common,
)
for k, c in enumerate(opt, 1):
c.tag = str(k)
def panou(ch, sus_de=0.0):
@@ -131,10 +130,16 @@ extra_a.append(f'<text x="24" y="{Y(SL) + 100:.1f}" fill="{GREY}">A treia treime
h_a = max(h_a, Y(SL) + 112)
body_b, h_b, bx, by = panou(ch_b, h_a + VGAP)
y_num = ch_b._y(min(c.l for c in opt)) + by + 18 # un singur rând, lipit de bare
extra_b = [
f'<text x="{ch_b._cx(cf + 1) + bx - 6:.1f}" y="{ch_b._y(TP1) + by - 8:.1f}" fill="{GREY}" '
f'style="font-weight:bold">8 candele în care nu se întâmplă nimic</text>',
]
for k, c in enumerate(opt, 1):
col = GREEN if c.c >= c.o else RED
extra_b.append(f'<text x="{ch_b._cx(cf + k) + bx:.1f}" y="{y_num:.1f}" fill="{col}" '
f'text-anchor="middle" style="font-weight:bold">{k}</text>')
assert y_num - (ch_b._y(min(c.l for c in opt)) + by) <= 24, "numerele stau prea departe de bare"
H = h_b + 8
svg = "\n ".join([
f'<svg viewBox="0 0 {W} {H:.0f}" xmlns="http://www.w3.org/2000/svg" '

View File

@@ -49,3 +49,11 @@ SURSA
- Trei poziții (1/3 la țintă, 1/3 pe trail, 1/3 mai departe): :204-213.
- Limita de 8 candele: :201-202.
- Barele de după intrare din panoul B sunt CONSTRUITE.
LIZIBILITATE
------------
- Panoul A: textul săgeții roșii („prima închidere sub linie") stă mult la
dreapta (dx 250), altfel tija ei trece peste textul portocaliu al gap-ului.
- Panoul B: numerele 1-8 ale candelelor NU se pun ca `Candle.tag` — Chart le
desenează sub tot panoul, la ~90 px de barele pe care le numără. Se desenează
manual, pe un rând comun la 18 px sub cel mai jos low al celor 8.

View File

@@ -1,4 +1,4 @@
<svg viewBox="0 0 760 795" xmlns="http://www.w3.org/2000/svg" style="width:100%;height:auto;font:12px sans-serif">
<svg viewBox="0 0 760 779" 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">A — prima treime la țintă, a doua pe trailing stop</text>
<rect x="146.5" y="176.0" width="73.0" height="96.0" fill="#188a3e" fill-opacity="0.08" stroke="#188a3e" stroke-width="1"/>
<rect x="218.5" y="122.0" width="163.0" height="84.0" fill="#1a5fb4" fill-opacity="0.08" stroke="#1a5fb4" stroke-width="1"/>
@@ -58,10 +58,10 @@
<polygon points="354.0,146.0 361.2,140.7 362.6,148.6" fill="#b06000"/>
<text x="504.0" y="101.0" fill="#b06000" text-anchor="middle" style="font-weight:bold">încă un gap: linia urcă la 52.60</text>
<text x="504.0" y="115.0" fill="#b06000" text-anchor="middle" style="font-weight:bold">urcă doar, nu coboară niciodată</text>
<line x1="482.0" y1="288.0" x2="377.4" y2="171.9" stroke="#c00" stroke-width="1.8"/>
<polygon points="372.0,166.0 380.3,169.3 374.4,174.6" fill="#c00"/>
<text x="482.0" y="302.0" fill="#c00" text-anchor="middle" style="font-weight:bold">prima închidere sub linie: ieși</text>
<text x="482.0" y="316.0" fill="#c00" text-anchor="middle" style="font-weight:bold">cu a doua treime, la 52.30 (+1.58R)</text>
<line x1="622.0" y1="288.0" x2="379.2" y2="169.5" stroke="#c00" stroke-width="1.8"/>
<polygon points="372.0,166.0 380.9,165.9 377.4,173.1" fill="#c00"/>
<text x="622.0" y="302.0" fill="#c00" text-anchor="middle" style="font-weight:bold">prima închidere sub linie: ieși</text>
<text x="622.0" y="316.0" fill="#c00" text-anchor="middle" style="font-weight:bold">cu a doua treime, la 52.30 (+1.58R)</text>
<polyline points="239.0,176.0 347.0,176.0 347.0,150.0 379.0,150.0" fill="none" stroke="#b06000" stroke-width="2"/>
<text x="386.0" y="154.0" fill="#b06000" style="font-weight:bold">linia de trailing stop</text>
<text x="150.0" y="346.0" fill="#188a3e" style="font-weight:bold">prima treime: de la intrare la ținta 1:1</text>
@@ -92,31 +92,31 @@
<rect x="151.5" y="650.0" width="9" height="20.0" fill="#188a3e"/>
<line x1="174.0" y1="636.0" x2="174.0" y2="656.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="169.5" y="642.0" width="9" height="8.0" fill="#188a3e"/>
<text x="174.0" y="763.0" fill="#188a3e" text-anchor="middle" style="font-weight:bold">1</text>
<line x1="192.0" y1="636.0" x2="192.0" y2="660.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="187.5" y="642.0" width="9" height="12.0" fill="#c00"/>
<text x="192.0" y="763.0" fill="#c00" text-anchor="middle" style="font-weight:bold">2</text>
<line x1="210.0" y1="624.0" x2="210.0" y2="660.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="205.5" y="630.0" width="9" height="24.0" fill="#188a3e"/>
<text x="210.0" y="763.0" fill="#188a3e" text-anchor="middle" style="font-weight:bold">3</text>
<line x1="228.0" y1="624.0" x2="228.0" y2="652.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="223.5" y="630.0" width="9" height="16.0" fill="#c00"/>
<text x="228.0" y="763.0" fill="#c00" text-anchor="middle" style="font-weight:bold">4</text>
<line x1="246.0" y1="616.0" x2="246.0" y2="652.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="241.5" y="622.0" width="9" height="24.0" fill="#188a3e"/>
<text x="246.0" y="763.0" fill="#188a3e" text-anchor="middle" style="font-weight:bold">5</text>
<line x1="264.0" y1="616.0" x2="264.0" y2="640.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="259.5" y="622.0" width="9" height="12.0" fill="#c00"/>
<text x="264.0" y="763.0" fill="#c00" text-anchor="middle" style="font-weight:bold">6</text>
<line x1="282.0" y1="612.0" x2="282.0" y2="640.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="277.5" y="618.0" width="9" height="16.0" fill="#188a3e"/>
<text x="282.0" y="763.0" fill="#188a3e" text-anchor="middle" style="font-weight:bold">7</text>
<line x1="300.0" y1="612.0" x2="300.0" y2="644.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="295.5" y="618.0" width="9" height="20.0" fill="#c00"/>
<text x="300.0" y="763.0" fill="#c00" text-anchor="middle" style="font-weight:bold">8</text>
<line x1="420.0" y1="708.0" x2="307.0" y2="645.9" stroke="#555" stroke-width="1.8"/>
<polygon points="300.0,642.0 308.9,642.4 305.1,649.4" fill="#555"/>
<text x="420.0" y="722.0" fill="#555" text-anchor="middle" style="font-weight:bold">a 8-a candelă: ieși oricum, la close 50.70 (+0.25R)</text>
<text x="420.0" y="736.0" fill="#555" text-anchor="middle" style="font-weight:bold">banii blocați aici lipsesc din alt trade</text>
<text x="168.0" y="594.0" fill="#555" style="font-weight:bold">8 candele în care nu se întâmplă nimic</text>
<text x="174.0" y="678.0" fill="#188a3e" text-anchor="middle" style="font-weight:bold">1</text>
<text x="192.0" y="678.0" fill="#c00" text-anchor="middle" style="font-weight:bold">2</text>
<text x="210.0" y="678.0" fill="#188a3e" text-anchor="middle" style="font-weight:bold">3</text>
<text x="228.0" y="678.0" fill="#c00" text-anchor="middle" style="font-weight:bold">4</text>
<text x="246.0" y="678.0" fill="#188a3e" text-anchor="middle" style="font-weight:bold">5</text>
<text x="264.0" y="678.0" fill="#c00" text-anchor="middle" style="font-weight:bold">6</text>
<text x="282.0" y="678.0" fill="#188a3e" text-anchor="middle" style="font-weight:bold">7</text>
<text x="300.0" y="678.0" fill="#c00" text-anchor="middle" style="font-weight:bold">8</text>
</svg>

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -129,8 +129,13 @@ assert abs(TP1 - 97.55) < 1e-9, f"ținta 1:1 = {TP1}, capitolul spune 97.55"
R = (TP - ENTRY) / (ENTRY - SL)
assert 3.2 <= R <= 3.4, f"{R:.2f}R, capitolul spune „cam 3,3R”"
I_TP1 = next(i for i in range(35, len(cds)) if cds[i].h >= TP1) # prima bară peste 1:1
cds[I_TP1].note = (f"ținta 1:1 ({TP1:.2f}) e atinsă pe bara {I_TP1}: acolo vinzi o treime, "
"restul merge mai departe — de asta nu vinzi tot la 1:1")
# „a câta bară după intrare" — numărătoare fără ambiguitate 0/1, spre deosebire
# de „bara 40", care e indexul din serie, dar a 41-a bară dacă numeri cu degetul.
BARS_TP1 = I_TP1 - I_CONF
assert cds[I_TP1 - 1].h < TP1 <= cds[I_TP1].h, "I_TP1 nu e prima bară peste ținta 1:1"
assert BARS_TP1 == 6, f"ținta 1:1 la {BARS_TP1} bare după intrare, aștept 6"
cds[I_TP1].note = (f"ținta 1:1 ({TP1:.2f}) e atinsă a {BARS_TP1}-a bară după intrare: acolo "
"vinzi o treime, restul merge mai departe — de asta nu vinzi tot la 1:1")
# --- assert-urile din specificație (toate, ca assert reale) ----------------
# 1. pivot 86.00 e straddled de doji
@@ -220,23 +225,25 @@ ch = Chart(
Level(ENTRY, "intrare 89.50", "#188a3e"),
Level(TP1, f"ținta 1:1 {TP1:.2f}", "#777", dash="2 3", label_at="left"),
Level(TP, "116.35 = +30 % față de intrare (procent real)", "#1a5fb4", label_at="left")],
zones=[Zone(0, B3, "1. setup: scădere lungă, apoi trei minime aproape egale — pivotul 86.00 atins de două ori", "#777"),
zones=[Zone(0, B1 + 1, "1. setup: scădere lungă, apoi primul test al pivotului 86.00", "#777"),
Zone(21, I_DOJI, "testul 2: minimele 2, 3 și doji-ul — fără revenire peste 86.00", "#777"),
Zone(I_DOJI, I_CONF, "2. doji + confirmare", "#b06000"),
# p_top sub 116.35: altfel eticheta zonei 3 se așază peste linia țintei
Zone(I_CONF + 1, I_TP - 1, "3. trendul pornește", "#188a3e", p_top=113.0),
Zone(I_TP, len(cds) - 1, "4. ținta", "#1a5fb4")],
arrows=[Arrow(I_CONF, "aici intri, la close 89.50:\nabia acum știi că au câștigat cumpărătorii",
ENTRY, where="above", color="#188a3e", dx=-150),
Arrow(B3, "al treilea minim: 81.45,\nfără o nouă atingere a pivotului\naici pui stopul, sub minime",
SL, where="below", color="#c00", dx=-40),
Arrow(B3, "minimul 3: 81.45 — tot din testul 2,\nprețul n-a mai urcat peste 86.00 după minimul 2\naici pui stopul, pe cel mai jos dintre cele trei minime",
SL, where="below", color="#c00", dx=-150),
Arrow(I_RETEST, "retest: cade înapoi pe intrare\nși ține — trendul e sănătos",
cds[I_RETEST].l, where="below", color="#188a3e", dx=110, dy=56),
Arrow(FLAG[0] + 1, "aici se odihnește, nu se strică:\nbull flag, pe volum mic",
cds[FLAG[0] + 1].h, where="above", color="#188a3e", dx=-20),
Arrow(I_TP, f"a ajuns la 116.35: +30 % în 21 de zile de bursă,\ncam {R:.1f}R din cât ai riscat".replace("3.3R", "3,3R"),
TP, where="left", color="#1a5fb4", dx=-30, dy=-40)],
marks=[Mark(B1, f"test 1 · {lows[B1]:.2f}", "#c00", "below"),
Mark(B2, f"test 2 · {lows[B2]:.2f}", "#c00", "below")],
marks=[Mark(B1, f"testul 1 · {lows[B1]:.2f}", "#c00", "below"),
Mark(20, "revenire peste pivot · 88.90", "#777", "above"),
Mark(B2, f"testul 2 · {lows[B2]:.2f}", "#c00", "below")],
mas=[MA(20, "#b06000", dash="4 3", text="SMA-20")],
scale=8.0, gap=15, body_w=9, left=44, width=w, vol_h=70,
vol_label="volum", title="LABU — daily",

View File

@@ -34,19 +34,29 @@ CE E REAL ȘI CE E CONSTRUIT (obligatoriu în legendă)
(`13_strategia_3_byh.md:298-308`; `byh.md:256-280`).
ADNOTĂRI (patru zone numerotate, ca subsecțiunile capitolului)
- Zona 1 (barele 0-31): „1. setup: scădere lungă, apoi trei minime aproape
egale — pivotul 86.00 atins de două ori"; Zona 2 (33-34): „2. doji + confirmare"; Zona 3 (35-54):
- Zona 1 (barele 0-17): „1. setup: scădere lungă, apoi primul test al
pivotului 86.00"; zona-bracket a testului 2 (barele 21-32): „testul 2:
minimele 2, 3 și doji-ul — fără revenire peste 86.00" (corectat 19.09.2026:
eticheta veche „pivotul 86.00 atins de două ori" îl lăsa pe cititor să
numere patru atingeri, fiindcă doji-ul stă PE pivot, iar bara dinaintea lui
traversează nivelul); Zona 2 (33-34): „2. doji + confirmare"; Zona 3 (35-54):
„3. trendul pornește"; Zona 4 (55-56): „4. ținta".
- Marcaje sub minimele 1 și 2 („test 1 · 82.40", „test 2 · 82.00") — doar
ele sunt atingeri ale pivotului; al treilea minim e numit de săgeata stopului.
- Marcaje: „testul 1 · 82.40" sub minimul 1, „revenire peste pivot · 88.90"
deasupra barei 20, „testul 2 · 82.00" sub minimul 2 — doar cele două minime
sunt atingeri ale pivotului; minimul 3 și doji-ul aparțin tot testului 2
(zona-bracket și săgeata stopului o spun).
- Săgeți: retestul („retest: cade înapoi pe intrare și ține — trendul e
sănătos"), bull flag-ul („aici se odihnește, nu se strică: bull flag, pe
volum mic"), intrarea („aici intri, la close 89.50: abia acum știi că au
câștigat cumpărătorii"), stopul, pe al treilea minim („al treilea minim:
81.45, fără o nouă atingere a pivotului, aici pui stopul, sub minime"), rezultatul („a ajuns la 116.35: +30 % într-o
81.45 — tot din testul 2, prețul n-a mai urcat peste 86.00 după minimul 2,
aici pui stopul, pe cel mai jos dintre cele trei minime" — stopul E cel mai
jos dintre minime, nu sub ele; formularea veche „sub minime" era falsă), rezultatul („a ajuns la 116.35: +30 % într-o
lună, cam 3,3R din cât ai riscat").
- Linie punctată pentru ținta 1:1 (97.55), cu nota de dedesubt: acolo vinzi
o treime, restul merge mai departe.
- Linie punctată pentru ținta 1:1 (97.55), cu nota de dedesubt: e atinsă a
6-a bară după intrare (indexul 40 din serie = a 41-a bară dacă numeri cu
degetul — de asta nota spune „a 6-a bară după intrare", nu „bara 40"),
acolo vinzi o treime, restul merge mai departe.
- Fără trimiteri fișier:linie în SVG; legenda „procentele sunt ale cursului,
prețurile sunt puse de sumarizator" rămâne.
@@ -78,7 +88,8 @@ Close-uri:
89.50, # 34 = confirmare => intrare
92.0, 94.0,
91.0, # 37 = retest (low 89.60, peste intrare)
93.5, 95.5, 98.5, 100.0, # 40 = prima bară peste ținta 1:1
93.5, 95.5, 98.5, 100.0, # index 40 = prima bară peste ținta 1:1
# (a 6-a bară după intrare)
99.2, 99.8, 98.9, 99.5, # 42-45 = bull flag, volum mic
102.5, 104.0, 103.0, 106.0, 108.5, 107.5, 110.5, 112.5, 114.0,
116.35, 117.5] # 55 = +30 %, la 21 de bare de confirmare
@@ -109,6 +120,9 @@ CE VERIFICĂ GENERATORUL CU assert
10. bull flag (42-45): amplitudine <= 2.5, fără high nou față de bara 41,
breakout pe bara 46, volum sub medie
8. doji: abs(o-c) <= 0.10*(h-l)
11. ținta 1:1: I_TP1 e prima bară cu high >= 97.55 (high-ul barei dinainte e
sub ea) și cade la 6 bare după confirmare — numărul din nota desenului e
derivat din serie, nu scris de mână.
STIL: gap=15, body_w=9, left=44, width=990, vol_h=70 (volumul confirmă:
„cel mai mare volum din serie" e în varianta MICI, nu obligatoriu aici — dar
confirmarea are volum peste medie). scale astfel încât 86.00 → 116.35 să

View File

@@ -1,7 +1,9 @@
<svg viewBox="0 0 990 622" xmlns="http://www.w3.org/2000/svg" style="width:100%;height:auto;font:12px sans-serif">
<text x="24" y="70" fill="#333" style="font-weight:bold">LABU — daily</text>
<rect x="34.5" y="129.6" width="484.0" height="247.6" fill="#777" fill-opacity="0.08" stroke="#777" stroke-width="1"/>
<text x="34.5" y="124.6" fill="#777" style="font-weight:bold">1. setup: scădere lungă, apoi trei minime aproape egale — pivotul 86.00 atins de două ori</text>
<rect x="34.5" y="129.6" width="274.0" height="240.0" fill="#777" fill-opacity="0.08" stroke="#777" stroke-width="1"/>
<text x="34.5" y="124.6" fill="#777" style="font-weight:bold">1. setup: scădere lungă, apoi primul test al pivotului 86.00</text>
<rect x="349.5" y="301.6" width="199.0" height="75.6" fill="#777" fill-opacity="0.08" stroke="#777" stroke-width="1"/>
<text x="349.5" y="188.6" fill="#777" style="font-weight:bold">testul 2: minimele 2, 3 și doji-ul — fără revenire peste 86.00</text>
<rect x="529.5" y="293.6" width="34.0" height="56.0" fill="#b06000" fill-opacity="0.08" stroke="#b06000" stroke-width="1"/>
<text x="529.5" y="220.6" fill="#b06000" style="font-weight:bold">2. doji + confirmare</text>
<rect x="559.5" y="116.8" width="304.0" height="196.0" fill="#188a3e" fill-opacity="0.08" stroke="#188a3e" stroke-width="1"/>
@@ -193,17 +195,18 @@
<rect x="864.5" y="480.6" width="9" height="65.6" fill="#188a3e" opacity="0.55"/>
<rect x="879.5" y="476.2" width="9" height="70.0" fill="#188a3e" opacity="0.55"/>
<text x="24" y="470.2" fill="#555">volum</text>
<text x="284.0" y="381.6" fill="#c00" text-anchor="middle" style="font-weight:bold">test 1 · 82.40</text>
<text x="419.0" y="383.2" fill="#c00" text-anchor="middle" style="font-weight:bold">test 2 · 82.00</text>
<text x="284.0" y="381.6" fill="#c00" text-anchor="middle" style="font-weight:bold">testul 1 · 82.40</text>
<text x="344.0" y="299.6" fill="#777" text-anchor="middle" style="font-weight:bold">revenire peste pivot · 88.90</text>
<text x="419.0" y="383.2" fill="#c00" text-anchor="middle" style="font-weight:bold">testul 2 · 82.00</text>
<line x1="404.0" y1="274.8" x2="546.1" y2="299.4" stroke="#188a3e" stroke-width="1.8"/>
<polygon points="554.0,300.8 545.4,303.4 546.8,295.5" fill="#188a3e"/>
<text x="404.0" y="255.8" fill="#188a3e" text-anchor="middle" style="font-weight:bold">aici intri, la close 89.50:</text>
<text x="404.0" y="269.8" fill="#188a3e" text-anchor="middle" style="font-weight:bold">abia acum știi că au câștigat cumpărătorii</text>
<line x1="469.0" y1="399.2" x2="502.3" y2="377.6" stroke="#c00" stroke-width="1.8"/>
<polygon points="509.0,373.2 504.5,380.9 500.1,374.2" fill="#c00"/>
<text x="469.0" y="413.2" fill="#c00" text-anchor="middle" style="font-weight:bold">al treilea minim: 81.45,</text>
<text x="469.0" y="427.2" fill="#c00" text-anchor="middle" style="font-weight:bold">fără o nouă atingere a pivotului</text>
<text x="469.0" y="441.2" fill="#c00" text-anchor="middle" style="font-weight:bold">aici pui stopul, sub minime</text>
<line x1="359.0" y1="399.2" x2="501.1" y2="374.6" stroke="#c00" stroke-width="1.8"/>
<polygon points="509.0,373.2 501.8,378.5 500.4,370.6" fill="#c00"/>
<text x="359.0" y="413.2" fill="#c00" text-anchor="middle" style="font-weight:bold">minimul 3: 81.45 — tot din testul 2,</text>
<text x="359.0" y="427.2" fill="#c00" text-anchor="middle" style="font-weight:bold">prețul n-a mai urcat peste 86.00 după minimul 2</text>
<text x="359.0" y="441.2" fill="#c00" text-anchor="middle" style="font-weight:bold">aici pui stopul, pe cel mai jos dintre cele trei minime</text>
<line x1="709.0" y1="390.0" x2="605.4" y2="312.8" stroke="#188a3e" stroke-width="1.8"/>
<polygon points="599.0,308.0 607.8,309.6 603.0,316.0" fill="#188a3e"/>
<text x="709.0" y="404.0" fill="#188a3e" text-anchor="middle" style="font-weight:bold">retest: cade înapoi pe intrare</text>
@@ -217,6 +220,6 @@
<text x="796.5" y="47.0" fill="#1a5fb4" text-anchor="end" style="font-weight:bold">a ajuns la 116.35: +30 % în 21 de zile de bursă,</text>
<text x="796.5" y="61.0" fill="#1a5fb4" text-anchor="end" style="font-weight:bold">cam 3,3R din cât ai riscat</text>
<text x="24" y="568.2" fill="#c00">doji = corp mic (o 86.10, c 86.00): cumpărătorii și vânzătorii sunt la egalitate, exact pe pivotul lunar 86.00</text>
<text x="24" y="585.2" fill="#188a3e">ținta 1:1 (97.55) e atinsă pe bara 40: acolo vinzi o treime, restul merge mai departe — de asta nu vinzi tot la 1:1</text>
<text x="24" y="585.2" fill="#188a3e">ținta 1:1 (97.55) e atinsă a 6-a bară după intrare: acolo vinzi o treime, restul merge mai departe — de asta nu vinzi tot la 1:1</text>
<text x="24" y="610" fill="#555">Procentele (stop 9 %, +30 %) sunt ale cursului; nivelurile de preț sunt puse de sumarizator.</text>
</svg>

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -46,8 +46,8 @@ PX = [24, 24 + PW + 28] # x-ul stâng al fiecărui panou
SCALE, TOP = 36.0, 96 # px/unitate și y-ul celui mai mare preț
ARR = {
PX[0]: Arrow(8, "pivot lunar: nivel urmărit\nde mulți — aici apar\ncumpărătorii",
price=S1_DA, where="below", color=BLUE),
PX[0]: Arrow(2, "pivot lunar: nivel urmărit\nde mulți — aici apar\ncumpărătorii",
price=S1_DA, where="below", color=BLUE, dy=20),
PX[1]: Arrow(4, "aceeași formă, dar nimic sub el\nnu are cine să-l susțină",
where="below", color=RED, dx=100),
}
@@ -68,9 +68,11 @@ assert ch_da.scale == ch_nu.scale and ch_da._pmax == ch_nu._pmax, "scări diferi
y = ch_da._y # axa e comună: același y pe ambele panouri
def level(px, price, text, color, below=False):
def level(px, price, text, color, below=False, right=False):
yy = y(price)
ty, anchor, tx = (yy + 14, "start", px + 6) if below else (yy - 6, "end", px + PW - 4)
if below and right: # ca să nu stea în tija unei săgeți
anchor, tx = "end", px + PW - 4
return [f'<line x1="{px}" y1="{yy:.1f}" x2="{px + PW}" y2="{yy:.1f}" stroke="{color}" '
f'stroke-width="1.5" stroke-dasharray="4 3"/>',
f'<text x="{tx}" y="{ty:.1f}" fill="{color}" text-anchor="{anchor}">{text}</text>']
@@ -87,6 +89,7 @@ def zone(px, p_top, p_bot, label, color, label_at_bottom=False):
f'style="font-weight:bold">{label}</text>']
PCT_DA, PCT_NU = f"{d_da:.2f}".replace(".", ","), f"{d_nu:.2f}".replace(".", ",")
y_bot = y(S1_NU)
parts = [
f'<svg viewBox="0 0 {W} {y_bot + 62:.0f}" xmlns="http://www.w3.org/2000/svg" '
@@ -96,10 +99,18 @@ parts = [
f'<text x="{PX[0]}" y="48" fill="{GREEN}" style="font-weight:bold">DA — doji la nivel</text>',
f'<text x="{PX[1]}" y="48" fill="{RED}" style="font-weight:bold">NU — doji în aer</text>',
f'<line x1="{PX[1] - 14}" y1="36" x2="{PX[1] - 14}" y2="{y_bot + 8:.0f}" stroke="#ccc"/>',
*zone(PX[0], doji.l, S1_DA, f"{d_da:.2f} % — la nivel".replace(".", ","), GREEN),
*zone(PX[1], doji.l, S1_NU, f"gol de {d_nu:.2f} % sub doji — doji în aer".replace(".", ","),
RED, label_at_bottom=True),
*level(PX[0], S1_DA, "pivotul lunar 49.00", BLUE, below=True),
# capătul de sus al benzii e chiar low-ul dojiului: scris, ca să se vadă din
# ce cifră iese procentul (de la 49.25 la pivot), nu doar rezultatul
*zone(PX[0], doji.l, S1_DA, f"low-ul dojiului: {doji.l:.2f}", GREEN),
*zone(PX[1], doji.l, S1_NU, f"low-ul dojiului: {doji.l:.2f}", RED),
f'<text x="{PX[0] + PW - 4}" y="{y(S1_DA) + 32:.1f}" fill="{GREEN}" text-anchor="end" '
f'style="font-weight:bold">de la {doji.l:.2f} la {S1_DA:.2f} = '
f'{PCT_DA} % — la nivel</text>', # ancorat la dreapta: tija săgeții albastre
# trece pe la x-ul candelei 2, mult în stânga
f'<text x="{PX[1] + 8}" y="{y(S1_NU) - 12:.1f}" fill="{RED}" '
f'style="font-weight:bold">de la {doji.l:.2f} la {S1_NU:.2f} = gol de '
f'{PCT_NU} % — doji în aer</text>',
*level(PX[0], S1_DA, "pivotul lunar 49.00", BLUE, below=True, right=True),
*level(PX[1], PP_NU, "pivotul lunar 53.50", BLUE),
*level(PX[1], S1_NU, "pivotul lunar 46.00", BLUE, below=True),
body_da, body_nu,

View File

@@ -22,10 +22,13 @@ close-uri 52.20, 51.40, 50.60, 49.65, 49.60 (doji: o 49.65 h 50.10 l 49.25),
NIVELURI
--------
Stânga (DA): „pivotul lunar 49.00" (albastru) + ZONĂ verde între low-ul dojiului
(49.25) și 49.00, etichetă „0,51 % — la nivel"; SĂGEATĂ spre linia 49.00:
(49.25) și 49.00, cu capătul de sus etichetat „low-ul dojiului: 49.25" și sub
bandă rândul „de la 49.25 la 49.00 = 0,51 % — la nivel" (cifra din care iese
procentul trebuie să fie pe desen, nu doar rezultatul); SĂGEATĂ spre linia 49.00:
„pivot lunar: nivel urmărit / de mulți — aici apar / cumpărătorii".
Dreapta (NU): „pivotul lunar 46.00" jos, „pivotul lunar 53.50" sus; ZONĂ roșie
între 49.25 și 46.00, etichetă „gol de 7,07 % sub doji — doji în aer"; SĂGEATĂ
între 49.25 și 46.00, cu capătul de sus etichetat „low-ul dojiului: 49.25" și
în josul benzii „de la 49.25 la 46.00 = gol de 7,07 % — doji în aer"; SĂGEATĂ
spre doji: „aceeași formă, dar nimic sub el / nu are cine să-l susțină".
Sub ambele, un singur rând: „daily: e «la nivel» dacă low-ul dojiului e la cel
mult 1-2 % de pivotul lunar (aici 0,51 %; în dreapta 7,07 %)". Rândul cu

View File

@@ -4,11 +4,13 @@
<text x="402" y="48" fill="#c00" style="font-weight:bold">NU — doji în aer</text>
<line x1="388" y1="36" x2="388" y2="361" stroke="#ccc"/>
<rect x="24" y="236.4" width="350" height="9.0" fill="#188a3e" fill-opacity="0.12" stroke="#188a3e" stroke-width="1"/>
<text x="370" y="230.4" fill="#188a3e" text-anchor="end" style="font-weight:bold">0,51 % — la nivel</text>
<text x="370" y="230.4" fill="#188a3e" text-anchor="end" style="font-weight:bold">low-ul dojiului: 49.25</text>
<rect x="402" y="236.4" width="350" height="117.0" fill="#c00" fill-opacity="0.12" stroke="#c00" stroke-width="1"/>
<text x="410" y="341.4" fill="#c00" text-anchor="start" style="font-weight:bold">gol de 7,07 % sub doji — doji în aer</text>
<text x="748" y="230.4" fill="#c00" text-anchor="end" style="font-weight:bold">low-ul dojiului: 49.25</text>
<text x="370" y="277.4" fill="#188a3e" text-anchor="end" style="font-weight:bold">de la 49.25 la 49.00 = 0,51 % — la nivel</text>
<text x="410" y="341.4" fill="#c00" style="font-weight:bold">de la 49.25 la 46.00 = gol de 7,07 % — doji în aer</text>
<line x1="24" y1="245.4" x2="374" y2="245.4" stroke="#1a5fb4" stroke-width="1.5" stroke-dasharray="4 3"/>
<text x="30" y="259.4" fill="#1a5fb4" text-anchor="start">pivotul lunar 49.00</text>
<text x="370" y="259.4" fill="#1a5fb4" text-anchor="end">pivotul lunar 49.00</text>
<line x1="402" y1="83.4" x2="752" y2="83.4" stroke="#1a5fb4" stroke-width="1.5" stroke-dasharray="4 3"/>
<text x="748" y="77.4" fill="#1a5fb4" text-anchor="end">pivotul lunar 53.50</text>
<line x1="402" y1="353.4" x2="752" y2="353.4" stroke="#1a5fb4" stroke-width="1.5" stroke-dasharray="4 3"/>
@@ -35,11 +37,11 @@
<rect x="206.0" y="155.4" width="10" height="14.4" fill="#188a3e"/>
<text x="126.0" y="179.8" fill="#b06000" text-anchor="middle" style="font-weight:bold">doji</text>
<text x="160.0" y="153.6" fill="#188a3e" text-anchor="middle" style="font-weight:bold">confirmare</text>
<line x1="194.0" y1="275.4" x2="194.0" y2="257.4" stroke="#1a5fb4" stroke-width="1.8"/>
<polygon points="194.0,249.4 198.0,257.4 190.0,257.4" fill="#1a5fb4"/>
<text x="194.0" y="289.4" fill="#1a5fb4" text-anchor="middle" style="font-weight:bold">pivot lunar: nivel urmărit</text>
<text x="194.0" y="303.4" fill="#1a5fb4" text-anchor="middle" style="font-weight:bold">de mulți — aici apar</text>
<text x="194.0" y="317.4" fill="#1a5fb4" text-anchor="middle" style="font-weight:bold">cumpărătorii</text>
<line x1="92.0" y1="295.4" x2="92.0" y2="257.4" stroke="#1a5fb4" stroke-width="1.8"/>
<polygon points="92.0,249.4 96.0,257.4 88.0,257.4" fill="#1a5fb4"/>
<text x="92.0" y="309.4" fill="#1a5fb4" text-anchor="middle" style="font-weight:bold">pivot lunar: nivel urmărit</text>
<text x="92.0" y="323.4" fill="#1a5fb4" text-anchor="middle" style="font-weight:bold">de mulți — aici apar</text>
<text x="92.0" y="337.4" fill="#1a5fb4" text-anchor="middle" style="font-weight:bold">cumpărătorii</text>
<line x1="436.0" y1="96.0" x2="436.0" y2="135.6" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="431.0" y="101.4" width="10" height="28.8" fill="#c00"/>
<line x1="453.0" y1="124.8" x2="453.0" y2="164.4" stroke="#1a1a1a" stroke-width="1.2"/>

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@@ -102,6 +102,7 @@ SL_X1, SL_X2 = 380, 614 # liniile de nivel pe graficul mic
COL_X = 620 # coloana cu etichetele de nivel ale graficului mic
out = []
LABELS = [] # (x, text) al fiecărei etichete, pentru verificarea de panou
def text(x, y, s, fill=INK, anchor="start", bold=False, size=None):
@@ -112,6 +113,7 @@ def text(x, y, s, fill=INK, anchor="start", bold=False, size=None):
st.append(f"font-size:{size}px")
style = f' style="{";".join(st)}"' if st else ""
a = f' text-anchor="{anchor}"' if anchor != "start" else ""
LABELS.append((x, s))
out.append(f'<text x="{x:.1f}" y="{y:.1f}" fill="{fill}"{a}{style}>{s}</text>')
@@ -155,6 +157,7 @@ for key, f, tf_big, tf_small, cap, exp in ROWS:
big, small = scaled(BIG_A, f), scaled(SMALL_A, f)
g = check(key, big, small, exp)
first = key == "A"
lab0 = len(LABELS)
# titlu rând + subtitluri
text(20, y0 + 14, f"{key}. {tf_big} → {tf_small}", bold=True, size=13)
@@ -201,7 +204,7 @@ for key, f, tf_big, tf_small, cap, exp in ROWS:
hline(SL_X1, SL_X2, y_tp, GREEN, "2 3")
text(COL_X, y_tp + 4, f"ținta 1:1 {g['tp']:.2f}", fill=GREEN, size=11)
text(COL_X, y_e + 4, f"intrare {g['entry']:.2f}", fill=GREEN, size=11)
text(COL_X, y_dh - 5, f"high doji {g['dh']:.2f}", fill="#666", size=11)
text(COL_X, y_dh - 5, f"nivel din {tf_big}", fill="#666", size=11)
text(COL_X, y_sl + 12, f"stop {g['sl']:.2f}", fill=RED, size=11)
if first:
text(COL_X, y_sl + 25, "sub ultimele", fill=RED, size=11)
@@ -230,6 +233,24 @@ for key, f, tf_big, tf_small, cap, exp in ROWS:
anchor="middle", bold=True)
text((bx + kx) / 2 + 20, ya + 31, "→ de 4 ori mai multe acțiuni la același risc", fill=RED,
anchor="middle", bold=True)
# fiecare preț stă pe panoul lui: prețurile TF-ului mare nu apar în dreapta
# (SX0) și cele ale TF-ului mic nu apar în stânga. Asta e exact bug-ul care
# a pus „high doji 105.20" (weekly) pe graficul daily.
MARE = {k: g[k] for k in ("dh", "dl", "conf", "b_sl", "b_entry")}
MIC = {k: g[k] for k in ("entry", "sl", "tp", "sdl")}
for x, s_ in LABELS[lab0:]:
pe_mic = x >= SL_X1 - 20
rau = MARE if pe_mic else MIC
for k, v in rau.items():
assert f"{v:.2f}" not in s_, (
f"{key}: eticheta {s_!r} de pe panoul "
f"{'mic' if pe_mic else 'mare'} conține prețul {k}={v:.2f} al celuilalt panou")
# și invers: prețul TF-ului mare chiar e scris pe panoul mare, legat de serie
assert any(f"{g['dh']:.2f}" in s_ and x < SL_X1 - 20 for x, s_ in LABELS[lab0:]), \
f"{key}: high-ul dojiului mare nu apare pe panoul mare"
for k in ("entry", "sl", "tp"):
assert any(f"{g[k]:.2f}" in s_ and x >= SL_X1 - 20 for x, s_ in LABELS[lab0:]), \
f"{key}: {k} nu apare pe panoul mic"
print(f"{key}: doji mare {g['dh']:.2f}/{g['dl']:.2f} conf {g['conf']:.2f} | intrare {g['entry']:.2f} "
f"SL {g['sl']:.2f} risc {g['risk']:.2f} ({g['pct']:.2f} %) TP1 {g['tp']:.2f} | "
f"doar mare: risc {g['b_risk']:.2f} ({g['b_pct']:.2f} %)")

View File

@@ -57,7 +57,9 @@ NIVELURI (pe fiecare rând)
--------------------------
Pe graficul mare: linie punctată gri la high-ul dojiului mare („high doji
weekly 105.20" / „high doji monthly 113.00" / „high doji daily 102.08").
Pe graficul mic: aceeași linie (nivelul la care se oprește pullback-ul);
Pe graficul mic: aceeași linie, dar etichetată „nivel din <TF mare>", FĂRĂ
preț: un preț al TF-ului mare pe panoul TF-ului mic se citește ca trigger al
panoului mic. Prețurile de pe panoul mic sunt doar ale lui:
intrare verde; SL roșu; TP1 verde punctat.
ETICHETE
@@ -90,6 +92,10 @@ Pe fiecare rând (A, B, C), pe seriile calculate:
8. abs(low mic[8] - high mare[9]) / high mare[9] <= 0.005 (doji mic la nivel,
sub pragul cel mai strict, 0,5 %).
9. Raportul pixeli SL-intrare / intrare-TP1 == 1 pe fiecare grafic mic.
10. Fiecare preț stă pe panoul lui: nicio etichetă din dreapta (x >= SL_X1-20)
nu conține dh/dl/conf/b_sl/b_entry, nicio etichetă din stânga nu conține
entry/sl/tp/sdl; și invers, dh apare pe panoul mare, iar entry/sl/tp pe
cel mic. Asta e assert-ul care prinde „high doji 105.20" pus pe daily.
SURSA
-----

View File

@@ -43,7 +43,7 @@
<line x1="380.0" y1="140.3" x2="614.0" y2="140.3" stroke="#188a3e" stroke-width="1.5" stroke-dasharray="2 3"/>
<text x="620.0" y="144.3" fill="#188a3e" style="font-size:11px">ținta 1:1 107.50</text>
<text x="620.0" y="199.1" fill="#188a3e" style="font-size:11px">intrare 106.30</text>
<text x="620.0" y="240.4" fill="#666" style="font-size:11px">high doji 105.20</text>
<text x="620.0" y="240.4" fill="#666" style="font-size:11px">nivel din weekly</text>
<text x="620.0" y="262.0" fill="#c00" style="font-size:11px">stop 105.10</text>
<text x="620.0" y="275.0" fill="#c00" style="font-size:11px">sub ultimele</text>
<text x="620.0" y="288.0" fill="#c00" style="font-size:11px">4 candele</text>
@@ -129,7 +129,7 @@
<line x1="380.0" y1="460.3" x2="614.0" y2="460.3" stroke="#188a3e" stroke-width="1.5" stroke-dasharray="2 3"/>
<text x="620.0" y="464.3" fill="#188a3e" style="font-size:11px">ținta 1:1 118.75</text>
<text x="620.0" y="519.1" fill="#188a3e" style="font-size:11px">intrare 115.75</text>
<text x="620.0" y="560.4" fill="#666" style="font-size:11px">high doji 113.00</text>
<text x="620.0" y="560.4" fill="#666" style="font-size:11px">nivel din monthly</text>
<text x="620.0" y="582.0" fill="#c00" style="font-size:11px">stop 112.75</text>
<line x1="392.0" y1="474.0" x2="392.0" y2="510.6" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="387.5" y="483.1" width="9" height="18.3" fill="#c00"/>
@@ -204,7 +204,7 @@
<line x1="380.0" y1="730.3" x2="614.0" y2="730.3" stroke="#188a3e" stroke-width="1.5" stroke-dasharray="2 3"/>
<text x="620.0" y="734.3" fill="#188a3e" style="font-size:11px">ținta 1:1 103.00</text>
<text x="620.0" y="789.1" fill="#188a3e" style="font-size:11px">intrare 102.52</text>
<text x="620.0" y="830.4" fill="#666" style="font-size:11px">high doji 102.08</text>
<text x="620.0" y="830.4" fill="#666" style="font-size:11px">nivel din daily</text>
<text x="620.0" y="852.0" fill="#c00" style="font-size:11px">stop 102.04</text>
<line x1="392.0" y1="744.0" x2="392.0" y2="780.6" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="387.5" y="753.1" width="9" height="18.3" fill="#c00"/>

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -48,10 +48,12 @@ assert vols[14] > media_vol and vols[16] > media_vol, "volum peste medie pe doji
cds = from_closes(closes, wicks=wicks, vols=vols, start=closes[0])
doji, wait, conf = cds[14], cds[15], cds[16]
DOJI_I = 14 # indexul dojiului; barele 0..DOJI_I-1 sunt creșterea
doji, wait, conf = cds[DOJI_I], cds[15], cds[16]
# stopul 5 cenți DEASUPRA high-ului, oglinda pasului 5 (51.60 -> 51.55 pe long);
# cifrele vechi (SL 100.10, TP 97.90) puneau stopul exact pe high
entry, sl, tp = 99.00, 100.15, 97.85
risc = round(sl - entry, 2)
# --- cele 9 assert-uri cerute de specificație ------------------------------
# 1. SL-ul e 5 cenți peste high-ul ultimelor 4 candele (100.10)
@@ -80,6 +82,9 @@ assert cds[27].c < entry, "ieșirea n-ar fi pe profit"
assert abs(doji.o - doji.c) <= 0.10 * (doji.h - doji.l), "bara 14 nu e doji"
# 9. uptrend vizibil
assert cds[13].c > cds[0].c + 5, "uptrend prea mic"
# 10. creșterea ține de la bara 0 până imediat înainte de doji — asta acoperă
# zona „1. creștere de N candele", cu N = DOJI_I
assert cds[DOJI_I - 1].c > cds[0].c + 5, "creșterea nu urcă până la doji"
print(f"doji {doji.l:.2f}/{doji.h:.2f} intrare short {conf.c:.2f} "
f"SL {sl:.2f} TP {tp:.2f} trail {trail:.2f} ieșire bara 27 @ {cds[27].c:.2f}")
@@ -91,13 +96,16 @@ ch = Chart(
levels=[
# etichetele în dreapta, dincolo de ultima candelă (width > ultima
# candelă); titlul stă în stânga sus, deci nu mai are cu ce să se lovească
Level(sl, "stop 100.15", RED),
Level(entry, "intrare short 99.00", ORANGE),
Level(tp, "ținta 97.85", GREEN),
Level(sl, f"stop {sl:.2f}", RED),
Level(entry, f"intrare short {entry:.2f}", ORANGE),
Level(tp, f"ținta {tp:.2f}", GREEN),
],
zones=[
Zone(0, 9, "1. creștere de 10 candele", BLUE),
Zone(14, 14, "2. doji", ORANGE),
# zona acoperă TOATĂ creșterea (barele 0..13), iar numărul din etichetă
# iese din indici; p_top = high-ul dojiului, altfel eticheta urcă peste titlu
Zone(0, DOJI_I - 1, f"1. creșterea: {DOJI_I} candele",
BLUE, p_top=doji.h),
Zone(DOJI_I, DOJI_I, "2. doji", ORANGE),
# ca unealta „short position" din TradingView: roșu = risc, SUS;
# verde = câștig, JOS — pe short totul e întors față de long
Zone(16, 19, "", RED, p_top=sl, p_bot=entry),
@@ -107,15 +115,17 @@ ch = Chart(
Zone(25, 30, "", GRAY, p_top=trail, p_bot=trail - 0.02),
],
arrows=[
Arrow(18, "STOPUL SUS, la 100.15 — 5 cenți peste maximul ultimelor 4 candele:\n"
Arrow(18, f"STOPUL SUS, la {sl:.2f} — 5 cenți peste maximul ultimelor 4 candele:\n"
"dacă prețul urcă până aici, creșterea continuă și ideea e moartă",
where="above", price=sl, color=RED, dx=110),
Arrow(16, "AICI INTRI SHORT, la 99.00:\na doua candelă după doji e prima\n"
"care se ÎNCHIDE sub low-ul lui (99.20)",
Arrow(16, f"AICI INTRI SHORT, la {entry:.2f}:\na doua candelă după doji e prima\n"
f"care se ÎNCHIDE sub low-ul lui ({doji.l:.2f})",
where="below", color=ORANGE, dx=-70),
Arrow(19, "ținta JOS, la 97.85: tot 1.15, exact cât ai riscat;\naici închizi prima treime",
Arrow(19, f"ținta JOS, la {tp:.2f}: tot {risc:.2f}, exact cât ai riscat;\n"
"aici închizi prima treime",
where="right", price=tp, color=GREEN, dx=50, dy=-32),
Arrow(27, "trail-ul a coborât după preț (96.45);\nprima închidere peste el: ieși cu restul, 96.60",
Arrow(27, f"trail-ul a coborât după preț ({trail:.2f});\nprima închidere peste el: "
f"ieși cu restul, {cds[27].c:.2f}",
where="below", color=GRAY, dx=-40),
],
scale=45.0, gap=20, body_w=9, left=44, width=790, vol_h=60,
@@ -126,6 +136,16 @@ ch = Chart(
svg = ch.render()
assert "<svg" in svg and "\n\n" not in svg, "linie goală în SVG"
# fiecare preț din etichete e o valoare calculată din serie, nu una scrisă de mână
import re # noqa: E402
PERMISE = {f"{v:.2f}" for v in (sl, entry, tp, doji.l, doji.h, trail, cds[27].c, risc)}
for t in re.findall(r"<text[^>]*>([^<]*)</text>", svg):
for n in re.findall(r"\d+\.\d\d", t):
assert n in PERMISE, f"eticheta {t!r} numește {n}, care nu iese din serie"
# numărul din eticheta zonei 1 == câte bare acoperă efectiv zona (0..DOJI_I-1)
z1 = ch.zones[0]
assert f"{z1.i1 - z1.i0 + 1} candele" in z1.text, "eticheta zonei 1 nu spune câte bare acoperă"
assert z1.i1 == DOJI_I - 1 and cds[z1.i1].c > cds[z1.i0].c + 5, "zona 1 nu acoperă creșterea"
with open("/workspace/atm-curs-dl/gen/strategii/buy_doji_sell.svg", "w") as f:
f.write(svg)
print("scris gen/strategii/buy_doji_sell.svg")

View File

@@ -8,7 +8,7 @@ Graficul întreg al unui trade Sell Doji short, oglinda ansamblului long:
uptrend de 14 candele, doji, o bară de așteptare care NU confirmă, apoi o
bară care închide sub low, intrare short la close, SL 5 cenți deasupra
high-ului ultimelor 4 candele, TP 1:1 în jos, apoi trailing. Panou de volum.
Format tutorial v2: zone de evidențiere („1. creștere de 10 candele",
Format tutorial v2: zone de evidențiere („1. creșterea: 14 candele" — barele 0..13, toată creșterea,
„2. doji", cutie roșie = riscul, între intrare și stop, cutie verde = câștigul,
între intrare și țintă — ca unealta „short position" din TradingView; segment
gri = linia de trail) și 4 săgeți care spun ce ȘI de ce: stop, intrare, țintă,

View File

@@ -1,7 +1,7 @@
<svg viewBox="0 0 840 571" 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">Sell Doji pe short — daily (exemplu construit)</text>
<rect x="34.5" y="130.8" width="199.0" height="306.3" fill="#1a5fb4" fill-opacity="0.08" stroke="#1a5fb4" stroke-width="1"/>
<text x="34.5" y="125.8" fill="#1a5fb4" style="font-weight:bold">1. creștere de 10 candele</text>
<rect x="34.5" y="98.2" width="279.0" height="338.8" fill="#1a5fb4" fill-opacity="0.08" stroke="#1a5fb4" stroke-width="1"/>
<text x="34.5" y="93.2" fill="#1a5fb4" style="font-weight:bold">1. creșterea: 14 candele</text>
<rect x="314.5" y="90.2" width="19.0" height="56.5" fill="#b06000" fill-opacity="0.08" stroke="#b06000" stroke-width="1"/>
<text x="314.5" y="85.2" fill="#b06000" style="font-weight:bold">2. doji</text>
<rect x="354.5" y="96.0" width="79.0" height="51.8" fill="#c00" fill-opacity="0.08" stroke="#c00" stroke-width="1"/>

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -123,9 +123,12 @@ for k, n in zip(range(cf - 3, cf + 1), "4321"):
nums.append(f'<text x="{sus._cx(k):.1f}" y="{yb:.1f}" fill="{BLUE}" text-anchor="middle" '
f'style="font-weight:bold">{n}</text>')
nums.append(f'<text x="{sus._cx(cf - 4):.1f}" y="{yb:.1f}" fill="#999" text-anchor="middle">(5)</text>')
nums.append(f'<text x="24" y="{yb + 20:.1f}" fill="#555">'
# subtitrarea stă sub TOT ce a desenat panoul: altfel tija săgeții gri spre
# „cel mai jos low din cele 4" îi trece orizontal peste rând și textul iese tăiat
y_sub = max([yb] + [float(m) for m in re.findall(r'<text[^>]*\sy="([\d.]+)"', body_sus)]) + 24
nums.append(f'<text x="24" y="{y_sub:.1f}" fill="#555">'
f'cu 4 sau cu 5 candele iese la fel: în scădere, low-ul doji-ului e oricum cel mai jos</text>')
h_sus = max(h_sus, yb + 32)
h_sus = max(h_sus, y_sub + 12)
body_jos, h_jos, off_jos = panou(gata, h_sus + VGAP)
zx = gata._cx(cf + 3) + 10

View File

@@ -61,3 +61,9 @@ SURSA
- Stopul sub structură; bottom-ul mai poate face un picior:
summaries/08_ANALIZA_ZILNICA/01_buy_doji_si_strategia_mici.md:833-836.
- Stopul „la ochi" 49.70 și barele de după intrare sunt CONSTRUITE (contrast).
LIZIBILITATE
------------
Subtitrarea „cu 4 sau cu 5 candele iese la fel…" se pune sub TOT ce a desenat
panoul de sus (y calculat din textele randate), nu la offset fix: tija săgeții
gri spre „cel mai jos low din cele 4" îi trecea orizontal peste rând.

View File

@@ -1,4 +1,4 @@
<svg viewBox="0 0 720 1162" xmlns="http://www.w3.org/2000/svg" style="width:100%;height:auto;font:12px sans-serif">
<svg viewBox="0 0 720 1163" 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">Pasul 5 — stopul: numeri 4 candele înapoi de la confirmare</text>
<rect x="178.0" y="289.2" width="80.0" height="88.0" fill="#1a5fb4" fill-opacity="0.08" stroke="#1a5fb4" stroke-width="1"/>
<text x="178.0" y="284.2" fill="#1a5fb4" style="font-weight:bold">numeri 4 candele, începând cu confirmarea</text>
@@ -44,69 +44,69 @@
<text x="228.0" y="393.0" fill="#1a5fb4" text-anchor="middle" style="font-weight:bold">2</text>
<text x="248.0" y="393.0" fill="#1a5fb4" text-anchor="middle" style="font-weight:bold">1</text>
<text x="168.0" y="393.0" fill="#999" text-anchor="middle">(5)</text>
<text x="24" y="413.0" fill="#555">cu 4 sau cu 5 candele iese la fel: în scădere, low-ul doji-ului e oricum cel mai jos</text>
<line x1="24" y1="561" x2="706" y2="561" stroke="#ddd"/>
<text x="24" y="616" fill="#333" style="font-weight:bold">Același trade: stop „la ochi” (sub candela de confirmare) vs stopul din regulă</text>
<rect x="258.0" y="921.0" width="40.0" height="18.0" fill="#c00" fill-opacity="0.08" stroke="#c00" stroke-width="1"/>
<line x1="24" y1="852.6" x2="706" y2="852.6" stroke="#188a3e" stroke-width="1.5" stroke-dasharray="2 2"/>
<text x="30" y="846.6" fill="#188a3e">ținta 1: 51.60</text>
<line x1="24" y1="895.8" x2="706" y2="895.8" stroke="#555" stroke-width="1.5" stroke-dasharray="4 3"/>
<text x="30" y="889.8" fill="#555">intrarea: 50.40</text>
<line x1="24" y1="921.0" x2="706" y2="921.0" stroke="#b06000" stroke-width="1.5" stroke-dasharray="4 3"/>
<text x="30" y="915.0" fill="#b06000">stop pus la ochi: 49.70</text>
<line x1="24" y1="939.0" x2="706" y2="939.0" stroke="#c00" stroke-width="1.5" stroke-dasharray="4 3"/>
<text x="30" y="933.0" fill="#c00">stopul din regulă: 49.20</text>
<line x1="48.0" y1="624.0" x2="48.0" y2="687.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="43.0" y="633.0" width="10" height="43.2" fill="#c00"/>
<line x1="68.0" y1="667.2" x2="68.0" y2="726.6" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="63.0" y="676.2" width="10" height="39.6" fill="#c00"/>
<line x1="88.0" y1="692.4" x2="88.0" y2="726.6" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="83.0" y="701.4" width="10" height="14.4" fill="#188a3e"/>
<line x1="108.0" y1="692.4" x2="108.0" y2="751.8" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="103.0" y="701.4" width="10" height="39.6" fill="#c00"/>
<line x1="128.0" y1="732.0" x2="128.0" y2="795.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="123.0" y="741.0" width="10" height="43.2" fill="#c00"/>
<line x1="148.0" y1="775.2" x2="148.0" y2="838.2" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="143.0" y="784.2" width="10" height="43.2" fill="#c00"/>
<line x1="168.0" y1="818.4" x2="168.0" y2="885.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="163.0" y="827.4" width="10" height="46.8" fill="#c00"/>
<line x1="188.0" y1="865.2" x2="188.0" y2="933.6" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="183.0" y="874.2" width="10" height="48.6" fill="#c00"/>
<line x1="208.0" y1="906.6" x2="208.0" y2="937.2" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="203.0" y="922.8" width="10" height="1.8" fill="#c00"/>
<line x1="228.0" y1="908.4" x2="228.0" y2="930.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="223.0" y="913.8" width="10" height="10.8" fill="#188a3e"/>
<line x1="248.0" y1="890.4" x2="248.0" y2="919.2" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="243.0" y="895.8" width="10" height="18.0" fill="#188a3e"/>
<line x1="268.0" y1="892.2" x2="268.0" y2="915.6" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="263.0" y="895.8" width="10" height="16.2" fill="#c00"/>
<line x1="288.0" y1="908.4" x2="288.0" y2="928.2" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="283.0" y="912.0" width="10" height="12.6" fill="#c00"/>
<line x1="308.0" y1="897.6" x2="308.0" y2="926.4" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="303.0" y="901.2" width="10" height="23.4" fill="#188a3e"/>
<line x1="328.0" y1="877.8" x2="328.0" y2="904.8" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="323.0" y="881.4" width="10" height="19.8" fill="#188a3e"/>
<line x1="348.0" y1="861.6" x2="348.0" y2="885.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="343.0" y="865.2" width="10" height="16.2" fill="#188a3e"/>
<line x1="368.0" y1="845.4" x2="368.0" y2="868.8" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="363.0" y="849.0" width="10" height="16.2" fill="#188a3e"/>
<line x1="518.0" y1="957.0" x2="295.9" y2="926.1" stroke="#b06000" stroke-width="1.8"/>
<polygon points="288.0,925.0 296.5,922.1 295.4,930.1" fill="#b06000"/>
<text x="518.0" y="971.0" fill="#b06000" text-anchor="middle" style="font-weight:bold">stopul pus la ochi (49.70) e măturat</text>
<text x="518.0" y="985.0" fill="#b06000" text-anchor="middle" style="font-weight:bold">era prea aproape de intrare</text>
<line x1="518.0" y1="1014.2" x2="295.5" y2="934.9" stroke="#1a5fb4" stroke-width="1.8"/>
<polygon points="288.0,932.2 296.9,931.1 294.2,938.7" fill="#1a5fb4"/>
<text x="518.0" y="1028.2" fill="#1a5fb4" text-anchor="middle" style="font-weight:bold">al doilea picior al fundului: 49.50</text>
<text x="518.0" y="1042.2" fill="#1a5fb4" text-anchor="middle" style="font-weight:bold">fundurile fac des asta</text>
<line x1="498.0" y1="1075.0" x2="274.9" y2="947.0" stroke="#c00" stroke-width="1.8"/>
<polygon points="268.0,943.0 276.9,943.5 272.9,950.5" fill="#c00"/>
<text x="498.0" y="1089.0" fill="#c00" text-anchor="middle" style="font-weight:bold">stopul din regulă (49.20) ține</text>
<text x="498.0" y="1103.0" fill="#c00" text-anchor="middle" style="font-weight:bold">al doilea picior rămâne peste el</text>
<line x1="518.0" y1="822.6" x2="375.9" y2="847.2" stroke="#188a3e" stroke-width="1.8"/>
<polygon points="368.0,848.6 375.2,843.3 376.6,851.2" fill="#188a3e"/>
<text x="518.0" y="789.6" fill="#188a3e" text-anchor="middle" style="font-weight:bold">prețul ajunge la țintă</text>
<text x="518.0" y="803.6" fill="#188a3e" text-anchor="middle" style="font-weight:bold">dar numai cu stopul corect</text>
<text x="518.0" y="817.6" fill="#188a3e" text-anchor="middle" style="font-weight:bold">mai erai în trade</text>
<text x="24" y="1142" fill="#555">Barele de după intrare și stopul la ochi sunt construite, pentru contrast.</text>
<text x="318.0" y="915.0" fill="#c00" style="font-weight:bold">pe aici trece al doilea picior</text>
<text x="24" y="543.0" fill="#555">cu 4 sau cu 5 candele iese la fel: în scădere, low-ul doji-ului e oricum cel mai jos</text>
<line x1="24" y1="562" x2="706" y2="562" stroke="#ddd"/>
<text x="24" y="617" fill="#333" style="font-weight:bold">Același trade: stop „la ochi” (sub candela de confirmare) vs stopul din regulă</text>
<rect x="258.0" y="922.0" width="40.0" height="18.0" fill="#c00" fill-opacity="0.08" stroke="#c00" stroke-width="1"/>
<line x1="24" y1="853.6" x2="706" y2="853.6" stroke="#188a3e" stroke-width="1.5" stroke-dasharray="2 2"/>
<text x="30" y="847.6" fill="#188a3e">ținta 1: 51.60</text>
<line x1="24" y1="896.8" x2="706" y2="896.8" stroke="#555" stroke-width="1.5" stroke-dasharray="4 3"/>
<text x="30" y="890.8" fill="#555">intrarea: 50.40</text>
<line x1="24" y1="922.0" x2="706" y2="922.0" stroke="#b06000" stroke-width="1.5" stroke-dasharray="4 3"/>
<text x="30" y="916.0" fill="#b06000">stop pus la ochi: 49.70</text>
<line x1="24" y1="940.0" x2="706" y2="940.0" stroke="#c00" stroke-width="1.5" stroke-dasharray="4 3"/>
<text x="30" y="934.0" fill="#c00">stopul din regulă: 49.20</text>
<line x1="48.0" y1="625.0" x2="48.0" y2="688.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="43.0" y="634.0" width="10" height="43.2" fill="#c00"/>
<line x1="68.0" y1="668.2" x2="68.0" y2="727.6" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="63.0" y="677.2" width="10" height="39.6" fill="#c00"/>
<line x1="88.0" y1="693.4" x2="88.0" y2="727.6" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="83.0" y="702.4" width="10" height="14.4" fill="#188a3e"/>
<line x1="108.0" y1="693.4" x2="108.0" y2="752.8" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="103.0" y="702.4" width="10" height="39.6" fill="#c00"/>
<line x1="128.0" y1="733.0" x2="128.0" y2="796.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="123.0" y="742.0" width="10" height="43.2" fill="#c00"/>
<line x1="148.0" y1="776.2" x2="148.0" y2="839.2" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="143.0" y="785.2" width="10" height="43.2" fill="#c00"/>
<line x1="168.0" y1="819.4" x2="168.0" y2="886.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="163.0" y="828.4" width="10" height="46.8" fill="#c00"/>
<line x1="188.0" y1="866.2" x2="188.0" y2="934.6" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="183.0" y="875.2" width="10" height="48.6" fill="#c00"/>
<line x1="208.0" y1="907.6" x2="208.0" y2="938.2" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="203.0" y="923.8" width="10" height="1.8" fill="#c00"/>
<line x1="228.0" y1="909.4" x2="228.0" y2="931.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="223.0" y="914.8" width="10" height="10.8" fill="#188a3e"/>
<line x1="248.0" y1="891.4" x2="248.0" y2="920.2" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="243.0" y="896.8" width="10" height="18.0" fill="#188a3e"/>
<line x1="268.0" y1="893.2" x2="268.0" y2="916.6" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="263.0" y="896.8" width="10" height="16.2" fill="#c00"/>
<line x1="288.0" y1="909.4" x2="288.0" y2="929.2" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="283.0" y="913.0" width="10" height="12.6" fill="#c00"/>
<line x1="308.0" y1="898.6" x2="308.0" y2="927.4" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="303.0" y="902.2" width="10" height="23.4" fill="#188a3e"/>
<line x1="328.0" y1="878.8" x2="328.0" y2="905.8" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="323.0" y="882.4" width="10" height="19.8" fill="#188a3e"/>
<line x1="348.0" y1="862.6" x2="348.0" y2="886.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="343.0" y="866.2" width="10" height="16.2" fill="#188a3e"/>
<line x1="368.0" y1="846.4" x2="368.0" y2="869.8" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="363.0" y="850.0" width="10" height="16.2" fill="#188a3e"/>
<line x1="518.0" y1="958.0" x2="295.9" y2="927.1" stroke="#b06000" stroke-width="1.8"/>
<polygon points="288.0,926.0 296.5,923.1 295.4,931.1" fill="#b06000"/>
<text x="518.0" y="972.0" fill="#b06000" text-anchor="middle" style="font-weight:bold">stopul pus la ochi (49.70) e măturat</text>
<text x="518.0" y="986.0" fill="#b06000" text-anchor="middle" style="font-weight:bold">era prea aproape de intrare</text>
<line x1="518.0" y1="1015.2" x2="295.5" y2="935.9" stroke="#1a5fb4" stroke-width="1.8"/>
<polygon points="288.0,933.2 296.9,932.1 294.2,939.7" fill="#1a5fb4"/>
<text x="518.0" y="1029.2" fill="#1a5fb4" text-anchor="middle" style="font-weight:bold">al doilea picior al fundului: 49.50</text>
<text x="518.0" y="1043.2" fill="#1a5fb4" text-anchor="middle" style="font-weight:bold">fundurile fac des asta</text>
<line x1="498.0" y1="1076.0" x2="274.9" y2="948.0" stroke="#c00" stroke-width="1.8"/>
<polygon points="268.0,944.0 276.9,944.5 272.9,951.5" fill="#c00"/>
<text x="498.0" y="1090.0" fill="#c00" text-anchor="middle" style="font-weight:bold">stopul din regulă (49.20) ține</text>
<text x="498.0" y="1104.0" fill="#c00" text-anchor="middle" style="font-weight:bold">al doilea picior rămâne peste el</text>
<line x1="518.0" y1="823.6" x2="375.9" y2="848.2" stroke="#188a3e" stroke-width="1.8"/>
<polygon points="368.0,849.6 375.2,844.3 376.6,852.2" fill="#188a3e"/>
<text x="518.0" y="790.6" fill="#188a3e" text-anchor="middle" style="font-weight:bold">prețul ajunge la țintă</text>
<text x="518.0" y="804.6" fill="#188a3e" text-anchor="middle" style="font-weight:bold">dar numai cu stopul corect</text>
<text x="518.0" y="818.6" fill="#188a3e" text-anchor="middle" style="font-weight:bold">mai erai în trade</text>
<text x="24" y="1143" fill="#555">Barele de după intrare și stopul la ochi sunt construite, pentru contrast.</text>
<text x="318.0" y="916.0" fill="#c00" style="font-weight:bold">pe aici trece al doilea picior</text>
</svg>

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

View File

@@ -21,7 +21,7 @@ from buy_doji_ansamblu import serie, DOJI, CONF, DOJI_L, ENTRY, SL, TP1, R # no
OUT = Path(__file__).with_suffix(".svg")
S = 12 # prima bară arătată (zoom pe fereastra de intrare)
GREEN, RED, ORANGE, BLUE, GREY = "#188a3e", "#c00", "#b06000", "#1a5fb4", "#555"
W, SCALE = 930, 100.0
W, SCALE = 1320, 240.0
cds = serie()[S:20] # până la bara care atinge ținta
d, cf = DOJI - S, CONF - S # doji, confirmare (indici locali)
@@ -60,15 +60,10 @@ ch = Chart(
candles=cds,
levels=[Level(TP1, "ținta 1: 51.60 = 1R față de close", GREEN, "2 2"),
Level(TP_MED, f"ținta 1: {TP_MED:.2f} = 1R față de prețul mediu {MED:.2f}", BLUE, "2 2"),
Level(ENTRY, "intrarea (close-ul de confirmare): 50.40", GREEN, "4 3"),
Level(SL, "stopul: 49.20", RED, "4 3", "left")],
zones=[Zone(cf, cf, "", GREEN, p_top=T1, p_bot=op)],
arrows=[
Arrow(cf, "1/3 la close 50.40\nca să nu ratezi trade-ul dacă pleacă fără tine",
where="right", price=T1, color=GREEN, dx=150, dy=dy_sub(T1, 40)),
Arrow(cf, "1/3 cu ordin limită la 50.23 (o treime din corp)\nmai ieftin, dacă prețul revine",
where="right", price=T2, color=ORANGE, dx=150, dy=dy_sub(T2, 74)),
Arrow(cf, "1/3 cu ordin limită la 50.15 (jumătatea corpului)\nși mai ieftin",
where="right", price=T3, color=ORANGE, dx=150, dy=dy_sub(T3, 108)),
Arrow(cf - 1, "media mai bună coboară ținta:\nieși la 51.32, nu la 51.60",
where="above", price=TP_MED, color=BLUE, dx=150),
Arrow(cf + 1, "retestul: prețul revine la 50.10\nși umple amândouă ordinele limită",
@@ -76,7 +71,6 @@ ch = Chart(
],
scale=SCALE, gap=30, body_w=10, left=56, width=W,
title="Intrarea în trei tranșe — același trade (doji 50.10 / 49.25)",
caption="Paranteza de pe candela de confirmare e corpul ei (49.90 → 50.40): pe el se măsoară 1/3 și 1/2. Stopul e unul singur. Exemplu construit.",
)
svg = ch.render()
OFF = (float(re.search(r'<line x1="24" y1="([\d.]+)"', svg).group(1))
@@ -95,6 +89,25 @@ def Y(p):
def x(i):
return ch._cx(i) + OFF_X
CW, LH = 6.2, 14 # lățime caracter bold 12px, înălțime rând
def sageata(x1, y1, x2, y2, col, randuri):
"""Săgeată desenată de mână: coada la (x1,y1) lângă text, vârful la (x2,y2)."""
d = max(((x2 - x1) ** 2 + (y2 - y1) ** 2) ** 0.5, 1e-9)
ux, uy = (x2 - x1) / d, (y2 - y1) / d
bx, by = x2 - 8 * ux, y2 - 8 * uy
out = [f'<line x1="{x1:.1f}" y1="{y1:.1f}" x2="{bx:.1f}" y2="{by:.1f}" '
f'stroke="{col}" stroke-width="1.8"/>',
f'<polygon points="{x2:.1f},{y2:.1f} {bx - 4 * uy:.1f},{by + 4 * ux:.1f} '
f'{bx + 4 * uy:.1f},{by - 4 * ux:.1f}" fill="{col}"/>']
y0 = y1 + 4 - LH * (len(randuri) - 1) / 2
for k, t in enumerate(randuri):
out.append(f'<text x="{x1 + 6:.1f}" y="{y0 + LH * k:.1f}" fill="{col}" '
f'style="font-weight:bold">{t}</text>')
return out
ex = []
# paranteza corpului, în stânga candelei de confirmare, cu diviziunile 1/3 și 1/2
xb = x(cf) - 17
@@ -102,33 +115,79 @@ ex.append(f'<polyline points="{xb + 5:.1f},{Y(T1):.1f} {xb:.1f},{Y(T1):.1f} {xb:
f'{xb + 5:.1f},{Y(op):.1f}" fill="none" stroke="{GREY}" stroke-width="2"/>')
# fără etichetă lângă paranteză: oriunde lângă candele s-ar suprapune peste ele
# sau peste liniile săgeților. O numește legenda de sub grafic.
# nivelurile de tranșă, ca segmente scurte peste candela de confirmare
for p, col in ((T1, GREEN), (T2, ORANGE), (T3, ORANGE)):
dash = "" if p == T1 else ' stroke-dasharray="3 3"'
ex.append(f'<line x1="{xb:.1f}" y1="{Y(p):.1f}" x2="{x(cf) + 8:.1f}" y2="{Y(p):.1f}" '
f'stroke="{col}" stroke-width="1.5"{dash}/>')
# Fiecare tranșă are linia ei de nivel, prelungită la dreapta pe o lungime
# diferită, cu prețul scris la capăt. Săgeata tranșei se termină pe capătul
# liniei ei: trei puncte de sosire distanțate și pe orizontală, și pe verticală
# (altfel, la aceeași candelă, cele trei vârfuri ies într-un ghem de 10 px).
XT1, XT2, XT3 = x(len(cds) - 1) + 230, x(len(cds) - 1) + 150, x(len(cds) - 1) + 70
TRANSE = ((T1, GREEN, XT1, "", ["1/3 la close 50.40",
"ca să nu ratezi trade-ul dacă pleacă fără tine"]),
(T2, ORANGE, XT2, ' stroke-dasharray="3 3"',
["1/3 cu ordin limită la 50.23 (o treime din corp)",
"mai ieftin, dacă prețul revine"]),
(T3, ORANGE, XT3, ' stroke-dasharray="3 3"',
["1/3 cu ordin limită la 50.15 (jumătatea corpului)",
"și mai ieftin"]))
XTAIL = x(len(cds) - 1) + 114 # coada tuturor celor trei săgeți, sub stop
for k, (p_, col, xend, dash, randuri) in enumerate(TRANSE):
if p_ != T1: # T1 e chiar nivelul de intrare, deja desenat
ex.append(f'<line x1="{xb:.1f}" y1="{Y(p_):.1f}" x2="{xend:.1f}" y2="{Y(p_):.1f}" '
f'stroke="{col}" stroke-width="1.5"{dash}/>')
# prețul deasupra liniei, nu pe ea
ex.append(f'<text x="{xend + 6:.1f}" y="{Y(p_) - 6:.1f}" fill="{col}" '
f'style="font-weight:bold">{p_:.2f}</text>')
ex += sageata(XTAIL, Y(SL) + 46 + 40 * k, xend, Y(p_), col, randuri)
# unde se umple fiecare tranșă: T1 la close, T2 și T3 pe low-ul barei următoare
for i, p, col in ((cf, T1, GREEN), (cf + 1, T2, ORANGE), (cf + 1, T3, ORANGE)):
ex.append(f'<circle cx="{x(i):.1f}" cy="{Y(p):.1f}" r="4" fill="#fff" '
for i, p_, col in ((cf, T1, GREEN), (cf + 1, T2, ORANGE), (cf + 1, T3, ORANGE)):
ex.append(f'<circle cx="{x(i):.1f}" cy="{Y(p_):.1f}" r="4" fill="#fff" '
f'stroke="{col}" stroke-width="2"/>')
# cele două paranteze de risc, la dreapta: tot la close vs cu tranșe
for xp, hi_p, txt, col in ((x(len(cds) - 1) + 40, T1,
f"risc {RISC_CLOSE:.2f} pe acțiune (tot la close)", RED),
(x(len(cds) - 1) + 290, MED,
f"risc {RISC_MED:.2f} pe acțiune (cu tranșe, preț mediu {MED:.2f})", BLUE)):
# cele două paranteze de risc: tot la close vs cu tranșe. Pleacă amândouă de la
# un nivel desenat (intrarea 50.40, respectiv media 50.26) și coboară la stop.
# Stau una lângă alta, cu textele la dreapta amândurora, la înălțimi diferite —
# altfel textul uneia trece peste paranteza celeilalte.
XTXT = x(len(cds) - 1) + 664
for xp, hi_p, ty, txt, col in (
(x(len(cds) - 1) + 560, T1, Y(T1) + 50,
f"risc {RISC_CLOSE:.2f} pe acțiune (tot la close, de la intrarea {T1:.2f})", RED),
(x(len(cds) - 1) + 640, MED, Y(SL) - 50,
f"risc {RISC_MED:.2f} pe acțiune (cu tranșe, de la prețul mediu {MED:.2f})", BLUE)):
y1, y2 = Y(hi_p), Y(SL)
ex.append(f'<polyline points="{xp - 5:.1f},{y1:.1f} {xp:.1f},{y1:.1f} {xp:.1f},{y2:.1f} '
f'{xp - 5:.1f},{y2:.1f}" fill="none" stroke="{col}" stroke-width="1.5"/>')
ex.append(f'<text x="{xp + 6:.1f}" y="{(y1 + y2) / 2 + 4:.1f}" fill="{col}" '
ex.append(f'<line x1="{xp:.1f}" y1="{ty - 4:.1f}" x2="{XTXT - 6:.1f}" y2="{ty - 4:.1f}" '
f'stroke="{col}" stroke-width="1" stroke-dasharray="2 3"/>')
ex.append(f'<text x="{XTXT:.1f}" y="{ty:.1f}" fill="{col}" '
f'style="font-weight:bold">{txt}</text>')
# nivelul prețului mediu: segment scurt, ca paranteza albastră să plece de pe o linie
ex.append(f'<line x1="{XT1 + 60:.1f}" y1="{Y(MED):.1f}" x2="{x(len(cds) - 1) + 640:.1f}" '
f'y2="{Y(MED):.1f}" stroke="{BLUE}" stroke-width="1.2" stroke-dasharray="2 3"/>')
ex.append(f'<text x="{XT1 + 60:.1f}" y="{Y(MED) + 16:.1f}" fill="{BLUE}">'
f'prețul mediu al celor trei tranșe: {MED:.2f}</text>')
body = svg.rsplit("</svg>", 1)[0].rstrip()
svg = "\n ".join([body, *ex]) + "\n</svg>"
vw, vh = (float(v) for v in re.search(r'viewBox="0 0 ([\d.]+) ([\d.]+)"', svg).groups())
# textele desenate manual trec sub pânza calculată de Chart: crește înălțimea
y_max = max(float(m) for m in re.findall(r'<text[^>]*\sy="([\d.]+)"', svg))
vh = max(vh, y_max + 34)
CAPTION = ("Paranteza de pe candela de confirmare e corpul ei (49.90 → 50.40): pe el se măsoară "
"1/3 și 1/2. Stopul e unul singur. Exemplu construit.")
svg = svg.replace("</svg>", f' <text x="24" y="{vh - 12:.1f}" fill="{GREY}">{CAPTION}</text>\n</svg>')
svg = re.sub(r'viewBox="0 0 [\d.]+ [\d.]+"', f'viewBox="0 0 {vw:.0f} {vh:.0f}"', svg, count=1)
for tx, attrs, txt in re.findall(r'<text x="([-\d.]+)"([^>]*)>(.*?)</text>', svg):
ty = float(re.search(r'y="([-\d.]+)"', attrs).group(1))
w = len(txt) * 6.2
w = len(txt) * CW
x0 = float(tx) - (w if 'text-anchor="end"' in attrs else w / 2 if 'middle' in attrs else 0)
assert 0 <= x0 and x0 + w <= vw and 0 <= ty <= vh, f"text în afara pânzei: {txt!r}"
assert 0 <= x0 and x0 + w <= vw, f"text în afara pânzei pe orizontală: {txt!r}"
assert 0 <= ty <= vh, f"text în afara pânzei pe verticală: {txt!r}"
assert "\n\n" not in svg, "linie goală în SVG"
# cele trei săgeți de tranșă trebuie să sosească la înălțimi și la x-uri distincte
tips = [(XT1, Y(T1)), (XT2, Y(T2)), (XT3, Y(T3))]
for (ax, ay), (bx_, by_) in ((tips[0], tips[1]), (tips[1], tips[2]), (tips[0], tips[2])):
assert abs(ax - bx_) >= 60 and abs(ay - by_) >= 18, \
f"vârfuri de săgeată prea apropiate: {(ax, ay)} vs {(bx_, by_)}"
OUT.write_text(svg, encoding="utf-8")
print(f"scris {OUT} ({vw:.0f}x{vh:.0f})")

View File

@@ -25,8 +25,13 @@ Măsurat pe toată candela (49.75 → 50.55), 1/3 ar fi 50.28, iar 1/2 iese tot
ADNOTĂRI
--------
Zonă verde peste corpul candelei de confirmare; paranteză cu corpul
(49.90 → 50.40) în stânga ei; trei segmente scurte pentru T1/T2/T3 și cerculețe
Nivel de intrare desenat pe toată lățimea (50.40 = T1), ca parantezele de risc
să aibă de unde pleca vizual. Zonă verde peste corpul candelei de confirmare;
paranteză cu corpul (49.90 → 50.40) în stânga ei; segmente pentru T2/T3 (T1 e
chiar nivelul de intrare), prelungite spre dreapta pe lungimi diferite, cu
prețul scris la capăt — fiecare săgeată de tranșă se termină pe capătul liniei
ei, deci cele trei vârfuri sunt distanțate și pe orizontală, și pe verticală
(la scara veche ieșeau într-un ghem de 10 px). Cerculețe
acolo unde se umple fiecare tranșă (T1 la close, T2 și T3 pe low-ul barei
următoare); trei săgeți, câte una pe tranșă, cu motivul („ca să nu ratezi
trade-ul dacă pleacă fără tine" / „mai ieftin, dacă prețul revine" / „și mai
@@ -43,7 +48,10 @@ ASSERT-URI
5. min(low) pe ultimele 4 candele de la confirmare == 49.25; stop 49.20.
6. close + 1.20 == 51.60, atinsă prima dată la ultima bară arătată.
7. măsurat pe toată candela: 1/3 == 50.28, 1/2 == 50.15 (tot T3).
8. niciun text nu iese din pânză.
8. niciun text nu iese din pânză (și pe lățime, și pe înălțime, ținând cont de
text-anchor).
9. cele trei vârfuri de săgeată de tranșă sunt la cel puțin 60 px unul de altul
pe orizontală și 18 px pe verticală.
SURSA
-----

View File

@@ -1,58 +1,66 @@
<svg viewBox="0 0 982 561" xmlns="http://www.w3.org/2000/svg" style="width:100%;height:auto;font:12px sans-serif">
<svg viewBox="0 0 1372 1031" 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">Intrarea în trei tranșe — același trade (doji 50.10 / 49.25)</text>
<rect x="218.3" y="271.0" width="20.0" height="50.0" fill="#188a3e" fill-opacity="0.08" stroke="#188a3e" stroke-width="1"/>
<line x1="24" y1="151.0" x2="968" y2="151.0" stroke="#188a3e" stroke-width="1.5" stroke-dasharray="2 2"/>
<text x="954" y="145.0" fill="#188a3e" text-anchor="end">ținta 1: 51.60 = 1R față de close</text>
<line x1="24" y1="179.0" x2="968" y2="179.0" stroke="#1a5fb4" stroke-width="1.5" stroke-dasharray="2 2"/>
<text x="954" y="173.0" fill="#1a5fb4" text-anchor="end">ținta 1: 51.32 = 1R față de prețul mediu 50.26</text>
<line x1="24" y1="391.0" x2="968" y2="391.0" stroke="#c00" stroke-width="1.5" stroke-dasharray="4 3"/>
<text x="30" y="385.0" fill="#c00">stopul: 49.20</text>
<line x1="108.3" y1="56.0" x2="108.3" y2="241.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="103.3" y="81.0" width="10" height="130.0" fill="#c00"/>
<line x1="138.3" y1="186.0" x2="138.3" y2="376.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="133.3" y="211.0" width="10" height="135.0" fill="#c00"/>
<line x1="168.3" y1="301.0" x2="168.3" y2="386.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="163.3" y="346.0" width="10" height="5.0" fill="#c00"/>
<line x1="198.3" y1="306.0" x2="198.3" y2="366.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="193.3" y="321.0" width="10" height="30.0" fill="#188a3e"/>
<line x1="228.3" y1="256.0" x2="228.3" y2="336.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="223.3" y="271.0" width="10" height="50.0" fill="#188a3e"/>
<line x1="258.3" y1="196.0" x2="258.3" y2="301.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="253.3" y="221.0" width="10" height="50.0" fill="#188a3e"/>
<line x1="288.3" y1="166.0" x2="288.3" y2="251.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="283.3" y="191.0" width="10" height="30.0" fill="#188a3e"/>
<line x1="318.3" y1="136.0" x2="318.3" y2="221.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="313.3" y="161.0" width="10" height="30.0" fill="#188a3e"/>
<line x1="417.3" y1="431.0" x2="243.3" y2="276.3" stroke="#188a3e" stroke-width="1.8"/>
<polygon points="237.3,271.0 245.9,273.3 240.6,279.3" fill="#188a3e"/>
<text x="421.3" y="428.0" fill="#188a3e" text-anchor="start" style="font-weight:bold">1/3 la close 50.40</text>
<text x="421.3" y="442.0" fill="#188a3e" text-anchor="start" style="font-weight:bold">ca să nu ratezi trade-ul dacă pleacă fără tine</text>
<line x1="417.3" y1="465.0" x2="243.0" y2="293.6" stroke="#b06000" stroke-width="1.8"/>
<polygon points="237.3,288.0 245.8,290.8 240.2,296.5" fill="#b06000"/>
<text x="421.3" y="462.0" fill="#b06000" text-anchor="start" style="font-weight:bold">1/3 cu ordin limită la 50.23 (o treime din corp)</text>
<text x="421.3" y="476.0" fill="#b06000" text-anchor="start" style="font-weight:bold">mai ieftin, dacă prețul revine</text>
<line x1="417.3" y1="499.0" x2="242.6" y2="302.0" stroke="#b06000" stroke-width="1.8"/>
<polygon points="237.3,296.0 245.6,299.3 239.6,304.6" fill="#b06000"/>
<text x="421.3" y="496.0" fill="#b06000" text-anchor="start" style="font-weight:bold">1/3 cu ordin limită la 50.15 (jumătatea corpului)</text>
<text x="421.3" y="510.0" fill="#b06000" text-anchor="start" style="font-weight:bold">și mai ieftin</text>
<line x1="348.3" y1="128.0" x2="205.9" y2="172.6" stroke="#1a5fb4" stroke-width="1.8"/>
<polygon points="198.3,175.0 204.7,168.8 207.1,176.4" fill="#1a5fb4"/>
<text x="348.3" y="109.0" fill="#1a5fb4" text-anchor="middle" style="font-weight:bold">media mai bună coboară ținta:</text>
<text x="348.3" y="123.0" fill="#1a5fb4" text-anchor="middle" style="font-weight:bold">ieși la 51.32, nu la 51.60</text>
<line x1="108.3" y1="414.0" x2="251.8" y2="309.7" stroke="#1a5fb4" stroke-width="1.8"/>
<polygon points="258.3,305.0 254.2,312.9 249.5,306.5" fill="#1a5fb4"/>
<text x="108.3" y="428.0" fill="#1a5fb4" text-anchor="middle" style="font-weight:bold">retestul: prețul revine la 50.10</text>
<text x="108.3" y="442.0" fill="#1a5fb4" text-anchor="middle" style="font-weight:bold">și umple amândouă ordinele limită</text>
<text x="24" y="549" fill="#555">Paranteza de pe candela de confirmare e corpul ei (49.90 → 50.40): pe el se măsoară 1/3 și 1/2. Stopul e unul singur. Exemplu construit.</text>
<polyline points="216.3,271.0 211.3,271.0 211.3,321.0 216.3,321.0" fill="none" stroke="#555" stroke-width="2"/>
<line x1="211.3" y1="271.0" x2="236.3" y2="271.0" stroke="#188a3e" stroke-width="1.5"/>
<line x1="211.3" y1="288.0" x2="236.3" y2="288.0" stroke="#b06000" stroke-width="1.5" stroke-dasharray="3 3"/>
<line x1="211.3" y1="296.0" x2="236.3" y2="296.0" stroke="#b06000" stroke-width="1.5" stroke-dasharray="3 3"/>
<circle cx="228.3" cy="271.0" r="4" fill="#fff" stroke="#188a3e" stroke-width="2"/>
<circle cx="258.3" cy="288.0" r="4" fill="#fff" stroke="#b06000" stroke-width="2"/>
<circle cx="258.3" cy="296.0" r="4" fill="#fff" stroke="#b06000" stroke-width="2"/>
<polyline points="353.3,271.0 358.3,271.0 358.3,391.0 353.3,391.0" fill="none" stroke="#c00" stroke-width="1.5"/>
<text x="364.3" y="335.0" fill="#c00" style="font-weight:bold">risc 1.20 pe acțiune (tot la close)</text>
<polyline points="603.3,285.0 608.3,285.0 608.3,391.0 603.3,391.0" fill="none" stroke="#1a5fb4" stroke-width="1.5"/>
<text x="614.3" y="342.0" fill="#1a5fb4" style="font-weight:bold">risc 1.06 pe acțiune (cu tranșe, preț mediu 50.26)</text>
<rect x="218.3" y="572.0" width="20.0" height="120.0" fill="#188a3e" fill-opacity="0.08" stroke="#188a3e" stroke-width="1"/>
<line x1="24" y1="284.0" x2="1358" y2="284.0" stroke="#188a3e" stroke-width="1.5" stroke-dasharray="2 2"/>
<text x="1344" y="278.0" fill="#188a3e" text-anchor="end">ținta 1: 51.60 = 1R față de close</text>
<line x1="24" y1="351.2" x2="1358" y2="351.2" stroke="#1a5fb4" stroke-width="1.5" stroke-dasharray="2 2"/>
<text x="1344" y="345.2" fill="#1a5fb4" text-anchor="end">ținta 1: 51.32 = 1R față de prețul mediu 50.26</text>
<line x1="24" y1="572.0" x2="1358" y2="572.0" stroke="#188a3e" stroke-width="1.5" stroke-dasharray="4 3"/>
<text x="1344" y="566.0" fill="#188a3e" text-anchor="end">intrarea (close-ul de confirmare): 50.40</text>
<line x1="24" y1="860.0" x2="1358" y2="860.0" stroke="#c00" stroke-width="1.5" stroke-dasharray="4 3"/>
<text x="30" y="854.0" fill="#c00">stopul: 49.20</text>
<line x1="108.3" y1="56.0" x2="108.3" y2="500.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="103.3" y="116.0" width="10" height="312.0" fill="#c00"/>
<line x1="138.3" y1="368.0" x2="138.3" y2="824.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="133.3" y="428.0" width="10" height="324.0" fill="#c00"/>
<line x1="168.3" y1="644.0" x2="168.3" y2="848.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="163.3" y="752.0" width="10" height="12.0" fill="#c00"/>
<line x1="198.3" y1="656.0" x2="198.3" y2="800.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="193.3" y="692.0" width="10" height="72.0" fill="#188a3e"/>
<line x1="228.3" y1="536.0" x2="228.3" y2="728.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="223.3" y="572.0" width="10" height="120.0" fill="#188a3e"/>
<line x1="258.3" y1="392.0" x2="258.3" y2="644.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="253.3" y="452.0" width="10" height="120.0" fill="#188a3e"/>
<line x1="288.3" y1="320.0" x2="288.3" y2="524.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="283.3" y="380.0" width="10" height="72.0" fill="#188a3e"/>
<line x1="318.3" y1="248.0" x2="318.3" y2="452.0" stroke="#1a1a1a" stroke-width="1.2"/>
<rect x="313.3" y="308.0" width="10" height="72.0" fill="#188a3e"/>
<line x1="348.3" y1="240.0" x2="204.8" y2="342.5" stroke="#1a5fb4" stroke-width="1.8"/>
<polygon points="198.3,347.2 202.5,339.3 207.1,345.8" fill="#1a5fb4"/>
<text x="348.3" y="221.0" fill="#1a5fb4" text-anchor="middle" style="font-weight:bold">media mai bună coboară ținta:</text>
<text x="348.3" y="235.0" fill="#1a5fb4" text-anchor="middle" style="font-weight:bold">ieși la 51.32, nu la 51.60</text>
<line x1="108.3" y1="876.0" x2="253.9" y2="654.7" stroke="#1a5fb4" stroke-width="1.8"/>
<polygon points="258.3,648.0 257.2,656.9 250.6,652.5" fill="#1a5fb4"/>
<text x="108.3" y="890.0" fill="#1a5fb4" text-anchor="middle" style="font-weight:bold">retestul: prețul revine la 50.10</text>
<text x="108.3" y="904.0" fill="#1a5fb4" text-anchor="middle" style="font-weight:bold">și umple amândouă ordinele limită</text>
<polyline points="216.3,572.0 211.3,572.0 211.3,692.0 216.3,692.0" fill="none" stroke="#555" stroke-width="2"/>
<text x="554.3" y="566.0" fill="#188a3e" style="font-weight:bold">50.40</text>
<line x1="432.3" y1="906.0" x2="545.7" y2="579.6" stroke="#188a3e" stroke-width="1.8"/>
<polygon points="548.3,572.0 549.5,580.9 541.9,578.2" fill="#188a3e"/>
<text x="438.3" y="903.0" fill="#188a3e" style="font-weight:bold">1/3 la close 50.40</text>
<text x="438.3" y="917.0" fill="#188a3e" style="font-weight:bold">ca să nu ratezi trade-ul dacă pleacă fără tine</text>
<line x1="211.3" y1="612.8" x2="468.3" y2="612.8" stroke="#b06000" stroke-width="1.5" stroke-dasharray="3 3"/>
<text x="474.3" y="606.8" fill="#b06000" style="font-weight:bold">50.23</text>
<line x1="432.3" y1="946.0" x2="467.4" y2="620.8" stroke="#b06000" stroke-width="1.8"/>
<polygon points="468.3,612.8 471.4,621.2 463.5,620.3" fill="#b06000"/>
<text x="438.3" y="943.0" fill="#b06000" style="font-weight:bold">1/3 cu ordin limită la 50.23 (o treime din corp)</text>
<text x="438.3" y="957.0" fill="#b06000" style="font-weight:bold">mai ieftin, dacă prețul revine</text>
<line x1="211.3" y1="632.0" x2="388.3" y2="632.0" stroke="#b06000" stroke-width="1.5" stroke-dasharray="3 3"/>
<text x="394.3" y="626.0" fill="#b06000" style="font-weight:bold">50.15</text>
<line x1="432.3" y1="986.0" x2="389.3" y2="639.9" stroke="#b06000" stroke-width="1.8"/>
<polygon points="388.3,632.0 393.3,639.4 385.3,640.4" fill="#b06000"/>
<text x="438.3" y="983.0" fill="#b06000" style="font-weight:bold">1/3 cu ordin limită la 50.15 (jumătatea corpului)</text>
<text x="438.3" y="997.0" fill="#b06000" style="font-weight:bold">și mai ieftin</text>
<circle cx="228.3" cy="572.0" r="4" fill="#fff" stroke="#188a3e" stroke-width="2"/>
<circle cx="258.3" cy="612.8" r="4" fill="#fff" stroke="#b06000" stroke-width="2"/>
<circle cx="258.3" cy="632.0" r="4" fill="#fff" stroke="#b06000" stroke-width="2"/>
<polyline points="873.3,572.0 878.3,572.0 878.3,860.0 873.3,860.0" fill="none" stroke="#c00" stroke-width="1.5"/>
<line x1="878.3" y1="618.0" x2="976.3" y2="618.0" stroke="#c00" stroke-width="1" stroke-dasharray="2 3"/>
<text x="982.3" y="622.0" fill="#c00" style="font-weight:bold">risc 1.20 pe acțiune (tot la close, de la intrarea 50.40)</text>
<polyline points="953.3,605.6 958.3,605.6 958.3,860.0 953.3,860.0" fill="none" stroke="#1a5fb4" stroke-width="1.5"/>
<line x1="958.3" y1="806.0" x2="976.3" y2="806.0" stroke="#1a5fb4" stroke-width="1" stroke-dasharray="2 3"/>
<text x="982.3" y="810.0" fill="#1a5fb4" style="font-weight:bold">risc 1.06 pe acțiune (cu tranșe, de la prețul mediu 50.26)</text>
<line x1="608.3" y1="605.6" x2="958.3" y2="605.6" stroke="#1a5fb4" stroke-width="1.2" stroke-dasharray="2 3"/>
<text x="608.3" y="621.6" fill="#1a5fb4">prețul mediu al celor trei tranșe: 50.26</text>
<text x="24" y="1019.0" fill="#555">Paranteza de pe candela de confirmare e corpul ei (49.90 → 50.40): pe el se măsoară 1/3 și 1/2. Stopul e unul singur. Exemplu construit.</text>
</svg>

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB