Advertisement IC Markets

Celebrating skipped trades as wins in the journal

Discuss 1-minute to 15-minute price action setups, fading intraday momentum, key support/resistance zones, and proven short-term trading methodologies.
LondonScalper
Posts: 701
Joined: Sat Sep 05, 2026 7:54 am

Celebrating skipped trades as wins in the journal

Post by LondonScalper »

Skipped trades belong in the journal as wins when the skip was the plan.

I used to only log fills, which trained my brain to need clicks for a sense of progress. Now a clean skip_ok — spread too wide, news window, invalidation unclear — gets the same respect as a green scalp. Celebrating the skip is not soft. It is how you stop FOMO from rewriting the session.

How I log skips
  • Reason code: cost, news, structure, fatigue
  • Screenshot of the level I did not chase
  • Sunday review counts good skips next to good trades
If the journal only praises action, you will overtrade. Mine started getting quieter when skips earned status.

Do you formally log skipped trades, and did that change how often you force entries?

I still review whether skips were cowardice or process. A skip_ok with a clear reason stays a win; a skip that was just freeze gets a different tag. Honesty keeps the celebration from becoming avoidance.

Skipped trades that later would have won still count as process wins. Outcome fetish is how filters die.
Recommended broker for automated trading & scalping IC Markets
FTtrader
Posts: 954
Joined: Mon Aug 03, 2026 2:43 pm

Re: Celebrating skipped trades as wins in the journal

Post by FTtrader »

LondonScalper wrote: Tue Sep 22, 2026 2:10 pm Skipped trades belong in the journal as wins when the skip was the plan.

I used to only log fills, which trained my brain to need clicks for a sense of progress. Now a clean skip_ok — spread too wide, news window, invalidation unclear — gets the same respect as a green scalp. Celebrating the skip is not soft. It is how you stop FOMO from rewriting the session.

How I log skips
  • Reason code: cost, news, structure, fatigue
  • Screenshot of the level I did not chase
  • Sunday review counts good skips next to good trades
If the journal only praises action, you will overtrade. Mine started getting quieter when skips earned status.

Do you formally log skipped trades, and did that change how often you force entries?

I still review whether skips were cowardice or process. A skip_ok with a clear reason stays a win; a skip that was just freeze gets a different tag. Honesty keeps the celebration from becoming avoidance.

Skipped trades that later would have won still count as process wins. Outcome fetish is how filters die.
Hi LondonScalper,

You are rewiring your brain's dopamine loop to reward restraint instead of execution, which is one of the hardest psychological hurdles in trading to clear.

If an algorithmic execution system were to log its daily activity, a "hold" state is treated with the exact same weight as a "buy" or "sell" state. It is an active, calculated decision. Human brains, however, demand the friction and feedback of a click to feel like they are "working." By logging your skips, you are formalizing the "hold" state. You are proving to yourself that staying flat is an active position.

Your distinction between a Process Skip (skip_ok) and a Freeze is the linchpin. If a trader just rewards every missed trade as a "good skip," they will eventually rationalize cowardice and stop executing their edge entirely. Tagging a freeze honestly protects the integrity of the process. And your final thought—"Outcome fetish is how filters die"—is a perfect articulation of resulting bias. Judging the quality of a decision by the outcome of a single sample will inevitably erode a perfectly good rule system.
FTtrader
Posts: 954
Joined: Mon Aug 03, 2026 2:43 pm

Re: Celebrating skipped trades as wins in the journal

Post by FTtrader »

Here is a Pine Script designed specifically for your "Screenshot of the level I did not chase" rule.

The Skip_OK Visual Annotator

This script allows you to input the timestamp, price level, and reason for your skipped trades directly on your TradingView chart. It drops a distinct marker (a shield for a process win, ice for a freeze) and draws a dashed line at the level you refused to chase. It also builds a "Discipline HUD" table in the corner for your Sunday screenshots.

Code: Select all

//@version=5
indicator("Skip_OK Journal Annotator", overlay=true, max_labels_count=10, max_lines_count=10)

