VIBE QSFM-00024946 L v1.0 Trailing SL Indicator Pine by Panduck

ittichai31 · study · 345 行 · 点赞 3 · TradingView 原页

本页源码来自 TradingView 公开发布的开源脚本,版权归原作者所有, 请遵循其原始许可(Pine 脚本常见 CC BY-NC-SA / MPL-2.0 / MIT)。 本项目仅用于研究检索与许可范围内的移植。

Pine Script

//@version=6
indicator("VIBE QSFM-00024946 L v1.0 Trailing SL Indicator Pine", overlay=true, max_bars_back=500, max_labels_count=200)
// ============================================================================
// RECREATION / HANDOFF NOTES — QSFM-00024946 LONG — Trailing SL — 2026-10-19
// Keep these notes with this script when copying it into another chat.
// User workflow: source strategy -> Pine test -> compare trades -> user acceptance
// -> indicator/alerts -> manual trading. User authorized indicator on2026-10-19.
// Name: VIBE QSFM-00024946 L v<version> Trailing SL Strategy Pine / Indicator Pine.
// Reference implementation: Strategy Pine v1.1. Indicator has independent v1.0.
//
// HISTORICAL RESULTS — DO NOT MIX TRAINING AND FORWARD SAMPLES:
// Original QSFM training/backtest WR=71.428571%=15wins/21closed trades.
// Window2025-01-01 23:00UTC..2026-05-27 11:45UTC (source summary).
// Training normalized P/L=$6428.333333; closed-equity maxDD=$2000;
// frequency about1.252trades/month. Training trade rows were NOT supplied.
// QSFM forward window2026-06-03 00:00UTC..2026-10-16 09:10UTC(exclusive).
// Forward WR=55.555556%=10wins/18closed;8losses. Last supplied exitOct6.
// QSFM forward P/L=$5135.833333; closed-equity maxDD=$2338.055556.
// TradingView Strategy v1.1 test received2026-10-19:18trades,10wins/8losses,
// WR55.56%,P/L$5135.32,profitFactor1.641979,intrabarDD$2713.06.
// ALL18 entry/exit times and prices match source (CSV times inferred UTC+7).
// TV qty55.55 vs source55.55555556 explains P/L difference; TV closedDD2337.82.
// Sum of rounded CSV trade P/L5135.35 != final cumulative5135.32: retain precision.
// These are sample-specific historical results, NOT expected future win rates.
// Matched Strategy does NOT prove new Indicator compiles or realtime alerts work.
//
// EXACT SOURCE DATA / INITIALIZATION:
// Instrument OANDA:XAUUSD,standard candles,5minutes; no HeikinAshi/Renko/etc.
// Source export2026-10-16T09:18:52.739Z; engine SHA256
// 81596b6cffc71687bd6410b7fba98e34073c0a6f5f202dfd4c5e74e8e425a27c
// Original handoff file SHA256
// BA9A2EBFBB4AD6428B24385A4B1746B0DC18A026014538AAD444CAF88914FD69
// Default indicator/source seed2026-06-03 00:00UTC; actual original data seed is
// UNCONFIRMED. Load history from seed. Count source bars only at/after seed.
// TR first source bar=H-L; later=max(H-L,abs(H-prevClose),abs(L-prevClose)).
// ATR14 first valid at source index13:mean(first14TR); then(prevATR*13+TR)/14.
// ATR inclusive rank120=count(last120validATR<=currentATR)/120,including current.
// First rank valid at source index132. Do not replace with different rank ties.
// Eligible source signals start index240 (241stsource bar),matching engine.
// Source EMA20/EMA50/RSI14 were initialization guards only; no directional filter.
// At241bars their readiness is already satisfied. HTF=NONE; no HTF requests.
// No volatilityBand supplied =>ANY. Source price basis/true seed remain unknown.
//
// EXACT LONG ENTRY RULES (ALL REQUIRED at completed decision-candle CLOSE):
// time=decision bar OPEN timestamp,not time_close. hour(time,UTC)==11;exclude
// Saturday and Sunday at this hour. First qualifying11:00bar closes11:05UTC;
// last11:55bar closes12:00UTC. Execute times18:05..19:00Bangkok(UTC+7).
// priorHigh=max(high of previous12bars),priorLow=min(low of previous12bars);
// CURRENT decision bar must NOT enter that range calculation.
// width=priorHigh-priorLow;require14.4<=width<=72 (=18*0.8..18*4).
// Require0.10<=ATRrank<=0.60,close>open,and close>priorHigh(strict breakout).
// signal start inclusive2026-06-03 00:00UTC;reference end exclusiveOct16 09:10.
// Strategy v1.1 has fixed reference signal window; Indicator LIVE default has
// NO signal end cutoff. Validation toggle restores original end. No end liquidation.
// cooldown:decision bar OPEN time-last actual/model ENTRY bar OPEN>=60minutes.
// One position in accepted cap1 workflow; pending entry also reserves that slot.
// Confirm at close,enter NEXT AVAILABLE candle OPEN (not signal close).
// A11:55UTC decision can validly ENTER at12:00UTC. No extra session exit/filter.
//
// POSITION SIZE / MANAGEMENT:
// Source fixed riskUSD1000,stop price distance18 =>55.55555556 gold units.
// Strategy qty=riskUSD/(stopDistance*syminfo.pointvalue),currencyUSD;
// TV exported55.55. Units are NOT broker lots. Use actual symbol/broker metadata.
// E=entry fill;initialSL=E-18;TP=E+31.5 (=1.75R). TP NEVER TRAILS.
// bestHigh startsE. On EACH bar from entry bar onward, check OLD SL/TP FIRST:
// if low<=SL exitSL;else if high>=TP exitTP. Both touched=>SL wins in source model.
// Only if surviving:update bestHigh=max(previousBest,barHigh).
// If bestHigh-E>=18:newSL=max(oldSL,bestHigh-18);otherwise leaveSLunchanged.
// New SL applies AFTER candle close,to next candle. Never lower SL. Wick high
// counts even if close<activation; do NOT require close>=E+18. No intrabar trail.
// ExampleE4300:SL4282,TP4331.5;H4318=>nextSL4300;H4324=>4306;H4330=>4312.
// Old protection remains active during activation candle:do not retroactively stop
// on that bar's earlier low using newly computedSL. Broker continuous trailing
// can differ. Actual broker SL/TP must be set from YOUR fill;model is advisory.
//
// INDICATOR RECREATION / ALERTS / DISPLAY:
// indicator(),overlay=true,max_bars_back500,max_labels_count200;NOT strategy().
// Maintain committed pending/active state at confirmed closes; pending becomes
// reference entry=open on next available bar. Preview open-based levels intrabar.
// Model lock/cooldown cannot know actual broker positions,skipped trades or fills.
// EXECUTE:confirmed all entry criteria,flat/cooldown/date gates;once at close.
// Message estimates entry from signal CLOSE,SLclose-18,TPclose+31.5;reset from fill.
// PREPARE:optional developing bar,other current filters pass,bullish price>=
// priorHigh-1.0(default adjustable distance0..18). Provisional,may cancel;NOT entry
// filter or prerequisite for execute. Realtime only;varip once/bar latch reset
// at barstate.isnew. Do not invent historical prepare marks from OHLC.
// MOVE SL:confirmed surviving candle increases stop;show next-bar modelSL.
// MODEL EXIT:confirmed oldSL/TP touch;informational,not broker execution proof.
// Dynamic messages:fullID/version,event,LONG,tickerID,M5,UTCdecisionClose,
// chartreference,SL,TP and caveats. alert.freq_all supports separate event types
// in one bar;explicit guards/latch avoid duplicate event calls.
// Create ONE TradingView alert:Any alert() function call. Default4event togglesON.
// Alerts only realtime. Recreate after code/input/symbol/timeframe changes.
// Visuals:prior12high/low blue;execute green;entry cyan;oldSLred;nextSLorange;
// fixedTPgreen;activationyellow;modelExitred. CurrentSL vs nextSL separate plots.
// Criteria/state/management table with anchor selector,description toggle,optional
// HISTORICAL sample statistics,seed coverage warning. Hidden historical stats
// default;all main visuals/table defaultON. No automatic order placement.
//
// STRATEGY RECREATION DEFAULTS / KNOWN LIMITS:
// Pinev6 strategy overlay,pyramiding3,initialCapital100000USD,margin_long1%=100x
// SIMULATION DEFAULT(not account leverage advice),commission0,slippage0,
// close_entries_ruleANY,calc_on_order_fillsFALSE,calc_on_every_tickFALSE,
// calc_on_every_history_tickFALSE,use_bar_magnifierFALSE,process_orders_on_close
// FALSE. Initial relative-tick bracket submitted with entry protects entry bar.
// stop loss ticks18/mintick,target ticks31.5/mintick. Subsequent absoluteSL/TP.
// Separate IDs/brackets for optional cap3. Default input maxOpen1,range12,
// SL18(inputclamped2..40),RR1.75(min1),target=min(SL*RR,80),risk1000,cooldown60,
// ATRrankMin0.1/max0.6;lookback max240. Source array rank avoids tie ambiguity.
// Strategy v1.0 lacks v1.1 extra guard/history diagnostics;v1.1 is current baseline.
// Raw QSFM cap3 then safety-postfilters overlaps tocap1. Applyingcap1 during
// generation is not universally equivalent:rejected raw entries affect cooldown.
// Native TV both-hit ordering,gap fills,tick rounding can differ from source.
// IntrabarDD != closed-equityDD. Zero-cost midpoint test != executable net profit.
// Unused source settings:bodyMaxAtr0.55,compressionFactor0.55,momentumBars3,
// momentumMultiplier0.8,retestTolerance0.5,useH4Utc3false. Do NOT add these filters.
// Source operations lossCooldown60,twoLossPause5days,threeLossRemove are metadata,
// NOT implemented source entry rules. Export safety overlapfalse,maxOpen1,
// no daily cap,cooldownAfterTrade0. No added news,trend,breakeven0.5R or daily cap.
// Source strictQualifiedfalse(lowfrequency);forwardWR<70sourceflag is not an
// automatic user discard decision. User explicitly requested this indicator.
// VALIDATION:Strategy18reference trades matched;7synthetic management cases
// pass on ORIGINAL JSengine. Indicator static review only;Pine compile,overlay
// and realtime delivery pending. No source M5OHLC or fullTVsettings supplied.
// Full source/evidence/guide/recreation note live alongside scripts in user folder.
// ============================================================================
// MANUAL LONG-ONLY TOOL. Based on matched Strategy Pine v1.1, NOT a broker connection.
// ENTRY: M5 candle OPENS in hour11 UTC (18:00-18:59 Bangkok), weekday;
// bullish confirmed CLOSE strictly above previous12 highs; prior12 range14.4..72;
// Wilder ATR14 inclusive rank120 in[0.10,0.60]. Source seed and240-bar warmup preserved.
// No HTF filter.60min cooldown compares signal BAR OPEN to previous model ENTRY OPEN.
// EXECUTE is emitted at decision candle CLOSE, for entry at the next available bar.
// PREPARE is an extra provisional heads-up, not an entry rule or promise of EXECUTE.
// MANAGEMENT: initial SL=entry-18; TP=entry+31.5 FIXED (TP DOES NOT TRAIL).
// First test current bar against OLD SL/TP. If surviving, update highest high.
// Once highestHigh-entry>=18, nextSL=max(oldSL,highestHigh-18).
// Never lower SL. New SL applies AFTER this M5 close, to following bar only.
// If both SL/TP touched in one OHLC bar, model assumes STOP FIRST, as QSFM does.
// A broker native continuous trailing stop is DIFFERENT from this close-updated rule.
// Levels/position lock below are chart-reference simulations, NOT actual fills/orders.
// Recalculate initial SL/TP from YOUR actual fill. Model alerts cannot modify broker SL.
// Chart midpoint prices differ from executable bid/ask. Keep broker protection active.
// Alert setup: one alert with Condition=Any alert() function call. Toggles route events.
// Recreate alert after editing script/inputs/symbol/timeframe. Historical alerts do not fire.
// Static review and synthetic management checks only; indicator awaits TV compilation.
 
