//@version=6 indicator("Mocheur Combo — 21h50 + Open D + Asian", shorttitle = "Mocheur Combo", overlay = true, max_lines_count = 500, max_labels_count = 500, max_boxes_count = 500) // Mocheur Combo complet — ① Bougie 21h50 + ② Open journalier + ③ Asian Weekly // Liquidation = touch (high/low), fuseau Europe/Paris const string MOCH = "Mocheur" const string TZ = "Europe/Paris" const int THURSDAY_CONFIRM_H = 15 const int THURSDAY_CONFIRM_M = 30 string G_GEN = "Général" bool enCandle2150 = input.bool(true, "① Activer bougie horaire (21h50)", group = G_GEN) bool enDailyOpen = input.bool(true, "② Activer opens journaliers", group = G_GEN) bool enAsia = input.bool(true, "③ Activer session Asie + stratégie", group = G_GEN) string grpThu = "Jeudi — linéaire vs consolidation" float linearEffMin = input.float(0.35, "Efficacité min. (open→close / range)", minval = 0.15, maxval = 0.9, step = 0.01, group = grpThu) float linearDirRatio = input.float(1.35, "Ratio bougies directionnelles", minval = 1.05, maxval = 3.0, step = 0.05, group = grpThu) float linearImpulseMin = input.float(0.45, "Impulsion min. (open → high ou low)", minval = 0.25, maxval = 0.85, step = 0.01, group = grpThu) float linearCloseExt = input.float(0.38, "Clôture proche extrême (0–1)", minval = 0.25, maxval = 0.5, step = 0.01, group = grpThu, tooltip = "Ex. 0,38 → clôture dans le tiers haut ou bas du range.") string grpWeek = "Lun–Jeu — Asian classique" bool showWeekMark1 = input.bool(true, "Pastille 1️⃣ sur le côté liquidé", group = grpWeek) string MARK1_LBL = "1️⃣" color colMark1Bg = color.new(#0EA5E9, 0) color colMark1Txt = color.new(color.white, 0) string WEEK_ASIAN_CLASSIQUE = "Asian classique : le marché veut liquider les deux côtés (HIGH et LOW). Ce n’est pas obligatoire." string WEEK_TIP_HIGH = "Asian HIGH liquidé" string WEEK_TIP_LOW = "Asian LOW liquidé" string HINT_SURVOL = "Survolez ce symbole pour l’explication." string MOCH_NOT_100 = "\n\nCe n’est pas une règle à 100 % : il y aura toujours des exceptions." string WEEK_TOOLTIP_BTN = HINT_SURVOL + "\n\n" + WEEK_ASIAN_CLASSIQUE string THU_LINEAR_TOOLTIP = HINT_SURVOL + "\n\nJeudi de continuation\n\nL’Asian part clairement dans un sens (même avec petits replis).\nLa journée continue en général dans le même sens.\n\nJeudi continuation = toute la journée dans le même sens.\n\nÀ partir de 15h30 : expansion nette → journée de continuation." + MOCH_NOT_100 string THU_WAIT_TOOLTIP = HINT_SURVOL + "\n\nJeudi — Asian en cours\n\nÀ la fin de session :\n• Linéaire → carte « Jeudi — continuation »\n• Consolidation → Asian classique (lun–mer)" string FRI_TOOLTIP_BTN = HINT_SURVOL + "\n\nVendredi — Asian\n\nObjectif : liquider le HIGH et le LOW Asian coûte que coûte.\n\n• HIGH liquidé en premier → chercher une vente pour viser le LOW Asian.\n• LOW liquidé en premier → chercher un achat pour viser le HIGH Asian." + MOCH_NOT_100 f_thuIsLinear(float o, float c, float hi, float lo, int bulls, int bears) => float rng = hi - lo float eff = rng > 0 ? math.abs(c - o) / rng : 0.0 float closePos = rng > 0 ? (c - lo) / rng : 0.5 float mid = (hi + lo) / 2 float excUp = hi - o float excDn = o - lo float impulse = rng > 0 ? math.max(excUp, excDn) / rng : 0.0 bool bullDom = bulls >= bears * linearDirRatio bool bearDom = bears >= bulls * linearDirRatio bool classic = eff >= linearEffMin and (bullDom or bearDom) bool byImpulse = impulse >= linearImpulseMin bool byCloseExt = closePos >= 1.0 - linearCloseExt or closePos <= linearCloseExt bool sameSide = c >= mid and o >= mid or c <= mid and o <= mid bool legThenRebound = impulse >= linearImpulseMin * 0.82 and eff >= 0.20 classic or byImpulse or byCloseExt or (sameSide and eff >= 0.22) or legThenRebound f_asianHelp(int dow, int thuType) => string txt = na string tip = na if dow == dayofweek.friday txt := "ⓘ Vendredi" tip := FRI_TOOLTIP_BTN else if dow == dayofweek.thursday if thuType == 1 txt := "ⓘ Jeudi — continuation" tip := THU_LINEAR_TOOLTIP else if thuType == 2 txt := "ⓘ Asian classique" tip := WEEK_TOOLTIP_BTN else txt := "ⓘ Jeudi" tip := THU_WAIT_TOOLTIP else if dow == dayofweek.monday or dow == dayofweek.tuesday or dow == dayofweek.wednesday txt := "ⓘ Asian classique" tip := WEEK_TOOLTIP_BTN [txt, tip] string grpAlert = "Alertes" bool alertsOn = input.bool(true, "Activer alertes TradingView", group = grpAlert) bool showAsianHelpBtn = input.bool(false, "Carte ⓘ aide au-dessus de l’Asian", group = grpAlert) int maxHelpCards = input.int(40, "Max cartes ⓘ sur historique", minval = 20, maxval = 200, group = grpAlert, tooltip = "TradingView limite le script à 500 labels — réduire si des pastilles manquent.") string grpFri = "Vendredi — Asian" bool showFriMarks = input.bool(true, "Pastille 1️⃣ + Objectif fait", group = grpFri) bool showFriEodStatus = input.bool(true, "Bilan fin de journée (à côté carte Vendredi)", group = grpFri) int friLabelOffset = input.int(20, "Label : décalage guide (barres)", minval = 0, maxval = 80, group = grpFri) bool friShowGuide = input.bool(false, "Trait guide discret", group = grpFri) bool showFriHelpTable = input.bool(false, "Afficher résumé vendredi (table)", group = grpFri, tooltip = "Survolez la carte ⓘ Vendredi pour l’explication.") string FRI_LBL_HINT = "Survolez ce symbole pour afficher l’explication." string FRI_TIP1_HIGH = FRI_LBL_HINT + "\n\nAsian HIGH liquidé — vendredi.\n\nIl faut aller chercher le LOW Asian : chercher une vente." + MOCH_NOT_100 string FRI_TIP1_LOW = FRI_LBL_HINT + "\n\nAsian LOW liquidé — vendredi.\n\nIl faut aller chercher le HIGH Asian : chercher un achat." + MOCH_NOT_100 string FRI_DONE_LBL = "Objectif\nfait" string FRI_DONE_TIP = FRI_LBL_HINT + "\n\nObjectif fait — Asian vendredi.\n\nLe HIGH et le LOW Asian sont liquidés." + MOCH_NOT_100 string FRI_EOD_TIP = FRI_LBL_HINT + "\n\nBilan fin de journée — vendredi Asian." + MOCH_NOT_100 string FRI_EOD_DONE = "Objectif fait" string FRI_EOD_FAIL_NONE = "Objectif non fait — aucun côté liquidé" string FRI_EOD_FAIL_LOW = "Objectif non fait — Asian LOW non liquidé" string FRI_EOD_FAIL_HIGH = "Objectif non fait — Asian HIGH non liquidé" f_friEodText(int firstSide, bool gotHigh, bool gotLow) => string txt = FRI_EOD_FAIL_NONE if gotHigh and gotLow txt := FRI_EOD_DONE else if firstSide == 1 and not gotLow txt := FRI_EOD_FAIL_LOW else if firstSide == 2 and not gotHigh txt := FRI_EOD_FAIL_HIGH else if firstSide != 0 txt := firstSide == 1 ? FRI_EOD_FAIL_LOW : FRI_EOD_FAIL_HIGH txt //━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // ① BOUGIE 21H50 //━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ string PASTILLE_TIP_2150 = HINT_SURVOL + "\n\nBougie 21h50 (M1)\n\nÀ 21h50, sur la bougie 1 minute, le marché cherche en général à liquider le HIGH et le LOW de cette bougie.\n\nSi les deux côtés sont liquidés : objectif fait pour la bougie 21h50.\n\nSi un côté n’a pas été liquidé avant la fin de journée : attendre l’ouverture de minuit (00h00 " + TZ + ") du lendemain. Il faut attendre minuit — la position à prendre pour liquider le côté restant (HIGH ou LOW de la bougie 21h50) se cherche à partir de cette ouverture de minuit, pas avant." + MOCH_NOT_100 string G_C2150 = "① Bougie horaire (21h50)" int targetHour = input.int(21, "Heure", minval = 0, maxval = 23, group = G_C2150, tooltip = "Heure " + TZ + " (ex. 21h50).") int targetMinute = input.int(50, "Minute", minval = 0, maxval = 59, group = G_C2150) color highColor2150 = input.color(color.new(#A855F7, 0), "Couleur mèche haute", group = G_C2150) color lowColor2150 = input.color(color.new(#C084FC, 0), "Couleur mèche basse", group = G_C2150) int lineWidth2150 = input.int(2, "Épaisseur", minval = 1, maxval = 5, group = G_C2150) string lineStyleIn2150 = input.string("Solid", "Style ligne", options = ["Solid", "Dashed", "Dotted"], group = G_C2150) int maxHistory2150 = input.int(40, "Nb max de bougies à garder", minval = 1, maxval = 250, group = G_C2150, tooltip = "Réduire si pastilles ⓘ 21h50 manquent (limite ~500 labels partagés).") lineStyle2150 = lineStyleIn2150 == "Dashed" ? line.style_dashed : lineStyleIn2150 == "Dotted" ? line.style_dotted : line.style_solid string G_PASTILLE_2150 = "① Pastille 21h50" bool showPastille2150 = input.bool(true, "Pastille ⓘ à côté de la bougie", group = G_PASTILLE_2150) bool pastilleM1Only = input.bool(false, "Pastille uniquement sur graphique 1 min", group = G_PASTILLE_2150) int pastilleBars = input.int(2, "Décalage à gauche (barres)", minval = 0, maxval = 15, group = G_PASTILLE_2150, tooltip = "Écart supplémentaire entre la bougie et les pastilles ⓘ / !.") int pastilleVertTicks = input.int(12, "Décalage vertical hors bougie (ticks)", minval = 0, maxval = 500, group = G_PASTILLE_2150, tooltip = "Écart prix au-dessus du HIGH / sous le LOW pour que les pastilles ne chevauchent pas les bougies.") float off2150Y = syminfo.mintick * pastilleVertTicks color colPastilleBg = input.color(color.new(#A855F7, 12), "Fond pastille", group = G_PASTILLE_2150) color colPastilleTxt = input.color(color.new(color.white, 0), "Texte pastille", group = G_PASTILLE_2150) string pastilleSize = input.string(size.tiny, "Taille pastille", options = [size.tiny, size.small, size.normal], group = G_PASTILLE_2150) bool showEod2150 = input.bool(true, "Pastille ! si côté non liquidé avant minuit", group = G_PASTILLE_2150) bool showDone2150 = input.bool(true, "Pastille verte si HIGH + LOW liquidés avant minuit", group = G_PASTILLE_2150) string PASTILLE_LBL_2150 = "ⓘ" string DONE_LBL_2150 = "21h50\ncomplètement\nliquidé" string EOD_LBL_2150 = "!" string DONE_TIP_2150 = HINT_SURVOL + "\n\n21h50 complètement liquidé.\n\nLe HIGH et le LOW de la bougie 21h50 ont été liquidés avant la fin de journée (avant l’open de minuit 00h00 " + TZ + ").\n\nObjectif fait pour la bougie 21h50 — aucune position à chercher après minuit pour ce jour." + MOCH_NOT_100 string EOD_TIP_2150 = HINT_SURVOL + "\n\nBilan fin de journée — bougie 21h50.\n\nUn côté n’a pas été liquidé avant la fin de journée. Attendre l’ouverture de minuit (00h00 " + TZ + ") du lendemain, puis chercher une position pour liquider le HIGH ou le LOW 21h50 qui manque — uniquement à partir de minuit." + MOCH_NOT_100 color colDoneBg = input.color(color.new(#22C55E, 12), "Fond pastille verte", group = G_PASTILLE_2150) color colDoneTxt = input.color(color.new(color.white, 0), "Texte pastille verte", group = G_PASTILLE_2150) bool isM1Chart = timeframe.isminutes and timeframe.multiplier == 1 bool showPastilleBar = not pastilleM1Only or isM1Chart var array highLines2150 = array.new() var array lowLines2150 = array.new() var array highPrices2150 = array.new() var array lowPrices2150 = array.new() var array highTouched2150 = array.new() var array lowTouched2150 = array.new() var array