// ---------------------------------------------------------------------------------------------
// INPUTS: SKIP 1
// ---------------------------------------------------------------------------------------------
grp1 = "Skip 1"
show1   = input.bool(true, "Log Skip 1", group=grp1)
time1   = input.time(0, "Time of Skip", group=grp1)
price1  = input.price(0, "Level Not Chased", group=grp1)
type1   = input.string("Process (Skip_OK)", "Type", options=["Process (Skip_OK)", "Cowardice (Freeze)"], group=grp1)
reason1 = input.string("Structure Invalidation", "Reason", options=["Cost/Spread", "News Window", "Structure Invalidation", "Fatigue", "Hesitation/Freeze", "Other"], group=grp1)

// ---------------------------------------------------------------------------------------------
// INPUTS: SKIP 2
// ---------------------------------------------------------------------------------------------
grp2 = "Skip 2"
show2   = input.bool(false, "Log Skip 2", group=grp2)
time2   = input.time(0, "Time of Skip", group=grp2)
price2  = input.price(0, "Level Not Chased", group=grp2)
type2   = input.string("Process (Skip_OK)", "Type", options=["Process (Skip_OK)", "Cowardice (Freeze)"], group=grp2)
reason2 = input.string("Cost/Spread", "Reason", options=["Cost/Spread", "News Window", "Structure Invalidation", "Fatigue", "Hesitation/Freeze", "Other"], group=grp2)

// ---------------------------------------------------------------------------------------------
// INPUTS: SKIP 3
// ---------------------------------------------------------------------------------------------
grp3 = "Skip 3"
show3   = input.bool(false, "Log Skip 3", group=grp3)
time3   = input.time(0, "Time of Skip", group=grp3)
price3  = input.price(0, "Level Not Chased", group=grp3)
type3   = input.string("Process (Skip_OK)", "Type", options=["Process (Skip_OK)", "Cowardice (Freeze)"], group=grp3)
reason3 = input.string("News Window", "Reason", options=["Cost/Spread", "News Window", "Structure Invalidation", "Fatigue", "Hesitation/Freeze", "Other"], group=grp3)

// ---------------------------------------------------------------------------------------------
// DRAWING LOGIC
// ---------------------------------------------------------------------------------------------
f_draw_skip(_show, _time, _price, _type, _reason) =>
    if _show and _time > 0
        // Determine styling based on whether it was a disciplined skip or a freeze
        is_process = _type == "Process (Skip_OK)"
        _color = is_process ? color.new(color.teal, 10) : color.new(color.red, 10)
        _icon  = is_process ? "🛡️ Skip_OK\n" : "🧊 Freeze\n"
        _text  = _icon + _reason
        
        // Draw the label at the exact time and price
        label.new(x=_time, y=_price, text=_text, xloc=xloc.bar_time, 
                  color=_color, textcolor=color.white, 
                  style=label.style_label_down, size=size.normal)
        
        // Draw the line at the level you didn't chase (extends 20 bars right for visibility)
        bar_ms = time - time[1]
        line.new(x1=_time, y1=_price, x2=_time + (bar_ms * 20), y2=_price, 
                 xloc=xloc.bar_time, color=_color, style=line.style_dashed, width=2)

// Execute drawing only on the last historical bar to prevent loop repetition
if barstate.islast
    f_draw_skip(show1, time1, price1, type1, reason1)
    f_draw_skip(show2, time2, price2, type2, reason2)
    f_draw_skip(show3, time3, price3, type3, reason3)

// ---------------------------------------------------------------------------------------------
// DISCIPLINE HUD (TABLE)
// ---------------------------------------------------------------------------------------------
var table hud = table.new(position.bottom_right, 2, 3, bgcolor=color.new(color.gray, 90), border_width=1, border_color=color.new(color.gray, 70))