string gTime = "Dates and source initialization"
seedTime = input.time(timestamp("03 Jun 2026 00:00 +0000"), "Source seed start (display follows chart timezone)", group=gTime)
startTime = input.time(timestamp("03 Jun 2026 00:00 +0000"), "First signal date", group=gTime)
validationOnly = input.bool(false, "Reference validation: stop signals at original end", group=gTime, tooltip="OFF for ongoing live signals. ON to compare the original forward sample.")
endTime = input.time(timestamp("16 Oct 2026 09:10 +0000"), "Original reference end (exclusive)", group=gTime)
string gAlert = "Alerts"
prepareOn = input.bool(true, "PREPARE: provisional approach to breakout", group=gAlert)
prepareDistance = input.float(1.0, "Prepare distance below prior high (price dollars)", minval=0, maxval=18, group=gAlert)
executeOn = input.bool(true, "EXECUTE: confirmed long signal", group=gAlert)
trailOn = input.bool(true, "MOVE SL: confirmed trailing-stop increase", group=gAlert)
exitOn = input.bool(true, "MODEL EXIT: chart-reference SL/TP touch", group=gAlert)
string gView = "Display"
showRange = input.bool(true, "Prior12 range lines", group=gView)
showLevels = input.bool(true, "Model entry, SL, TP and activation lines", group=gView)
showSignals = input.bool(true, "Execute and model-exit markers", group=gView)
showPrepare = input.bool(true, "Provisional prepare highlight", group=gView)
showLabels = input.bool(true, "Entry and stop-change labels", group=gView)
showTable = input.bool(true, "Criteria / management table", group=gView)
showDescription = input.bool(true, "Long-side description in table", group=gView)
showHistoryStats = input.bool(false, "Show original historical sample (not forecast)", group=gView)
anchor = input.string("Top right", "Table anchor", options=["Top right","Top left","Bottom right","Bottom left"], group=gView)
 
