diff --git a/gen/az_earnings.py b/gen/az_earnings.py index 7213263..e8e95c2 100644 --- a/gen/az_earnings.py +++ b/gen/az_earnings.py @@ -294,19 +294,18 @@ entry_n = cds[CH].c sl_n = round(min(c.l for c in cds[CH - 2:CH + 1]) - 0.10, 2) risk_n = entry_n - sl_n stop_bar = next(i for i in range(CH + 1, len(cds)) if cds[i].l <= sl_n) -assert stop_bar - CH == 2, "textul: stop atins a doua zi după intrare" +assert stop_bar - CH == 2 and cds[CH + 1].l > sl_n >= cds[stop_bar].l, "textul: stop atins la a doua bară după intrare (67.70), nu la prima (68.90)" dist_gap = pct(gap_top, entry_n) FACTS["gpn"] = dict(entry=entry_n, sl=sl_n, risk=risk_n, dist=dist_gap, stop=stop_bar - CH) print(f"D4 chase entry {f2(entry_n)} ({dist_gap:.1f}% peste sus gap) SL {f2(sl_n)} risc {f2(risk_n)} stop la +{stop_bar - CH}") ch = PChart(candles=cds[:34], levels=[Level(entry_n, f"intrare {f2(entry_n)} (după ce s-a dus)", PURPLE), - Level(sl_n, f"SL {f2(sl_n)}", RED), + Level(sl_n, f"SL {f2(sl_n)}: atins la a doua bară după intrare", RED), Level(gap_top, f"sus gap {f2(gap_top)}", ORANGE), Level(half, f"1/2 gap {f2(half)}", ORANGE, dash="2 3"), Level(gap_bot, f"jos gap {f2(gap_bot)}", ORANGE)], marks=[Mark(G, f"gap +{gap_pct:.1f}%", GREEN, "below", dy=2), Mark(CH, "cumpărat aici", PURPLE, "above", dy=-4), - Mark(stop_bar, "stop", RED, "below", dy=2), Mark(HM, "intrarea bună vine aici", GREEN, "below", dy=2)], scale=18, vol_h=70, title=T_D, caption="Același gap. Cine cumpără după 4 zile de urcare e scos de pullback-ul normal spre gap.", **STYLE) @@ -453,9 +452,11 @@ assert fn[1][1] < -7.5 and cds[E[1] + 1].h < cds[E[1]].l FACTS["pre_n"] = fn print("D8", [(f"{d:.1f}%", g and f"{g:.1f}%") for d, g in fn]) ch = PChart(candles=cds, seps=[E[0] + 1, E[1] + 1], - marks=[Mark(E[0] + 1, f"E1 +{fn[0][1]:.0f}%", GREEN, "above", dy=-4), + marks=[Mark(E[0] - 2, f"{fn[0][0]:.0f}%", RED, "above", dy=-8), + Mark(E[0] + 1, f"E1 +{fn[0][1]:.0f}%", GREEN, "above", dy=-4), Mark(E[1] - 2, f"{fn[1][0]:.0f}%", RED, "above", dy=-8), Mark(E[1] + 1, f"E2 {fn[1][1]:.0f}%", RED, "below", dy=4), + Mark(E[2] - 2, f"{fn[2][0]:.0f}%", RED, "above", dy=-8), Mark(E[2], "E3 ?", ORANGE, "below", dy=4)], scale=9, title=T_W, caption="Aceeași cădere pre-raport, dar la E2 a urmat gap down. Istoric amestecat: fără edge.", **STYLE) @@ -514,7 +515,7 @@ ch = PChart(candles=cds, Level(lo, f"−{EM:.0f}% implicit {f2(lo)}", GRAY, dash="2 3"), Level(P_SELL, f"put vândut {P_SELL:.2f}", BLUE), Level(P_BUY, f"put cumpărat {P_BUY:.2f}", PURPLE)], - marks=[Mark(13, "range, fără bias", GRAY, "above", dy=-8), + marks=[Mark(13, "range, fără bias", GRAY, "above", dy=-3), Mark(E, "raport", ORANGE, "above", dy=-20), Mark(G, f"+{move:.1f}%", GREEN, "below", dy=10)], scale=14, title=T_D, diff --git a/gen/az_executie.py b/gen/az_executie.py index d3c089e..0abe64f 100644 --- a/gen/az_executie.py +++ b/gen/az_executie.py @@ -231,7 +231,7 @@ def be_chart(tail, name, nu): Seg(mv, n - 1, r1, f"+1R {f2(r1)}: aici muți stopul", GRAY, dash="2 3")] marks = [Mark(T, "intrare", GREEN, "below", dy=4), Mark(mv, "+1R", GRAY, "above", dy=-2)] if nu: - marks += [Mark(out, "scos la 0", ORANGE, "below", dy=4), Mark(hit, "4R, fără tine", BLUE, "above", dy=-2)] + marks += [Mark(out, "scos la 0", ORANGE, "below", dy=4), Mark(hit, "4R, fără tine", BLUE, "above", dy=-6)] cap = "Codița coboară până la intrare (25.39): ieși pe zero, apoi prețul merge la țintă." else: marks += [Mark(hit, "4R", BLUE, "above", dy=-2)] @@ -265,7 +265,7 @@ per = n5 // 3 assert sl < min(c.l for c in cds[T - 3:T + 1]) and n5 == 48 h1 = first(cds, T + 1, lambda c: c.h >= tp1) h2 = first(cds, h1 + 1, lambda c: c.h >= tp2) -assert min(c.l for c in cds[T + 1:h1 + 1]) > sl and min(c.l for c in cds[h1 + 1:]) > entry, "BE nu e atins" +assert min(c.l for c in cds[T + 1:]) > sl, "stopul inițial nu e atins" # trail: linia = low-ul ultimei candele care a închis peste high-ul precedentei; urcă doar; ieși la close sub ea trail, steps, ex = None, [], None for i in range(h1 + 1, len(cds)): @@ -284,8 +284,8 @@ print(f"D5 entry {f2(entry)} SL {f2(sl)} {n5}={per}x3; TP1 {f2(tp1)} la {h1}, TP f"({R_tot:.2f}R pe riscul de {f2(n5 * (entry - sl))})") TP3 = dict(entry=entry, sl=sl, tp1=tp1, tp2=tp2, n=n5, per=per, x=x_price, pnl=pnl, R=R_tot, steps=steps, risk=n5 * (entry - sl), h1=h1 - T, h2=h2 - T, ex=ex - T) -segs = [Seg(T, h1, sl, f"SL {f2(sl)} (toate 3)", RED), - Seg(T, len(cds) - 1, entry, f"intrare {f2(entry)}; după TP1 = stop la zero", GREEN), +segs = [Seg(T, steps[0][0] - 1, sl, f"SL inițial {f2(sl)} (toate 3)", RED), + Seg(T, len(cds) - 1, entry, f"intrare {f2(entry)}", GREEN), Seg(T, h1, tp1, f"TP1 {f2(tp1)} = 1R: poziția 1", BLUE, dash="4 3"), Seg(T, h2, tp2, f"TP2 {f2(tp2)} = 2R: poziția 2", PURPLE, dash="4 3")] for k, (i, p) in enumerate(steps): @@ -330,9 +330,9 @@ print(f"D6 vârf {f2(hi)} entry {f2(entry)} SL {f2(sl)} risc {f2(risk)} 1/2 {f2( HALF = dict(hi=hi, entry=entry, sl=sl, risk=risk, half=half, Rh=Rh, Rg=Rg, peak=peak, hh=hh - T, covered=(peak - entry) / (hi - entry)) n = len(cds) -common = [Seg(0, n - 1, SUP, f"confluență S2 + suport monthly {SUP:.2f}", PURPLE, dash="2 3"), +common = [Seg(0, n - 1, SUP, "", PURPLE, dash="2 3"), Seg(T, n - 1, entry, f"intrare {f2(entry)}", GREEN), - Seg(T, n - 1, sl, f"SL {f2(sl)} = −1R", RED)] + Seg(T, n - 1, sl, f"SL {f2(sl)} = −1R, sub confluența S2 + monthly {SUP:.2f} (mov)", RED)] ch = PChart(candles=cds, segs=common + [Seg(top, n - 1, hi, f"vârf anterior {f2(hi)}", GRAY, dash="4 3"), Seg(T, n - 1, half, f"TP = 1/2 din distanță {f2(half)} = {Rh:.1f}R", BLUE, dash="4 3")], @@ -386,14 +386,14 @@ t1, t2, t3 = trades n = len(cds) ch = PChart(candles=cds, segs=[Seg(t3["i"], n - 1, t3["tp"], f"#3 TP {f2(t3['tp'])} = 4R = +100 $", BLUE, dash="4 3"), - Seg(t1["i"], t1["stop"], t1["e"], f"#1 intrare {f2(t1['e'])} ({t1['n']} acț.)", GREEN), - Seg(t1["i"], t1["stop"], t1["s"], f"#1 SL {f2(t1['s'])}: −25 $", RED), - Seg(t2["i"], t2["stop"], t2["e"], f"#2 intrare {f2(t2['e'])} ({t2['n']} acț.)", GREEN), - Seg(t2["i"], t2["stop"], t2["s"], f"#2 SL {f2(t2['s'])}: −25 $", RED), + Seg(t1["i"], t1["stop"], t1["e"], f"#1 intrare {f2(t1['e'])} ({t1['n']} acț.)", GREEN, "left"), + Seg(t1["i"], t1["stop"], t1["s"], f"#1 SL {f2(t1['s'])}: −25 $", RED, "lm"), + Seg(t2["i"], t2["stop"], t2["e"], f"#2 intrare {f2(t2['e'])} ({t2['n']} acț.)", GREEN, "left"), + Seg(t2["i"], t2["stop"], t2["s"], f"#2 SL {f2(t2['s'])}: −25 $", RED, "lm"), Seg(t3["i"], t3["hit"], t3["e"], f"#3 intrare {f2(t3['e'])} ({t3['n']} acț.)", GREEN), Seg(t3["i"], t3["hit"], t3["s"], f"#3 SL {f2(t3['s'])}", RED)], - marks=[Mark(t1["i"], "#1", GREEN, "above", dy=-2), Mark(t1["stop"], "stop", RED, "below", dy=4), - Mark(t2["i"], "#2", GREEN, "above", dy=-2), Mark(t2["stop"], "stop", RED, "below", dy=4), + marks=[Mark(t1["stop"], "stop", RED, "below", dy=4), + Mark(t2["stop"], "stop", RED, "below", dy=4), Mark(t3["i"], "#3", GREEN, "above", dy=-4), Mark(t3["hit"], "4R", BLUE, "above", dy=-2)], scale=170, title="Exemplu construit (fără ticker) — 5 min", caption="Două stopuri de câte 25 $, a treia intrare cu același risc: −25 −25 +100 = +50 $.", **STYLE) @@ -438,8 +438,10 @@ n = len(cds) ch = PChart(candles=cds, segs=[Seg(top, n - 1, tgt, f"țintă: vârful anterior {tgt:.0f}", BLUE, dash="4 3"), Seg(SH, n - 1, sh, f"vârful după HL {sh:.0f} (aici NU cumperi tot)", GRAY, dash="2 3")] - + [Seg(i, n - 1, p, f"tranșa {k + 1}: {per9} acț. la {p:.0f} ({nm})", GREEN) - for k, (i, p, nm) in enumerate(lv)] + + [Seg(lv[0][0], n - 1, lv[0][1], f"tranșele 1 și 3: câte {per9} acț. la {lv[0][1]:.0f} / {lv[2][1]:.0f}", GREEN), + Seg(lv[1][0], n - 1, lv[1][1], f"tranșa 2: {per9} acț. la {lv[1][1]:.0f} (1/3)", GREEN), + Seg(lv[2][0], n - 1, lv[2][1], "", GREEN), + Seg(lv[3][0], n - 1, lv[3][1], f"tranșa 4: {per9} acț. la {lv[3][1]:.0f} (2/3)", GREEN)] + [Seg(CF, n - 1, sl9, f"SL comun {sl9:.0f} (sub HL {cds[HL].l:.0f})", RED)], marks=[Mark(11, "low", GRAY, "below", dy=4), Mark(HL, "HL", GREEN, "below", dy=4), Mark(SH, "vârf", GRAY, "above", dy=-2), Mark(hit, "țintă", BLUE, "above", dy=-2)], @@ -459,7 +461,7 @@ cl10 = [60.40, 60.10, 60.50, 60.20, 48.85, # 23 doji 49.60, # 24 buy doji 50.20, 49.90, 50.70, 51.30, 51.00, 51.80, 52.60, 52.20, 53.00, 53.80, 53.40, 54.30, 55.00, 54.60, 55.50, - 56.20, 55.90, 56.70, 57.00, 56.30] + 56.20, 55.90, 56.70, 56.40, 55.90] w10 = [(0.2, 0.2)] * 4 + [(0.05, 0.05)] + [(0.2, 0.2)] * 18 + [(0.4, 0.4)] + [(0.2, 0.2)] * 21 cds = from_closes(cl10, wicks=w10, start=60.30) MAR, DJ, T = 4, 23, 24 @@ -483,7 +485,7 @@ sma_hit = sma[hits["SMA-200"]] assert R1 < R2 < ph < sma_hit < half_m < sup, (R1, R2, ph, sma_hit, half_m, sup) assert hits["R1"] < hits["R2"] < hits["vârf"] < hits["SMA-200"] assert max(c.h for c in cds[T + 1:]) < half_m and min(c.l for c in cds[T + 1:]) > sl -assert cds[-1].c < sma[-1], "respins sub SMA-200" +assert all(cds[i].c < sma[i] for i in range(hits["SMA-200"], len(cds))), "după atingere, nicio bară nu închide peste SMA-200" rs = {k: (p - entry) / risk for k, p in [("R1", R1), ("R2", R2), ("vârf", ph), ("SMA-200", sma_hit), ("1/2 marubozu", half_m), ("fost suport", sup)]} print(f"D10 entry {f2(entry)} SL {f2(sl)} risc {f2(risk)}; R1 {R1} R2 {R2} vârf {f2(ph)} SMA-200 la atingere " diff --git a/summaries/08_ANALIZA_ZILNICA/08_executie_si_risc.html b/summaries/08_ANALIZA_ZILNICA/08_executie_si_risc.html index 3c4af6a..ba80e23 100644 --- a/summaries/08_ANALIZA_ZILNICA/08_executie_si_risc.html +++ b/summaries/08_ANALIZA_ZILNICA/08_executie_si_risc.html @@ -464,102 +464,100 @@ riscul fix.
„Deci m-a scos până acum de 2 ori consecutiv […] Și n-am nicio greață"
-Din strategia buy doji din curs -(Strategia 3): intri cu un multiplu de -3 și fiecare parte iese altfel. Aici cu 25 $ risc total:
+Din Q&A 11.06.2025 +(trei poziții: TP1 la 1:1, TP2 la 2:1, a treia pe trail): intri cu poziția +normală, împărțită în 3, și fiecare parte iese altfel. Aici cu 25 $ risc total:
Trail-ul a urcat în 8 trepte, de la 40.35 la 41.95. Poziția 3 aduce singură
cât primele două la un loc. Fără ea, tranzacția ar fi fost 1.5R pe 2/3 din
-poziție. Fără TP1 și TP2, un stop pe break-even după primul pullback ar fi
-lăsat totul la zero.
Pe 03.09 (CHTR, după super buy doji și buy momentum): nu pui un singur TP, treci rezistențele de deasupra pe rând.
@@ -966,7 +967,7 @@ de resistance. Dacă e să trag fostul suport, devine resistance."DA — ținta la jumătate:
-NU — ținta lacomă, la vârf: Din curs: Strategia 3: Buy Doji / Sell Doji
-(ieșirea eșalonată pe 3 poziții, trailing stop). Documente înrudite:
+ Din curs: Q&A 11.06.2025
+(trei poziții: TP1 la 1:1, TP2 la 2:1, a treia pe trail sub swing low; de ce
+a treia poate risca stopul inițial). Strategia 3: Buy Doji / Sell Doji
+(ieșirea eșalonată pe 3 poziții: TP la 1:1 și trailing stop, fără TP2). Documente înrudite:
01 — buy doji și MICI (tranșele pe
MICI, ținte în trepte pe un exemplu), 04 — pivoți
(calculul R1 / R2).