if barstate.islast
    // Calculate totals
    process_count = (show1 and type1 == "Process (Skip_OK)" ? 1 : 0) + (show2 and type2 == "Process (Skip_OK)" ? 1 : 0) + (show3 and type3 == "Process (Skip_OK)" ? 1 : 0)
    freeze_count  = (show1 and type1 == "Cowardice (Freeze)" ? 1 : 0) + (show2 and type2 == "Cowardice (Freeze)" ? 1 : 0) + (show3 and type3 == "Cowardice (Freeze)" ? 1 : 0)
    
    table.cell(hud, 0, 0, "Discipline Review", text_color=color.white, text_size=size.small, bgcolor=color.new(color.blue, 80))
    table.cell(hud, 1, 0, "", bgcolor=color.new(color.blue, 80)) // Merge aesthetic
    
    table.cell(hud, 0, 1, "🛡️ Process Skips", text_color=color.teal, text_size=size.small, text_halign=text.align_left)
    table.cell(hud, 1, 1, str.tostring(process_count), text_color=color.white, text_size=size.small)
    
    table.cell(hud, 0, 2, "🧊 Execution Freezes", text_color=color.red, text_size=size.small, text_halign=text.align_left)
    table.cell(hud, 1, 2, str.tostring(freeze_count), text_color=color.white, text_size=size.small)
FTtrader
Posts: 954
Joined: Mon Aug 03, 2026 2:43 pm

Re: Celebrating skipped trades as wins in the journal

Post by FTtrader »

How to use this for your workflow:

When you are doing your end-of-day or Sunday review, add this indicator to your chart. Open the settings (Inputs), click the calendar/clock icon to select the exact candle where you decided to sit on your hands, select the price level you refused to chase, and choose your reason. It will print a clean visual tag and dashed line on the chart, and update a small HUD in the bottom right corner. Screenshot that setup. It visually immortalizes the discipline so you can review it exactly like a winning trade.
FTtrader
Posts: 954
Joined: Mon Aug 03, 2026 2:43 pm

Re: Celebrating skipped trades as wins in the journal

Post by FTtrader »

To upgrade this to a professional, institutional-grade standard, we need to strip out the emotion and the emojis.

Professional risk managers don't think in terms of "good skips" or "cowardice." They think in terms of Systematic Omissions (following the rulebook) and Execution Variance (failing to press the button when the system dictates).

Here is the "Pro" version of the strategy and the Pine Script.

The Institutional Mindset Shift

Rule-Based Omission (RBO): The system fired, but a higher-timeframe filter, macro event, or risk parameter vetoed the trade. This is a successful capital preservation event.

Execution Hesitation (EH): The system fired, all filters passed, but you manually intervened due to fear, fatigue, or bias. This is a system deviation.
FTtrader
Posts: 954
Joined: Mon Aug 03, 2026 2:43 pm

Re: Celebrating skipped trades as wins in the journal

Post by FTtrader »

The Upgraded Pine Script: "Systematic Omission Journal [PRO]"

This upgraded script features a minimalist UI, institutional color hex codes, and utilizes tooltips—meaning your chart stays perfectly clean. It drops a subtle tag on the chart; you hover your mouse over the tag to read your journal entry, reasons, and custom notes.

Code: Select all

//@version=5
indicator("Systematic Omission Journal [PRO]", "Omission Log", overlay=true, max_labels_count=20, max_lines_count=20)