float stopDistance = 18.0
float targetDistance = 31.5
string tag = "VIBE QSFM-00024946 L v1.0 Trailing SL Indicator Pine"
f_price(float value) => na(value) ? "n/a" : str.tostring(value, format.mintick)
f_flag(bool ok) => ok ? "PASS" : "WAIT"
f_message(string event, float refPrice, float sl, float tp, string note) =>
    tag+" | "+event+" | LONG | "+syminfo.tickerid+" | M5 | UTC "+str.format_time(time_close,"yyyy-MM-dd HH:mm","UTC")+" | Chart reference "+f_price(refPrice)+" | SL reference "+f_price(sl)+" | TP reference "+f_price(tp)+" | "+note
if barstate.isfirst
    if not chart.is_standard or not timeframe.isminutes or timeframe.multiplier != 5
        runtime.error("Use standard5-minute candles.")
    if syminfo.prefix != "OANDA" or syminfo.ticker != "XAUUSD"
        runtime.error("Use OANDA:XAUUSD for this strategy.")
    if seedTime > startTime or (validationOnly and startTime >= endTime)
        runtime.error("Dates must satisfy seed<=start; reference mode also needs start<end.")
 
// Wilder ATR seed exactly as source; var rolls back during open-bar updates.
var int firstLoaded = time
var int sourceBars = 0
var float trSum = 0.0
var float atr14 = na
if time >= seedTime
    sourceBars += 1
    float tr = sourceBars == 1 ? high-low : math.max(high-low,math.max(math.abs(high-close[1]),math.abs(low-close[1])))
    if sourceBars <= 14
        trSum += tr
        if sourceBars == 14
            atr14 := trSum/14
    else
        atr14 := (atr14*13+tr)/14
float atrRank = na
if sourceBars >= 133
    int count = 0
    for k = 0 to 119
        count += atr14[k] <= atr14 ? 1 : 0
    atrRank := count/120.0
float rangeHigh = ta.highest(high[1],12)
float rangeLow = ta.lowest(low[1],12)
float rangeWidth = rangeHigh-rangeLow
bool warmOk = sourceBars >240
bool sessionOk = hour(time,"UTC") ==11 and dayofweek(time,"UTC") !=dayofweek.saturday and dayofweek(time,"UTC") !=dayofweek.sunday
bool atrOk = not na(atrRank) and atrRank >=0.1 and atrRank <=0.6
bool rangeOk = rangeWidth >=14.4 and rangeWidth <=72
bool bullOk = close >open
bool breakoutOk = close >rangeHigh
bool dateOk = time >=startTime and (not validationOnly or time <endTime)
 
// One MODEL position, with next-bar reference entry. Does not know broker trades.
var bool active = false
var bool pending = false
var int pendingBar = na
var int lastEntryTime = na
var float entryPrice = na
var float stopPrice = na
var float targetPrice = na
var float bestHigh = na
var int modelCount = 0
var string lastEvent = "Waiting for confirmed setup"
bool entryBar = pending and bar_index >nz(pendingBar,bar_index)
// During realtime entry bar show open-based levels, without committing state early.
float barEntry = entryBar ? open : active ? entryPrice : na
float barStop = entryBar ? open-stopDistance : active ? stopPrice : na
float barTarget = entryBar ? open+targetDistance : active ? targetPrice : na
bool exitEvent = false
bool trailEvent = false
bool executeEvent = false
float exitPrice = na
string exitReason = ""
if barstate.isconfirmed
    if entryBar
        active := true
        pending := false
        entryPrice := open
        stopPrice := entryPrice-stopDistance
        targetPrice := entryPrice+targetDistance
        bestHigh := entryPrice
        lastEntryTime := time
        lastEvent := "Model entry "+f_price(entryPrice)
        if showLabels
            label.new(bar_index,low,"MODEL ENTRY\n"+f_price(entryPrice),style=label.style_label_up,color=color.new(color.blue,25),textcolor=color.white,size=size.tiny)
    if active
        // Critical ordering: existing protection first, then next-bar trail update.
        bool stopHit = low <=stopPrice
        bool targetHit = high >=targetPrice
        if stopHit or targetHit
            exitPrice := stopHit ? stopPrice : targetPrice
            exitReason := stopHit ? "SL" : "FIXED TP"
            exitEvent := true
            active := false
            lastEvent := "Model "+exitReason+" touch "+f_price(exitPrice)
            if exitOn
                alert(f_message("MODEL EXIT "+exitReason,entryPrice,stopPrice,targetPrice,"Chart touch only. Check your broker position; model exit level "+f_price(exitPrice)),alert.freq_all)
        else
            bestHigh := math.max(bestHigh,high)
            float oldStop = stopPrice
            if bestHigh-entryPrice >=stopDistance
                stopPrice := math.max(stopPrice,bestHigh-stopDistance)
            trailEvent := stopPrice >oldStop
            if trailEvent
                lastEvent := "Next-bar model SL "+f_price(stopPrice)
                if trailOn
                    alert(f_message("MOVE SL / NEXT BAR",entryPrice,stopPrice,targetPrice,"Raise only; TP stays fixed. MODEL levels: verify actual fill/broker. Best high "+f_price(bestHigh)),alert.freq_all)
                if showLabels
                    label.new(bar_index,stopPrice,"NEXT SL\n"+f_price(stopPrice),style=label.style_label_left,color=color.orange,textcolor=color.black,size=size.tiny)
    bool cooldownOk = na(lastEntryTime) or time-lastEntryTime >=60*60000
    bool setup = warmOk and dateOk and sessionOk and atrOk and rangeOk and bullOk and breakoutOk
    if setup and cooldownOk and not active and not pending
        executeEvent := true
        pending := true
        pendingBar := bar_index
        modelCount +=1
        lastEvent := "EXECUTE confirmed; next-bar model entry pending"
        if executeOn
            alert(f_message("EXECUTE / CONFIRMED",close,close-stopDistance,close+targetDistance,"Enter next available bar if trading. Levels ESTIMATED from signal close; reset from actual fill. SL-18; fixedTP+31.5; trail activates+18."),alert.freq_all)
 