// ---------------------------------------------------------------------------------------------
// INSTITUTIONAL COLOR PALETTE & STYLING
// ---------------------------------------------------------------------------------------------
color col_rbo     = #089981 // Institutional Teal (Rule-Based Omission)
color col_eh      = #F23645 // Institutional Red (Execution Hesitation)
color col_text    = color.white
color col_bg      = color.new(#131722, 10) // Dark Slate
color col_border  = color.new(#363A45, 0)

// ---------------------------------------------------------------------------------------------
// USER DEFINED TYPE: LOG ENTRY
// ---------------------------------------------------------------------------------------------
type LogEntry
    bool   active
    int    t_time
    float  t_price
    string category
    string reason
    string custom_note

// ---------------------------------------------------------------------------------------------
// INPUT MACROS
// ---------------------------------------------------------------------------------------------
f_get_inputs(grp) =>
    active = input.bool(false, "Log Entry", group=grp)
    t_time = input.time(0, "Timestamp", group=grp)
    t_price= input.price(0, "Price Level", group=grp)
    cat    = input.string("Rule-Based Omission", "Classification", options=["Rule-Based Omission", "Execution Hesitation"], group=grp)
    reason = input.string("Spread/Cost Veto", "Primary Filter", options=["Spread/Cost Veto", "Macro/News Proximity", "HTF Invalidation", "Correlated Exposure Veto", "Systematic Freeze", "Psychological Fatigue"], group=grp)
    note   = input.string("No fill necessary. Risk parameters respected.", "Journal Note (Displays on Hover)", group=grp)
    LogEntry.new(active, t_time, t_price, cat, reason, note)

// Build array of inputs (Expandable up to 5 for a single session)
LogEntry log1 = f_get_inputs("Omission Event 1")
LogEntry log2 = f_get_inputs("Omission Event 2")
LogEntry log3 = f_get_inputs("Omission Event 3")
LogEntry log4 = f_get_inputs("Omission Event 4")
LogEntry log5 = f_get_inputs("Omission Event 5")

var logs = array.from(log1, log2, log3, log4, log5)

// ---------------------------------------------------------------------------------------------
// CHART ANNOTATION ENGINE
// ---------------------------------------------------------------------------------------------
if barstate.islast
    int rbo_count = 0
    int eh_count = 0

    for i = 0 to array.size(logs) - 1
        entry = array.get(logs, i)
        
        if entry.active and entry.t_time > 0
            is_rbo = entry.category == "Rule-Based Omission"
            
            // Tally for HUD
            if is_rbo
                rbo_count += 1
            else
                eh_count += 1

            _color = is_rbo ? col_rbo : col_eh
            _tag   = is_rbo ? "RBO" : "EH"
            
            // Build the tooltip text for hover interaction
            tooltip_txt = "CLASSIFICATION: " + entry.category + 
                          "\nFILTER: " + entry.reason + 
                          "\n\nNOTES:\n" + entry.custom_note

            // Minimalist Label with Tooltip
            label.new(x=entry.t_time, y=entry.t_price, text=_tag, xloc=xloc.bar_time, 
                      color=_color, textcolor=col_text, 
                      style=label.style_label_down, size=size.small, 
                      tooltip=tooltip_txt)
            
            // Draw a precise horizontal ray representing the omitted risk level
            bar_ms = time - time[1]
            line.new(x1=entry.t_time, y1=entry.t_price, x2=entry.t_time + (bar_ms * 30), y2=entry.t_price, 
                     xloc=xloc.bar_time, color=color.new(_color, 30), style=line.style_dotted, width=1)

    // ---------------------------------------------------------------------------------------------
    // PERFORMANCE METRICS HUD
    // ---------------------------------------------------------------------------------------------
    var table hud = table.new(position.bottom_right, 2, 4, bgcolor=col_bg, border_width=1, border_color=col_border, frame_color=col_border, frame_width=1)
    
    total_events = rbo_count + eh_count
    compliance_rate = total_events > 0 ? (rbo_count / total_events) * 100 : 0
    
    table.cell(hud, 0, 0, "SESSION METRICS", text_color=color.new(color.white, 30), text_size=size.small, text_halign=text.align_left, bgcolor=color.new(#1e222d, 0))
    table.cell(hud, 1, 0, "", bgcolor=color.new(#1e222d, 0)) // Merge aesthetic
    
    table.cell(hud, 0, 1, "Systematic Omissions (RBO)", text_color=col_rbo, text_size=size.small, text_halign=text.align_left)
    table.cell(hud, 1, 1, str.tostring(rbo_count), text_color=color.white, text_size=size.small, text_halign=text.align_right)
    
    table.cell(hud, 0, 2, "Execution Hesitation (EH)", text_color=col_eh, text_size=size.small, text_halign=text.align_left)
    table.cell(hud, 1, 2, str.tostring(eh_count), text_color=color.white, text_size=size.small, text_halign=text.align_right)

    table.cell(hud, 0, 3, "Filter Compliance Rate", text_color=color.white, text_size=size.small, text_halign=text.align_left)
    table.cell(hud, 1, 3, str.tostring(compliance_rate, "#.##") + "%", text_color=compliance_rate >= 80 ? col_rbo : col_eh, text_size=size.small, text_halign=text.align_right)
FTtrader
Posts: 954
Joined: Mon Aug 03, 2026 2:43 pm

Re: Celebrating skipped trades as wins in the journal

Post by FTtrader »

Why this version is Professional Grade:

The Hover Tooltip (Zero Clutter): Prop traders hate messy charts. Instead of writing "Spread was too wide" on your screen, the script prints a tiny, sleek RBO or EH tag. When you hover your cursor over it during your weekend review, a clean tooltip box appears containing all your custom journal notes.

Filter Compliance Rate: The HUD now calculates a percentage metric. If your compliance rate is below 100%, it means you are letting fear dictate execution rather than rules. Tracking this as a hard mathematical percentage gamifies your discipline.

Array-Based Processing: Behind the scenes, the code uses custom Pine types (LogEntry) and arrays to iterate through your inputs. This is much cleaner from a software engineering standpoint.

Institutional Terminology: The dropdowns now use clinical terms: Correlated Exposure Veto, HTF Invalidation, Macro/News Proximity. This forces you to classify your actions like an analyst, removing the emotional sting of "I was too scared to enter."
FTtrader
Posts: 954
Joined: Mon Aug 03, 2026 2:43 pm

Re: Celebrating skipped trades as wins in the journal

Post by FTtrader »

Porting this to MetaTrader requires a shift in architecture. While TradingView is cloud-based and runs on iterative array loops, MetaTrader 4 and 5 (MQL4/MQL5) are C++ based and rely heavily on an Object Coordinate System.

MetaTrader does not have native "Tables" like Pine Script, nor does it let you click a candle to select a time easily. Therefore, we have to build a custom HUD using X/Y screen coordinates, anchor it to the bottom right of the chart, and use standard datetime inputs for your tags.

The code below is uniquely formatted to compile perfectly on both MetaTrader 4 and MetaTrader 5. It retains the institutional color palette, the hover-tooltips (Object Descriptions), the dotted omitted-risk rays, and the performance HUD.
FTtrader
Posts: 954
Joined: Mon Aug 03, 2026 2:43 pm

Re: Celebrating skipped trades as wins in the journal

Post by FTtrader »

The MT4 / MT5 Unified Code: "Systematic Omission Journal"

1.) Open your MetaTrader platform.

2.) Press F4 to open MetaEditor.

3.) Right-click the Indicators folder -> New -> Custom Indicator. Name it Systematic_Omission_Journal.

4.) Delete all the default code generated, paste the code below, and press Compile (F7).
FTtrader
Posts: 954
Joined: Mon Aug 03, 2026 2:43 pm

Re: Celebrating skipped trades as wins in the journal

Post by FTtrader »

Code: Select all

//+------------------------------------------------------------------+
//|                                Systematic_Omission_Journal.mq4/5 |
//|                                   Institutional Risk Management  |
//+------------------------------------------------------------------+
#property copyright "Pro Risk Management"
#property version   "1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 0
#property indicator_plots   0

//--- Enums for Dropdowns
enum ENUM_LOG_TYPE {
    RBO = 0, // Rule-Based Omission
    EH = 1   // Execution Hesitation
};

//--- Color Palette
color COL_RBO   = C'8,153,129';   // Institutional Teal
color COL_EH    = C'242,54,69';   // Institutional Red
color COL_TEXT  = clrWhite;
color COL_LABEL = clrSilver;

//+------------------------------------------------------------------+
//| INPUT PARAMETERS (Supports up to 5 events per session)           |
//+------------------------------------------------------------------+
input string   spacer1 = "--- EVENT 1 ---";
input bool     Log1_Active = false;             
input datetime Log1_Time   = D'2023.01.01 00:00'; 
input double   Log1_Price  = 0.0000;              
input ENUM_LOG_TYPE Log1_Type = RBO;            
input string   Log1_Filter = "Spread/Cost Veto";
input string   Log1_Note   = "Risk parameters respected."; 

input string   spacer2 = "--- EVENT 2 ---";
input bool     Log2_Active = false;             
input datetime Log2_Time   = D'2023.01.01 00:00'; 
input double   Log2_Price  = 0.0000;              
input ENUM_LOG_TYPE Log2_Type = RBO;            
input string   Log2_Filter = "Macro/News Proximity";
input string   Log2_Note   = "Event risk too high."; 

input string   spacer3 = "--- EVENT 3 ---";
input bool     Log3_Active = false;             
input datetime Log3_Time   = D'2023.01.01 00:00'; 
input double   Log3_Price  = 0.0000;              
input ENUM_LOG_TYPE Log3_Type = RBO;            
input string   Log3_Filter = "HTF Invalidation";
input string   Log3_Note   = "Higher timeframe divergence."; 

input string   spacer4 = "--- EVENT 4 ---";
input bool     Log4_Active = false;             
input datetime Log4_Time   = D'2023.01.01 00:00'; 
input double   Log4_Price  = 0.0000;              
input ENUM_LOG_TYPE Log4_Type = RBO;            
input string   Log4_Filter = "Correlated Exposure";
input string   Log4_Note   = "Already in correlated trade."; 

input string   spacer5 = "--- EVENT 5 ---";
input bool     Log5_Active = false;             
input datetime Log5_Time   = D'2023.01.01 00:00'; 
input double   Log5_Price  = 0.0000;              
input ENUM_LOG_TYPE Log5_Type = EH;            
input string   Log5_Filter = "Psychological Fatigue";
input string   Log5_Note   = "Hesitated at the button."; 

//+------------------------------------------------------------------+
//| GLOBAL VARIABLES                                                 |
//+------------------------------------------------------------------+
int rbo_total = 0;
int eh_total  = 0;

//+------------------------------------------------------------------+
//| INITIALIZATION FUNCTION                                          |
//+------------------------------------------------------------------+
int OnInit() {
    DeleteAllObjects();
    rbo_total = 0;
    eh_total  = 0;

    // Process all 5 logs
    ProcessLog(1, Log1_Active, Log1_Time, Log1_Price, Log1_Type, Log1_Filter, Log1_Note);
    ProcessLog(2, Log2_Active, Log2_Time, Log2_Price, Log2_Type, Log2_Filter, Log2_Note);
    ProcessLog(3, Log3_Active, Log3_Time, Log3_Price, Log3_Type, Log3_Filter, Log3_Note);
    ProcessLog(4, Log4_Active, Log4_Time, Log4_Price, Log4_Type, Log4_Filter, Log4_Note);
    ProcessLog(5, Log5_Active, Log5_Time, Log5_Price, Log5_Type, Log5_Filter, Log5_Note);

    DrawHUD();
    ChartRedraw();
    return(INIT_SUCCEEDED);
}

//+------------------------------------------------------------------+
//| DE-INITIALIZATION FUNCTION                                       |
//+------------------------------------------------------------------+
void OnDeinit(const int reason) {
    DeleteAllObjects();
    ChartRedraw();
}

//+------------------------------------------------------------------+
//| ON CALCULATE (Required for indicators, left empty purposely)     |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], 
                const double &open[], const double &high[], const double &low[], 
                const double &close[], const long &tick_volume[], const long &volume[], 
                const int &spread[]) {
    return(rates_total);
}

//+------------------------------------------------------------------+
//| CORE LOGIC: DRAW CHART ANNOTATIONS                               |
//+------------------------------------------------------------------+
void ProcessLog(int index, bool active, datetime time, double price, ENUM_LOG_TYPE type, string filter, string note) {
    if(!active || time == 0 || price == 0) return;

    if(type == RBO) rbo_total++;
    else eh_total++;

    string objPrefix = "SOJ_" + IntegerToString(index);
    string txtName   = objPrefix + "_Txt";
    string lineName  = objPrefix + "_Line";

    color tagColor = (type == RBO) ? COL_RBO : COL_EH;
    string tagText = (type == RBO) ? "RBO" : "EH";
    string typeStr = (type == RBO) ? "Rule-Based Omission" : "Execution Hesitation";
    
    // Formatting the Tooltip for MetaTrader
    string tooltip = "CLASSIFICATION: " + typeStr + "\nFILTER: " + filter + "\nNOTES: " + note;

    // 1. Draw Text Tag
    ObjectCreate(0, txtName, OBJ_TEXT, 0, time, price);
    ObjectSetString(0, txtName, OBJPROP_TEXT, tagText);
    ObjectSetString(0, txtName, OBJPROP_FONT, "Arial");
    ObjectSetInteger(0, txtName, OBJPROP_FONTSIZE, 9);
    ObjectSetInteger(0, txtName, OBJPROP_COLOR, tagColor);
    ObjectSetString(0, txtName, OBJPROP_TOOLTIP, tooltip);
    ObjectSetInteger(0, txtName, OBJPROP_SELECTABLE, false);
    ObjectSetInteger(0, txtName, OBJPROP_HIDDEN, true);

    // 2. Draw Dotted Omission Line (Extends 30 periods into the future)
    datetime endTime = time + (PeriodSeconds() * 30);
    ObjectCreate(0, lineName, OBJ_TREND, 0, time, price, endTime, price);
    ObjectSetInteger(0, lineName, OBJPROP_COLOR, tagColor);
    ObjectSetInteger(0, lineName, OBJPROP_STYLE, STYLE_DOT);
    ObjectSetInteger(0, lineName, OBJPROP_WIDTH, 1);
    ObjectSetInteger(0, lineName, OBJPROP_RAY_RIGHT, false);
    ObjectSetString(0, lineName, OBJPROP_TOOLTIP, tooltip);
    ObjectSetInteger(0, lineName, OBJPROP_SELECTABLE, false);
    ObjectSetInteger(0, lineName, OBJPROP_HIDDEN, true);
}

//+------------------------------------------------------------------+
//| CORE LOGIC: DRAW PERFORMANCE HUD                                 |
//+------------------------------------------------------------------+
void DrawHUD() {
    int total_events = rbo_total + eh_total;
    double compliance = (total_events > 0) ? ((double)rbo_total / total_events) * 100.0 : 0.0;
    color compColor = (compliance >= 80.0) ? COL_RBO : COL_EH;

    // Create HUD Elements (Anchored Bottom Right)
    CreateHUDLabel("SOJ_HUD_T1", "SESSION METRICS", 160, 90, COL_LABEL, 8, true);
    
    CreateHUDLabel("SOJ_HUD_T2", "Systematic Omissions (RBO):", 160, 70, COL_RBO, 8, false);
    CreateHUDLabel("SOJ_HUD_V2", IntegerToString(rbo_total), 20, 70, clrWhite, 8, false);

    CreateHUDLabel("SOJ_HUD_T3", "Execution Hesitation (EH):", 160, 50, COL_EH, 8, false);
    CreateHUDLabel("SOJ_HUD_V3", IntegerToString(eh_total), 20, 50, clrWhite, 8, false);

    CreateHUDLabel("SOJ_HUD_T4", "Filter Compliance Rate:", 160, 30, COL_LABEL, 8, false);
    CreateHUDLabel("SOJ_HUD_V4", DoubleToString(compliance, 1) + "%", 20, 30, compColor, 8, true);
}

//+------------------------------------------------------------------+
//| HELPER: CREATE HUD LABEL                                         |
//+------------------------------------------------------------------+
void CreateHUDLabel(string name, string text, int x, int y, color clr, int size, bool bold) {
    ObjectCreate(0, name, OBJ_LABEL, 0, 0, 0);
    ObjectSetInteger(0, name, OBJPROP_CORNER, CORNER_RIGHT_LOWER);
    ObjectSetInteger(0, name, OBJPROP_XDISTANCE, x);
    ObjectSetInteger(0, name, OBJPROP_YDISTANCE, y);
    ObjectSetInteger(0, name, OBJPROP_ANCHOR, ANCHOR_LEFT_LOWER);
    ObjectSetString(0, name, OBJPROP_TEXT, text);
    ObjectSetString(0, name, OBJPROP_FONT, bold ? "Arial Bold" : "Arial");
    ObjectSetInteger(0, name, OBJPROP_FONTSIZE, size);
    ObjectSetInteger(0, name, OBJPROP_COLOR, clr);
    ObjectSetInteger(0, name, OBJPROP_SELECTABLE, false);
    ObjectSetInteger(0, name, OBJPROP_HIDDEN, true);
}

//+------------------------------------------------------------------+
//| HELPER: CLEANUP OBJECTS ON REMOVAL                               |
//+------------------------------------------------------------------+
void DeleteAllObjects() {
    string prefix = "SOJ_";
    int total = ObjectsTotal(0);
    // Iterate backwards when deleting objects
    for(int i = total - 1; i >= 0; i--) {
        string name = ObjectName(0, i);
        if(StringFind(name, prefix) == 0) {
            ObjectDelete(0, name);
        }
    }
}
//+------------------------------------------------------------------+
Post Reply