// Optional PREPARE uses developing values; intrabar-only and at most once/bar.
// It does NOT gate the confirmed setup. Historical prepare alerts are not invented.
varip bool preparedThisBar = false
if barstate.isnew
    preparedThisBar := false
bool coolNow = na(lastEntryTime) or time-lastEntryTime >=60*60000
bool freeNow = not active and not pending
bool nearBreakout = close >=rangeHigh-prepareDistance
bool prepareNow = warmOk and dateOk and sessionOk and atrOk and rangeOk and bullOk and nearBreakout and coolNow and freeNow
if barstate.isrealtime and not barstate.isconfirmed and prepareNow and not preparedThisBar
    preparedThisBar := true
    if prepareOn
        alert(f_message("PREPARE / PROVISIONAL",close,close-stopDistance,close+targetDistance,"Do not enter yet. Wait for EXECUTE at candle close. Breakout level "+f_price(rangeHigh)+". Setup may cancel."),alert.freq_all)
 
// SL active in current bar vs SL just calculated for following bar are separate.
plot(showRange ? rangeHigh :na,"Prior12 high",color=color.blue)
plot(showRange ? rangeLow :na,"Prior12 low",color=color.new(color.blue,65))
plot(showLevels ? barEntry :na,"Model entry reference",color=color.aqua,style=plot.style_linebr)
plot(showLevels ? barStop :na,"SL active during this bar",color=color.red,linewidth=2,style=plot.style_linebr)
plot(showLevels and active ? stopPrice :na,"SL from next bar after close",color=color.orange,linewidth=2,style=plot.style_circles)
plot(showLevels ? barTarget :na,"Fixed TP reference",color=color.lime,linewidth=2,style=plot.style_linebr)
plot(showLevels ? barEntry+stopDistance :na,"Trail activation reference",color=color.new(color.yellow,40),style=plot.style_linebr)
plot(atrRank,"ATR inclusive rank",display=display.data_window)
plot(executeEvent ?1:0,"Confirmed execute event",display=display.data_window)
plot(modelCount,"Model signal count",display=display.data_window)
plotshape(showSignals and executeEvent,title="EXECUTE long confirmed",style=shape.triangleup,location=location.belowbar,color=color.lime,size=size.small,text="EXEC L",textcolor=color.white)
plotshape(showSignals and exitEvent,title="Model exit",style=shape.xcross,location=location.abovebar,color=color.red,size=size.tiny,text="EXIT")
bgcolor(showPrepare and barstate.isrealtime and not barstate.isconfirmed and prepareNow ?color.new(color.yellow,88):na,title="Provisional PREPARE")
 
string pos = switch anchor
    "Top left" =>position.top_left
    "Bottom right" =>position.bottom_right
    "Bottom left" =>position.bottom_left
    =>position.top_right
var table panel = table.new(pos,2,17,bgcolor=color.new(color.black,12),frame_color=color.gray,frame_width=1)
f_row(int row,string left,string right,color txt) =>
    table.cell(panel,0,row,left,text_color=color.silver,text_size=size.small,text_halign=text.align_left)
    table.cell(panel,1,row,right,text_color=txt,text_size=size.small,text_halign=text.align_left)
if barstate.islast
    if showTable
        f_row(0,"VIBE QSFM-00024946 L","v1.0 Trailing SL Indicator Pine",color.white)
        f_row(1,"Mode",validationOnly ?"Reference window":"LIVE / no signal end",color.white)
        f_row(2,"M5 bar opens11UTC",f_flag(sessionOk)+" | 18h Bangkok",sessionOk ?color.lime:color.orange)
        f_row(3,"ATR rank0.10..0.60",f_flag(atrOk)+" | "+str.tostring(atrRank,"#.000"),atrOk ?color.lime:color.orange)
        f_row(4,"Prior range14.4..72",f_flag(rangeOk)+" | "+f_price(rangeWidth),rangeOk ?color.lime:color.orange)
        f_row(5,"Bull + close>prior high",f_flag(bullOk and breakoutOk)+" | level "+f_price(rangeHigh),bullOk and breakoutOk ?color.lime:color.orange)
        f_row(6,"Warmup / dates",f_flag(warmOk and dateOk)+" | "+str.tostring(sourceBars)+" bars",warmOk and dateOk ?color.lime:color.orange)
        f_row(7,"60min / model flat",f_flag(coolNow)+" / "+f_flag(freeNow),coolNow and freeNow ?color.lime:color.orange)
        string state = pending and executeEvent ?"CONFIRMED / entry pending":exitEvent ?"MODEL EXIT":active ?"MODEL OPEN":entryBar ?"NEXT-BAR ENTRY reference":pending ?"CONFIRMED / entry pending":"MODEL FLAT"
        f_row(8,"State",state,color.aqua)
        float displayEntry = pending and executeEvent ?close:not na(barEntry) and not exitEvent ?barEntry:pending ?close:na
        float displaySL = active ?stopPrice:pending and executeEvent ?close-stopDistance:entryBar and not exitEvent ?barStop:pending ?close-stopDistance:na
        float displayTP = active ?targetPrice:pending and executeEvent ?close+targetDistance:entryBar and not exitEvent ?barTarget:pending ?close+targetDistance:na
        f_row(9,"Entry ref / estimate",f_price(displayEntry),color.aqua)
        f_row(10,"SL ref (after close=new)",f_price(displaySL),color.orange)
        f_row(11,"FIXED TP reference",f_price(displayTP),color.lime)
        f_row(12,"Trail",active and bestHigh-entryPrice >=18 ?"ACTIVE; raise only":"Starts at entry+18",color.yellow)
        f_row(13,"Source history",firstLoaded >seedTime ?"SEED INCOMPLETE":"Coverage loaded; seed unconfirmed",firstLoaded >seedTime ?color.red:color.silver)
        f_row(14,"Last event",lastEvent,color.white)
        f_row(15,"Long method",showDescription ?"Prior12 breakout; ATR band; no HTF":"Description hidden",color.silver)
        f_row(16,"Historical WR (not forecast)",showHistoryStats ?"Train71.43%/21; forward55.56%/18":"Model levels only; broker fill differs",color.silver)
    else
        table.clear(panel,0,0,1,16)

← 返回列表