HelperScriptA Personal Helper Script based on FFriZz/Holiday/2 Only change the font size and languageBiblioteca Pine Script®por ppt616543Actualizado 0
ArgentinaBondsLib - Argentina Sovereign Bonds Cashflow LibraryArgentinaBondsLib A Pine Script v6 library providing cashflow data and financial calculation functions for Argentine sovereign bonds (Bonares and Globales). ## Supported Bonds **Bonares** (Argentina legislation, USD MEP): AE38, AL29, AL30, AL35, AL41, AN29 **Globales** (Foreign legislation, USD Cable): GD29, GD30, GD35, GD38, GD41, GD46 ## Exported Functions ### Cashflow Data - `getCashflows_ ()` - Returns timestamps, cashflows, and count for each bond ### Bond Identification - `getBondType(ticker)` - Returns BONAR() or GLOBAL() - `getBaseTicker(ticker)` - Extracts base ticker without prefix/suffix - `getCurrencyType(ticker)` - Returns 0=ARS, 1=MEP, 2=Cable - `isSupported(baseTicker)` - Checks if bond is supported ### Financial Calculations - `calcPV()` - Present Value calculation - `calcIRR()` - Internal Rate of Return using Newton-Raphson method - `calcPriceFromIRR()` - Calculate price from target IRR ### Currency Conversion - `convertToNativeCurrency()` - Converts price to cashflow currency (MEP for Bonares, Cable for Globales) ### Utilities - `getSettlementDate()` - Returns T+1 timestamp - `BONAR()` / `GLOBAL()` - Bond type constants ## Methodology - Day count convention: Actual/365 - Settlement: T+1 - IRR solver: Newton-Raphson iterative method ## Usage Example ``` import EcoValores/ArgentinaBondsLib/1 as Bonds = Bonds.getCashflows_AL30() settlementDate = Bonds.getSettlementDate() irr = Bonds.calcIRR(ts, cf, count, settlementDate, close) ``` --- ## Español Librería Pine Script v6 con datos de flujos de fondos y funciones de cálculo financiero para bonos soberanos argentinos. ### Bonos Soportados - **Bonares** (Legislación argentina, USD MEP): AE38, AL29, AL30, AL35, AL41, AN29 - **Globales** (Legislación extranjera, USD Cable): GD29, GD30, GD35, GD38, GD41, GD46 ### Metodología - Convención de días: Actual/365 - Liquidación: T+1 - Solver TIR: Método iterativo Newton-Raphson --- **DISCLAIMER**: This library is for informational and educational purposes only. Eco Valores S.A. does NOT provide investment advice or recommendations. Consult a qualified financial advisor before making investment decisions. **AVISO LEGAL**: Esta librería es solo para fines informativos y educativos. Eco Valores S.A. NO brinda asesoramiento ni recomendaciones de inversión. Consulte con un asesor financiero calificado antes de invertir. Biblioteca Pine Script®por Eco Valores3
CoreLibrary "Core" inRTH() gapFlags(prevDayClose, gapPct) Parameters: prevDayClose (float) gapPct (float) gapInfo(prevClose) Parameters: prevClose (float) relativeVolume(len) Parameters: len (int) barSeconds() barSecondsOpt(rthSecondsDefault) Parameters: rthSecondsDefault (int) relVolRealtime(len) Parameters: len (int) mtfAlign(htfEma, tol) Parameters: htfEma (float) tol (float) htfDistanceAbs(htfEma, fallback) Parameters: htfEma (float) fallback (float) mtfState(htfEma, tol) Parameters: htfEma (float) tol (float) adaptiveLength(rocLen, minSmooth, maxSmooth, useAdaptive, baseSmoothing, speedLookback) Parameters: rocLen (int) minSmooth (int) maxSmooth (int) useAdaptive (bool) baseSmoothing (int) speedLookback (int) adaptiveTrend(src, adaptiveLen) Parameters: src (float) adaptiveLen (float) atrBands(atrLen, atrMult, basis) Parameters: atrLen (simple int) atrMult (float) basis (float) calcTrendStrength(closePrice, fastEMA, slowEMA, volumeConfirmed, speedConfirmed) Parameters: closePrice (float) fastEMA (float) slowEMA (float) volumeConfirmed (bool) speedConfirmed (bool) calcMovementPotential(inExpansionZone, trendStrength, speedConfirmed) Parameters: inExpansionZone (bool) trendStrength (int) speedConfirmed (bool) combineSignalScore(trendStrength, movementPotential, mtfBonus, volumeSurgeBonus) Parameters: trendStrength (int) movementPotential (int) mtfBonus (int) volumeSurgeBonus (int) strength10(dirLong, volRatio, htfDistance, isTraditional, isAltPattern, bodySize, rsi) Parameters: dirLong (bool) volRatio (float) htfDistance (float) isTraditional (bool) isAltPattern (bool) bodySize (float) rsi (float) sessionProfile() microstructure(lookback) Parameters: lookback (int) normalizePressure(pressure, lookback) Parameters: pressure (float) lookback (int) tickPressureNorm(lb) Parameters: lb (int) zscore(x, lb) Parameters: x (float) lb (int) tickPressureZ(lb) Parameters: lb (int) strength10DayTrade(dirLong, volRatio, htfDistance, isTraditional, isAltPattern, bodySize, rsi, sessionBonus, tickPressure) Parameters: dirLong (bool) volRatio (float) htfDistance (float) isTraditional (bool) isAltPattern (bool) bodySize (float) rsi (float) sessionBonus (bool) tickPressure (float) vwapBands(vwap, length) Parameters: vwap (float) length (int) vwapChop(vwap, dev, atrPct, rsi) Parameters: vwap (float) dev (float) atrPct (float) rsi (float) calcRiskReward(entry, stop, tp1, tp2, tp3, shares) Parameters: entry (float) stop (float) tp1 (float) tp2 (float) tp3 (float) shares (float) squeezeBBKC() marketRegime(lookback) Parameters: lookback (int) squeezeBucket(ratio) Parameters: ratio (float) dynamicCooldown(baseBars, atrPct, inChop, maxBars) Parameters: baseBars (int) atrPct (float) inChop (bool) maxBars (int) vwapMode(inChop) Parameters: inChop (bool) toPctStr(x) Parameters: x (float) yesNo(b) Parameters: b (bool) trendLabel(state) Parameters: state (int) minRByPct(price, pct) Parameters: price (float) pct (float) vwapChopScore(vwap, dev, atrPct, rsi) Parameters: vwap (float) dev (float) atrPct (float) rsi (float) strengthGateSuggest(isQualityTime, inChop, baseGate) Parameters: isQualityTime (bool) inChop (bool) baseGate (int) cooldownReason(atrPct, inChop) Parameters: atrPct (float) inChop (bool) readyGates(isQualityTime, inChop, relVol, atrPct, baseGate) Parameters: isQualityTime (bool) inChop (bool) relVol (float) atrPct (float) baseGate (int) readyVerdict(isLong, mtfStateVal, relVol, atrPercent, strengthScore, strengthGate) Parameters: isLong (bool) mtfStateVal (int) relVol (float) atrPercent (float) strengthScore (int) strengthGate (int) structuralStops(isLong, sigLow, sigHigh, vwap, dev, atr, stopBufAtr) Parameters: isLong (bool) sigLow (float) sigHigh (float) vwap (float) dev (float) atr (float) stopBufAtr (float) emaSlopePct(ema, bars) Parameters: ema (float) bars (int) atrPct(len) Parameters: len (simple int) cooldownStatus(lastSigBar, cooldownBars) Parameters: lastSigBar (int) cooldownBars (int) emaSlopeSign(ema, bars) Parameters: ema (float) bars (int) barProgress() rthMarkers() badge(ok) Parameters: ok (bool) triBadge(x) Parameters: x (int) priceAcceptanceAdaptive(minBodyFrac) Parameters: minBodyFrac (float) speedConfirmed(rocLen, emaLen, smaLen) Parameters: rocLen (int) emaLen (simple int) smaLen (int) setupScore(isLoose, isNormal, vwapTrend, emaUp, mtfBull, relVolOK, microOK, cooldownOK) Parameters: isLoose (bool) isNormal (bool) vwapTrend (bool) emaUp (bool) mtfBull (bool) relVolOK (bool) microOK (bool) cooldownOK (bool) setupTier(score) Parameters: score (int) setupQuality(score) Parameters: score (int) setupQualityColor(score) Parameters: score (int) setupScoreDir(isLong, isLoose, isNormal, vwapTrend, emaUp, mtfBull, relVolOK, priceAccept, tickNorm, cooldownOK) Parameters: isLong (bool) isLoose (bool) isNormal (bool) vwapTrend (bool) emaUp (bool) mtfBull (bool) relVolOK (bool) priceAccept (bool) tickNorm (float) cooldownOK (bool) setupScoresBoth(isLoose, isNormal, vwapTrend, emaUp, mtfBull, relVolOK, priceAccept, tickNorm, cooldownOK) Parameters: isLoose (bool) isNormal (bool) vwapTrend (bool) emaUp (bool) mtfBull (bool) relVolOK (bool) priceAccept (bool) tickNorm (float) cooldownOK (bool) ruleGatesDir(isLong, squeezeTight, emaUp, vwapTrend, relVol, relVolThresh, tickNorm, useSqzGate, useEmaGate, useVwapGate, useVolGate, useMicroGate) Parameters: isLong (bool) squeezeTight (bool) emaUp (bool) vwapTrend (bool) relVol (float) relVolThresh (float) tickNorm (float) useSqzGate (bool) useEmaGate (bool) useVwapGate (bool) useVolGate (bool) useMicroGate (bool) ruleGates(squeezeTight, emaUp, vwapTrend, relVol, relVolThresh, tickNorm, useSqzGate, useVwapGate, useVolGate, useMicroGate) Parameters: squeezeTight (bool) emaUp (bool) vwapTrend (bool) relVol (float) relVolThresh (float) tickNorm (float) useSqzGate (bool) useVwapGate (bool) useVolGate (bool) useMicroGate (bool) arrowColor(bucket, baseColor, useRegimeColor) Parameters: bucket (string) baseColor (color) useRegimeColor (bool) orbHiLo(minutes) Parameters: minutes (int) prevDayHL()Biblioteca Pine Script®por ryan5610
EMTIA_MASTER_LIBLibrary "EMTIA_MASTER_LIB" trendUp(emaFast, emaSlow) Parameters: emaFast (float) emaSlow (float) rsiHealthy(rsi) Parameters: rsi (float) adxStrong(adx, diPlus, diMinus) Parameters: adx (float) diPlus (float) diMinus (float) macroSlope(emaFast, emaSlow) Parameters: emaFast (float) emaSlow (float) structureBull(hh, hl) Parameters: hh (bool) hl (bool) calcScore(weeklyTrend, dailyTrend, adxOk, rsiOk, structureOk, macroOk) Parameters: weeklyTrend (bool) dailyTrend (bool) adxOk (bool) rsiOk (bool) structureOk (bool) macroOk (bool)Biblioteca Pine Script®por eflatunid0
ZigZag forceLibrary "ZigZag" method lastPivot(this) Retrieves the last `Pivot` object's reference from a `ZigZag` object's `pivots` array if it contains at least one element, or `na` if the array is empty. Callable as a method or a function. Namespace types: ZigZag Parameters: this (ZigZag) : (series ZigZag) The `ZigZag` object's reference. Returns: (Pivot) The reference of the last `Pivot` instance in the `ZigZag` object's `pivots` array, or `na` if the array is empty. method update(this) Updates a `ZigZag` object's pivot information, volume data, lines, and labels when it detects new pivot points. NOTE: This function requires a single execution on each bar for accurate calculations. Callable as a method or a function. Namespace types: ZigZag Parameters: this (ZigZag) : (series ZigZag) The `ZigZag` object's reference. Returns: (bool) `true` if the function detects a new pivot point and updates the `ZigZag` object's data, `false` otherwise. newInstance(settings) Creates a new `ZigZag` instance with optional settings. Parameters: settings (Settings) : (series Settings) Optional. A `Settings` object's reference for the new `ZigZag` instance's `settings` field. If `na`, the `ZigZag` instance uses a new `Settings` object with default properties. The default is `na`. Returns: (ZigZag) A new `ZigZag` object's reference. Settings A structure for objects that store calculation and display properties for `ZigZag` instances. Fields: devThreshold (series float) : The minimum percentage deviation from a previous pivot point required to change the Zig Zag's direction. depth (series int) : The number of bars required for pivot point detection. lineColor (series color) : The color of each line in the Zig Zag drawing. extendLast (series bool) : Specifies whether the Zig Zag drawing includes a line connecting the most recent pivot point to the latest bar's `close`. displayReversalPrice (series bool) : Specifies whether the Zig Zag drawing shows pivot prices in its labels. displayCumulativeVolume (series bool) : Specifies whether the Zig Zag drawing shows the cumulative volume between pivot points in its labels. displayReversalPriceChange (series bool) : Specifies whether the Zig Zag drawing shows the reversal amount from the previous pivot point in each label. differencePriceMode (series string) : The reversal amount display mode. Possible values: `"Absolute"` for price change or `"Percent"` for percentage change. draw (series bool) : Specifies whether the Zig Zag drawing displays its lines and labels. allowZigZagOnOneBar (series bool) : Specifies whether the Zig Zag calculation can register a pivot high *and* pivot low on the same bar. Pivot A structure for objects that store chart point references, drawing references, and volume information for `ZigZag` instances. Fields: ln (series line) : References a `line` object that connects the coordinates from the `start` and `end` chart points. lb (series label) : References a `label` object that displays pivot data at the `end` chart point's coordinates. isHigh (series bool) : Specifies whether the pivot at the `end` chart point's coordinates is a pivot high. vol (series float) : The cumulative volume across the bars between the `start` and `end` chart points. start (chart.point) : References a `chart.point` object containing the coordinates of the previous pivot point. end (chart.point) : References a `chart.point` object containing the coordinates of the current pivot point. ZigZag A structure for objects that maintain Zig Zag drawing settings, pivots, and cumulative volume data. Fields: settings (Settings) : References a `Settings` object that specifies the Zig Zag drawing's calculation and display properties. pivots (array) : References an array of `Pivot` objects that store pivot point, drawing, and volume information. sumVol (series float) : The cumulative volume across bars covered by the latest `Pivot` object's line segment. extend (Pivot) : References a `Pivot` object that projects a line from the last confirmed pivot point to the current bar's `close`.Biblioteca Pine Script®por Jtraid1
PineML_v6Library "PineML_v6" ML Library for lightweight strategies. Implements k-NN with matrix storage. method new_model(k, history, features) Създава нов модел Namespace types: series int, simple int, input int, const int Parameters: k (int) : Брой съседи (напр. 5) history (int) : Дълбочина на паметта (напр. 1000 бара) features (int) : Брой променливи, които ще следим method train(model, feature_array, label) Добавя нови данни към паметта на модела Namespace types: KNN_Model Parameters: model (KNN_Model) : Инстанцията на модела feature_array (array) : Масив с текущите стойности на индикаторите label (float) : Резултатът (класът), свързан с тези данни method predict(model, query_features) Изчислява прогноза на база текущите данни Namespace types: KNN_Model Parameters: model (KNN_Model) query_features (array) KNN_Model Fields: k_neighbors (series int) max_history (series int) features (matrix) labels (array) feature_count (series int)Biblioteca Pine Script®por stoyan_valev0
StrategyMatrixLibLibrary "StrategyMatrixLib" render_matrix(posStr, digits, bgCol, headBg, headTxt, valCol, valTxt) Renders a strategy performance matrix (table) using strategy.* and strategy.closedtrades.* Parameters: posStr (string) : Table anchor position: "Top Left" | "Top Right" | "Bottom Left" | "Bottom Right" digits (int) : Decimal places for numeric formatting bgCol (color) : Background color for non-header cells headBg (color) : Background for header rows headTxt (color) : Text color for header rows valCol (color) : Background for value cells valTxt (color) : Text color for value cells Returns: table id The created/updated table IDBiblioteca Pine Script®por neghabi_mrActualizado 0
SlopeUtilsLibrary "SlopeUtils" calcSlope(src, atr_series, length) Calculates a normalized slope based on price change relative to ATR. Parameters: src (float) : (series float) The source input (e.g., close). atr_series (float) : (series float) The ATR value for normalization. length (simple int) : (simple int) The lookback period for the slope calculation. Returns: (float) The normalized slope value.Biblioteca Pine Script®por hjd17Actualizado 0
BoxesLibLibrary "BoxesLib" isOverlappingBox(_boxes, _top, _bottom) Parameters: _boxes (array) _top (float) _bottom (float) isTooCloseBox(_boxes, _top, _bottom, zoneProximityPct) Parameters: _boxes (array) _top (float) _bottom (float) zoneProximityPct (float) createBox(_boxes, _top, _bottom, _leftBarIndex, _color, _txt, _is_breakout, numberLimit, zoneProximityPct, currentClose, isConfirmed) Parameters: _boxes (array) _top (float) _bottom (float) _leftBarIndex (int) _color (color) _txt (string) _is_breakout (bool) numberLimit (int) zoneProximityPct (float) currentClose (float) isConfirmed (bool) manageBoxes(_boxes, _is_breakout, currentClose, isConfirmed) Parameters: _boxes (array) _is_breakout (bool) currentClose (float) isConfirmed (bool)Biblioteca Pine Script®por OptionstickerActualizado 0
TradingSystems_AlphaLib_v1_FinalLibrary "TradingSystems_AlphaLib_v1_Final" Master Library for Institutional Analysis v1 @author jmcanovelles calc_ema(len) Calculates standardized EMA Parameters: len (simple int) calc_adx(len) Calculates precise ADX and DI Parameters: len (simple int)Biblioteca Pine Script®por jmcanovelles0
TradingSystems_AlphaLib_v6//@version=6 // @description Master Library for Institutional Grade Analysis v1 // @author jmcanovelles library("TradingSystems_AlphaLib_v6") // @function Calculates standardized EMA // @param len Period for the average export calc_ema(int len) => ta.ema(close, len) // @function Calculates precise ADX and DI // @param len Calculation period export calc_adx(int len) => = ta.dmi(len, len) Biblioteca Pine Script®por jmcanovelles0
OKXJsonLibrary "OKXJson" f_buildId(prefix, instrument) Parameters: prefix (string) instrument (string) f_utcTimestamp() f_investmentType(internalAction, entryType, closeType) Parameters: internalAction (string) entryType (string) closeType (string) f_build(id, okxAction, marketPosition, prevMarketPosition, instrument, signalToken, timestampUtc, investmentType, amount, maxLagSeconds) Parameters: id (string) okxAction (string) marketPosition (string) prevMarketPosition (string) instrument (string) signalToken (string) timestampUtc (string) investmentType (string) amount (string) maxLagSeconds (string)Biblioteca Pine Script®por parkbc2kActualizado 3
SharelineUI_LibraryLibrary "SharelineUI_Library" get_text_size(opt) Parameters: opt (string) status_color(val) Parameters: val (float) trend_color(trend_cat) Parameters: trend_cat (string) momentum_color(score, bullTh, bearTh) Parameters: score (float) bullTh (float) bearTh (float) create_standard_hud(pos, cols, rows) Parameters: pos (string) cols (int) rows (int)Biblioteca Pine Script®por cryptodany_230
Mirpapa_Lib_StructLibrary "Mirpapa_Lib_Struct" ICT 구조 변화 감지 라이브러리 (BOS, CHoCH, MSS, Sweep) initStructState() StructState 초기화 checkBOS(_trend, _currentClose, _lastHHPrice, _lastLLPrice) BOS 체크 (추세 지속) - 종가 기준 Parameters: _trend (string) : 현재 추세 _currentClose (float) : 현재 종가 _lastHHPrice (float) : 마지막 HH 가격 _lastLLPrice (float) : 마지막 LL 가격 Returns: checkCHoCH(_trend, _currentClose, _lastHHPrice, _lastLLPrice) CHoCH 체크 (추세 전환) - 종가 기준 Parameters: _trend (string) : 현재 추세 _currentClose (float) : 현재 종가 _lastHHPrice (float) : 마지막 HH 가격 _lastLLPrice (float) : 마지막 LL 가격 Returns: checkSweep(_currentHigh, _currentLow, _currentClose, _lastHHPrice, _lastLLPrice) Sweep 체크 (유동성 수집) 설명 Parameters: _currentHigh (float) : 현재 고가 _currentLow (float) : 현재 저가 _currentClose (float) : 현재 종가 _lastHHPrice (float) : 마지막 HH 가격 _lastLLPrice (float) : 마지막 LL 가격 Returns: checkMSS(_hadCHoCH, _chochDir, _currentHigh, _currentLow, _chochPrice) MSS 체크 (CHoCH + 리테스트 확인) Parameters: _hadCHoCH (bool) : CHoCH 발생 여부 _chochDir (string) : CHoCH 방향 _currentHigh (float) : 현재 고가 _currentLow (float) : 현재 저가 _chochPrice (float) : CHoCH 발생 가격 Returns: drawStructLabel(_price, _time, _type, _dir, _lblColor) 구조 변화 라벨 그리기 Parameters: _price (float) : 가격 _time (int) : 시간 _type (string) : 구조 타입 _dir (string) : 방향 _lblColor (color) : 라벨 색상 drawStructLine(_price, _startTime, _endTime, _lineColor, _lineWidth) 구조 변화 라인 그리기 Parameters: _price (float) : 가격 _startTime (int) : 시작 시간 _endTime (int) : 끝 시간 _lineColor (color) : 라인 색상 _lineWidth (int) : 라인 두께 StructType 구조 타입 상수 Fields: BOS (series string) CHOCH (series string) MSS (series string) SWEEP (series string) TrendDir 추세 방향 상수 Fields: UP (series string) DOWN (series string) NONE (series string) StructState 구조 변화 상태 Fields: _trend (series string) : 현재 추세 방향 _lastHHPrice (series float) : 마지막 HH 가격 _lastHHTime (series int) : 마지막 HH 시간 _lastLLPrice (series float) : 마지막 LL 가격 _lastLLTime (series int) : 마지막 LL 시간 _peakHHPrice (series float) : 최고 HH 가격 (BOS 레벨용) _peakHHTime (series int) : 최고 HH 시간 _peakLLPrice (series float) : 최저 LL 가격 (BOS 레벨용) _peakLLTime (series int) : 최저 LL 시간 _bosLevelHH (series float) : BOS 체크용 HH 레벨 (확정된 최고 HH) _bosLevelHHTime (series int) : BOS 체크용 HH 시간 _bosLevelLL (series float) : BOS 체크용 LL 레벨 (확정된 최저 LL) _bosLevelLLTime (series int) : BOS 체크용 LL 시간Biblioteca Pine Script®por goodiaActualizado 1
Mirpapa_Lib_UnicornLibrary "Mirpapa_Lib_Unicorn" 유니콘 패턴 라이브러리 (Unicorn Pattern Library) 유니콘 모델 전략 로직, 데이터 구조체 및 상태 관리를 구현합니다. initUnicornData(_isBull, _createTime, _createBar, _timeframe) UnicornData 초기화 @description 새로운 UnicornData 객체를 생성하고 초기화합니다. Parameters: _isBull (bool) : 방향 (True: 상승, False: 하락) _createTime (int) : 생성 시간 _createBar (int) : 생성 Bar Index _timeframe (string) : 시간대 calculateOverlap(_obTop, _obBot, _fvgTop, _fvgBot) 중첩 영역(Overlap Zone) 계산 @description OB와 FVG 사이의 겹치는 영역을 계산합니다. Parameters: _obTop (float) : OB 상단 _obBot (float) : OB 하단 _fvgTop (float) : FVG 상단 _fvgBot (float) : FVG 하단 Returns: 겹침 영역 상단, 하단, 겹침 여부 updateUnicornStatus(_data, _currentHigh, _currentLow, _time) 유니콘 상태 업데이트 @description 가격 움직임에 따라 유니콘 패턴의 상태를 업데이트합니다. active: 진입 대기 (리테스트 대기) -> triggered: 진입 (TP/SL 대기) -> win/loss: 결과 확정 Parameters: _data (UnicornData) : UnicornData 객체 _currentHigh (float) : 현재 고가 _currentLow (float) : 현재 저가 _time (int) : 현재 시간 Returns: UnicornData 업데이트된 객체 activateUnicorn(_data) 유니콘 활성화 (Active 전환) @description Pending 상태인 유니콘 데이터를 Active 상태로 전환합니다. (보통 CHoCH 발생 시 호출) Parameters: _data (UnicornData) : UnicornData 객체 setTradeLevels(_data, _entry, _stop, _target) 트레이딩 레벨 설정 @description 진입가, 목표가, 손절가를 설정합니다. Parameters: _data (UnicornData) : UnicornData 객체 _entry (float) : 진입가 _stop (float) : 손절가 _target (float) : 목표가 UnicornData 유니콘 데이터 (UnicornData) Fields: _isBull (series bool) : // 상승/하락 방향 (True: Long, False: Short) _status (series string) : // "pending", "active", "triggered", "win", "loss", "cancelled" _createTime (series int) : // 생성 시간 _createBar (series int) : // 생성 bar_index _obTop (series float) : // OB 상단 _obBot (series float) : // OB 하단 _obTime (series int) : // OB 캔들 시간 _obBox (series box) : // OB 박스 객체 _fvgTop (series float) : // FVG 상단 _fvgBot (series float) : // FVG 하단 _fvgTime (series int) : // FVG 시간 _fvgBox (series box) : // FVG 박스 객체 _zoneTop (series float) : // 겹침 영역 상단 (Unicorn Zone) _zoneBot (series float) : // 겹침 영역 하단 (Unicorn Zone) _zoneBox (series box) : // Unicorn Zone 박스 객체 _chochConfirmed (series bool) : // CHoCH 확정 여부 _chochTime (series int) : // CHoCH 발생 시간 _chochPrice (series float) : // CHoCH 돌파 가격 _entryPrice (series float) : // 진입가 _targetPrice (series float) : // 목표가 (다음 유동성 레벨) _stopPrice (series float) : // 손절가 (Zone 반대편) _result (series string) : // "none", "win", "loss" _resultTime (series int) : // 결과 확정 시간 _resultPrice (series float) : // 결과 확정 가격 _profitPips (series float) : // 수익 pips (양수) _lossPips (series float) : // 손실 pips (음수) _profitPercent (series float) : // 수익 % _lossPercent (series float) : // 손실 % _rrRatio (series float) : // Risk:Reward 비율 _timeframe (series string) : // 시간대 (HTF/MTF/CTF) _triggerTime (series int) : // 진입 트리거 시간 (리테스트) _triggerPrice (series float) : // 진입 트리거 가격 _isRetested (series bool) : // 리테스트 여부 _retestCount (series int) : // 리테스트 횟수 _maxDrawdown (series float) : // 최대 손실폭 (진입 후) _maxProfit (series float) : // 최대 수익폭 (진입 후)Biblioteca Pine Script®por goodia0
Mirpapa_Lib_StructsLibrary "Mirpapa_Lib_Structs" ICT 구조 변화 감지 라이브러리 (BOS, CHoCH, MSS, Sweep) initStructState() StructState 초기화 checkBOS(_trend, _currentClose, _lastHHPrice, _lastLLPrice) BOS 체크 (추세 지속) - 종가 기준 Parameters: _trend (string) : 현재 추세 _currentClose (float) : 현재 종가 _lastHHPrice (float) : 마지막 HH 가격 _lastLLPrice (float) : 마지막 LL 가격 Returns: checkCHoCH(_trend, _currentClose, _lastHHPrice, _lastLLPrice) CHoCH 체크 (추세 전환) - 종가 기준 Parameters: _trend (string) : 현재 추세 _currentClose (float) : 현재 종가 _lastHHPrice (float) : 마지막 HH 가격 _lastLLPrice (float) : 마지막 LL 가격 Returns: checkSweep(_currentHigh, _currentLow, _currentClose, _lastHHPrice, _lastLLPrice) Sweep 체크 (유동성 수집) Parameters: _currentHigh (float) : 현재 고가 _currentLow (float) : 현재 저가 _currentClose (float) : 현재 종가 _lastHHPrice (float) : 마지막 HH 가격 _lastLLPrice (float) : 마지막 LL 가격 Returns: checkMSS(_hadCHoCH, _chochDir, _currentHigh, _currentLow, _chochPrice) MSS 체크 (CHoCH + 리테스트 확인) Parameters: _hadCHoCH (bool) : CHoCH 발생 여부 _chochDir (string) : CHoCH 방향 _currentHigh (float) : 현재 고가 _currentLow (float) : 현재 저가 _chochPrice (float) : CHoCH 발생 가격 Returns: drawStructLabel(_price, _time, _type, _dir, _lblColor) 구조 변화 라벨 그리기 Parameters: _price (float) : 가격 _time (int) : 시간 _type (string) : 구조 타입 _dir (string) : 방향 _lblColor (color) : 라벨 색상 drawStructLine(_price, _startTime, _endTime, _lineColor, _lineWidth) 구조 변화 라인 그리기 Parameters: _price (float) : 가격 _startTime (int) : 시작 시간 _endTime (int) : 끝 시간 _lineColor (color) : 라인 색상 _lineWidth (int) : 라인 두께 StructType 구조 타입 상수 Fields: BOS (series string) CHOCH (series string) MSS (series string) SWEEP (series string) TrendDir 추세 방향 상수 Fields: UP (series string) DOWN (series string) NONE (series string) StructState 구조 변화 상태 Fields: _trend (series string) : 현재 추세 방향 _lastHHPrice (series float) : 마지막 HH 가격 _lastHHTime (series int) : 마지막 HH 시간 _lastLLPrice (series float) : 마지막 LL 가격 _lastLLTime (series int) : 마지막 LL 시간Biblioteca Pine Script®por goodiaActualizado 0
CEDEARDataLibrary "CEDEARData" getUnderlying(cedearTicker) Parameters: cedearTicker (simple string) getRatio(cedearTicker) Parameters: cedearTicker (simple string) getCurrency(cedearTicker) Parameters: cedearTicker (simple string) isValidCedear(cedearTicker) Parameters: cedearTicker (simple string)Biblioteca Pine Script®por Eco ValoresActualizado 445
Mirpapa_Lib_LineLibrary "Mirpapa_Lib_Line" CreateLine(_breachMode, _isBull, _leftTime, _rightTime, _price, _lineColor, _lineWidth, _lineStyle, _text) CreateLine @description 라인 생성 (값 전달 방식 - 모든 좌표 직접 지정).\ 호출자가 모든 좌표와 시간을 계산하여 전달.\ breachMode: "price"(고가/저가 돌파) 또는 "close"(종가 돌파).\ Parameters: _breachMode (string) : 돌파 처리 방식: "price" 또는 "close" _isBull (bool) : 상승(true) 또는 하락(false) _leftTime (int) : 라인 시작 시간 _rightTime (int) : 라인 종료 시간 _price (float) : 라인 가격 _lineColor (color) : 라인 색상 _lineWidth (int) : 라인 두께 _lineStyle (string) : 라인 스타일 (line.style_solid, line.style_dashed 등) _text (string) : 라인 텍스트 Returns: 성공 여부와 라인 데이터 ProcessLineDatas(_openLines, _closedLines, _closeCount, _colorClose, _currentBarIndex, _currentLow, _currentHigh, _currentTime) ProcessLineDatas @description 라인 확장 및 돌파 처리.\ 열린 라인들을 현재 bar까지 확장하고, 돌파 조건 체크.\ _closeCount: 돌파 횟수 (이 횟수만큼 돌파 시 라인 종료).\ breachMode에 따라 돌파 체크 방식 다름 (price/close).\ 종료된 라인은 _closedLines로 이동하고 _colorClose 색상 적용.\ barstate.islast와 barstate.isconfirmed에서 호출 권장. Parameters: _openLines (array) : 열린 라인 배열 _closedLines (array) : 닫힌 라인 배열 _closeCount (int) : 돌파 카운트 (이 횟수만큼 돌파 시 종료) _colorClose (color) : 종료된 라인 색상 _currentBarIndex (int) : 현재 bar_index _currentLow (float) : 현재 low _currentHigh (float) : 현재 high _currentTime (int) : 현재 time Returns: bool 항상 true BreachMode BreachMode Fields: PRICE (series string) CLOSE (series string) LineData LineData Fields: _breachMode (series string) : 돌파 처리 방식 _isBull (series bool) : 상승(true) 또는 하락(false) 방향 _line (series line) : 라인 객체 _price (series float) : 라인 가격 _text (series string) : 라인 텍스트 _breached (series bool) : 돌파 여부 _breakCount (series int) : 돌파 카운트Biblioteca Pine Script®por goodia2
MirPapa_Lib_BoxLibrary "MirPapa_Lib_Box" GetHTFrevised(_tf, _case) GetHTFrevised @description Retrieve a specific bar value from a Higher Time Frame (HTF) series. Parameters: _tf (string) : string The target HTF string (examples: "60", "1D"). _case (string) : string Case string determining which OHLC value to request. @return float Returns the requested HTF value or na if _case does not match. GetHTFrevised(_tf) Parameters: _tf (string) GetHTFoffsetToLTFoffset(_offset, _chartTf, _htfTf) GetHTFoffsetToLTFoffset @description Adjust an HTF offset to an LTF offset by calculating the ratio of timeframes. Parameters: _offset (int) : int The HTF bar offset (0 means current HTF bar). _chartTf (string) : string The current chart's timeframe (e.g., "5", "15", "1D"). _htfTf (string) : string The High Time Frame string (e.g., "60", "1D"). @return int The corresponding LTF bar index. Returns 0 if the result is negative. GetHtfFromLabel(_label) GetHtfFromLabel @description Convert a Korean HTF label into a Pine Script timeframe string. Parameters: _label (string) : string The Korean label (e.g., "5분", "1시간"). @return string Returns the corresponding Pine Script timeframe (e.g., "5", "60"). IsChartTFcomparisonHTF(_chartTf, _htfTf) IsChartTFcomparisonHTF @description Determine whether a given HTF is greater than or equal to the current chart timeframe. Parameters: _chartTf (string) : string Current chart timeframe (e.g., "5", "15", "1D"). _htfTf (string) : string HTF timeframe (e.g., "60", "1D"). @return bool True if HTF ≥ chartTF, false otherwise. IsCondition(_boxType, _isBull, _pricePrev, _priceNow) IsCondition @description FOB, FVG 조건 체크.\ _boxType: "fob"(Fair Order Block) 또는 "fvg"(Fair Value Gap).\ _isBull: true(상승 패턴), false(하락 패턴).\ 상승 시 현재 가격이 이전 가격보다 높으면 true, 하락 시 이전 가격이 현재 가격보다 높으면 true 반환. Parameters: _boxType (string) : 박스 타입 ("fob", "fvg") _isBull (bool) : 상승(true) 또는 하락(false) _pricePrev (float) : 이전 가격 _priceNow (float) : 현재 가격 Returns: bool 조건 만족 여부 IsCondition(_boxType, _high2, _high1, _high0, _low2, _low1, _low0) IsCondition @description Sweep 조건 체크 (Swing High/Low 동시 발생).\ _boxType: "sweep" 또는 "breachBoth".\ 조건: high2 < high1 > high0 (Swing High) AND low2 > low1 < low0 (Swing Low).\ 중간 캔들이 양쪽보다 높고 낮은 지점을 동시에 형성할 때 true 반환. Parameters: _boxType (string) : 박스 타입 ("sweep", "breachBoth") _high2 (float) _high1 (float) _high0 (float) _low2 (float) _low1 (float) _low0 (float) Returns: bool 조건 만족 여부 IsCondition(_boxType, _isBull, _open1, _close1, _high1, _low1, _open0, _close0, _low2, _low3, _high2, _high3) IsCondition @description RB (Rejection Block) 조건 체크.\ _boxType: "rb" (Rejection Block).\ 상승 RB: candle1=음봉, candle0=양봉, low3>low1 AND low2>low1, close1*1.001>open0, open1close0.\ 이전 캔들의 거부 후 현재 캔들이 반대 방향으로 전환될 때 true 반환. Parameters: _boxType (string) : 박스 타입 ("rb") _isBull (bool) : 상승(true) 또는 하락(false) _open1 (float) _close1 (float) _high1 (float) _low1 (float) _open0 (float) _close0 (float) _low2 (float) _low3 (float) _high2 (float) _high3 (float) Returns: bool 조건 만족 여부 IsCondition(_boxType, _isBull, _open2, _close1, _open1, _close0) IsCondition @description SOB (Strong Order Block) 조건 체크.\ _boxType: "sob" (Strong Order Block).\ 상승 SOB: 양봉2 => 음봉1 => 양봉0, open2 > close1 AND open1 < close0.\ 하락 SOB: 음봉2 => 양봉1 => 음봉0, open2 < close1 AND open1 > close0.\ 3개 캔들 패턴으로 강한 주문 블록 형성 시 true 반환. Parameters: _boxType (string) : 박스 타입 ("sob") _isBull (bool) : 상승(true) 또는 하락(false) _open2 (float) : 2개 이전 캔들 open _close1 (float) : 1개 이전 캔들 close _open1 (float) : 1개 이전 캔들 open _close0 (float) : 현재 캔들 close Returns: bool 조건 만족 여부 CreateBox(_boxType, _tf, _isBull, _useLine, _colorBG, _colorBD, _colorText, _cache) CreateBox @description 박스 생성 (breachMode 자동 결정).\ _boxType: "fob", "rb", "custom" → directionalHighLow, 나머지 → both.\ _tf: 시간대 (timeframe.period 또는 HTF).\ _isBull: true(상승 박스), false(하락 박스).\ _cache: HTF 사용 시 필수, CurrentTF는 na.\ 반환: . Parameters: _boxType (string) : 박스 타입 _tf (string) : 시간대 _isBull (bool) : 상승(true) 또는 하락(false) _useLine (bool) : 중간선 표시 여부 _colorBG (color) : 박스 배경색 _colorBD (color) : 박스 테두리색 _colorText (color) : 텍스트 색상 _cache (HTFCache) : HTF 캐시 데이터 Returns: 성공 여부와 박스 데이터 CreateBox(_boxType, _tf, _isBull, _useLine, _colorBG, _colorBD, _colorText, _cache, _customText) CreateBox @description 박스 생성 (커스텀 텍스트 지원, breachMode 자동 결정).\ _boxType: "fob", "rb", "custom" → directionalHighLow, 나머지 → both.\ _customText: 박스에 표시할 텍스트 (비어있으면 "시간대 박스타입" 형식으로 자동 생성).\ _isBull: true(상승 박스), false(하락 박스).\ 반환: . Parameters: _boxType (string) : 박스 타입 _tf (string) : 시간대 _isBull (bool) : 상승(true) 또는 하락(false) _useLine (bool) : 중간선 표시 여부 _colorBG (color) : 박스 배경색 _colorBD (color) : 박스 테두리색 _colorText (color) : 텍스트 색상 _cache (HTFCache) : HTF 캐시 데이터 _customText (string) : 커스텀 텍스트 Returns: 성공 여부와 박스 데이터 CreateBox(_boxType, _breachMode, _tf, _isBull, _useLine, _colorBG, _colorBD, _colorText, _cache, _customText) CreateBox @description 박스 생성 (breachMode 명시적 지정).\ _breachMode: "both"(양쪽 모두 돌파), "directionalHighLow"(방향성 high/low 돌파), "directionalClose"(방향성 close 돌파).\ _isBull: true(상승 박스), false(하락 박스).\ _customText: 박스에 표시할 텍스트 (비어있으면 "시간대 박스타입" 형식으로 자동 생성).\ 반환: . Parameters: _boxType (string) : 박스 타입 (fob, fvg, sweep, rb, custom 등) _breachMode (string) : 돌파 처리 방식: "both" (양쪽 모두), "directionalHighLow" (방향성 high/low), "directionalClose" (방향성 close) _tf (string) : 시간대 _isBull (bool) : 상승(true) 또는 하락(false) 방향 _useLine (bool) : 중간선 표시 여부 _colorBG (color) : 박스 배경색 _colorBD (color) : 박스 테두리색 _colorText (color) : 텍스트 색상 _cache (HTFCache) : HTF 캐시 데이터 (CurrentTF는 na) _customText (string) : 커스텀 텍스트 (비어있으면 자동 생성) Returns: 성공 여부와 박스 데이터 CreateCustomBox(_boxType, _breachMode, _isBull, _top, _bottom, _left, _right, _useLine, _colorBG, _colorBD, _colorText, _text) CreateCustomBox @description 완전히 유연한 커스텀 박스 생성.\ 사용자가 박스 위치(top, bottom, left, right), breach mode, 모든 파라미터를 직접 지정.\ 조건 체크는 사용자 스크립트에서 수행하고, 이 함수는 박스 생성만 담당.\ 새로운 박스 타입 추가 시 라이브러리 수정 없이 사용 가능. Parameters: _boxType (string) : 박스 타입 (사용자 정의 문자열) _breachMode (string) : 돌파 처리 방식: "both", "directionalHighLow", "directionalClose", "sobClose" _isBull (bool) : 상승(true) 또는 하락(false) 방향 _top (float) : 박스 상단 가격 _bottom (float) : 박스 하단 가격 _left (int) : 박스 시작 시간 (xloc.bar_time 사용) _right (int) : 박스 종료 시간 (xloc.bar_time 사용) _useLine (bool) : 중간선 표시 여부 _colorBG (color) : 박스 배경색 _colorBD (color) : 박스 테두리색 _colorText (color) : 텍스트 색상 _text (string) : 박스에 표시할 텍스트 Returns: 성공 여부와 박스 데이터 ProcessBoxDatas(_openBoxes, _closedBoxes, _useMidLine, _closeCount, _colorClose, _currentBarIndex, _currentLow, _currentHigh, _currentTime) ProcessBoxDatas @description 박스 확장 및 돌파 처리.\ 열린 박스들을 현재 bar까지 확장하고, 돌파 조건 체크.\ _closeCount: 돌파 횟수 (이 횟수만큼 돌파 시 박스 종료).\ breachMode에 따라 돌파 체크 방식 다름 (both/directionalHighLow/directionalClose).\ 종료된 박스는 _closedBoxes로 이동하고 _colorClose 색상 적용.\ barstate.islast와 barstate.isconfirmed에서 호출 권장. Parameters: _openBoxes (array) : 열린 박스 배열 _closedBoxes (array) : 닫힌 박스 배열 _useMidLine (bool) : 중간선 표시 여부 _closeCount (int) : 돌파 카운트 (이 횟수만큼 돌파 시 종료) _colorClose (color) : 종료된 박스 색상 _currentBarIndex (int) : 현재 bar_index _currentLow (float) : 현재 low _currentHigh (float) : 현재 high _currentTime (int) : 현재 time Returns: bool 항상 true UpdateHTFCache(_cache, _tf) UpdateHTFCache @description HTF 데이터 캐싱 (성능 최적화).\ HTF의 OHLC 데이터를 캐싱하여 매 틱마다 request.security 호출 방지.\ _cache: 기존 캐시 (없으면 na, 첫 호출 시).\ _tf: 캐싱할 시간대 (예: "60", "1D").\ 새 bar 또는 bar_index 변경 시에만 업데이트, 그 외에는 기존 캐시 반환.\ Parameters: _cache (HTFCache) : 기존 캐시 데이터 (없으면 na) _tf (string) : 시간대 Returns: HTFCache 업데이트된 캐시 데이터 GetTimeframeSettings(_currentTF, _midTF1m, _highTF1m, _midTF5m, _highTF5m, _midTF15m, _highTF15m, _midTF30m, _highTF30m, _midTF60m, _highTF60m, _midTF240m, _highTF240m, _midTF1D, _highTF1D, _midTF1W, _highTF1W, _midTF1M, _highTF1M) GetTimeframeSettings @description 현재 차트 시간대에 맞는 중위/상위 시간대 자동 선택.\ _currentTF: 현재 차트 시간대 (timeframe.period).\ 1분~1월 차트별로 적절한 중위/상위 시간대 매핑.\ 예: 5분 차트 → 중위 15분, 상위 60분.\ 반환: .\ Parameters: _currentTF (string) : 현재 차트 시간대 _midTF1m (string) _highTF1m (string) _midTF5m (string) _highTF5m (string) _midTF15m (string) _highTF15m (string) _midTF30m (string) _highTF30m (string) _midTF60m (string) _highTF60m (string) _midTF240m (string) _highTF240m (string) _midTF1D (string) _highTF1D (string) _midTF1W (string) _highTF1W (string) _midTF1M (string) _highTF1M (string) Returns: BoxData BoxData Fields: _type (series string) : 박스 타입 (fob, fvg, sweep, rb, custom 등) _breachMode (series string) : 돌파 처리 방식 _isBull (series bool) : 상승(true) 또는 하락(false) 방향 _box (series box) _line (series line) _boxTop (series float) _boxBot (series float) _boxMid (series float) _topBreached (series bool) _bottomBreached (series bool) _breakCount (series int) _createdBar (series int) HTFCache Fields: _timeframe (series string) _lastBarIndex (series int) _isNewBar (series bool) _barIndex (series int) _open (series float) _high (series float) _low (series float) _close (series float) _open1 (series float) _close1 (series float) _high1 (series float) _low1 (series float) _open2 (series float) _close2 (series float) _high2 (series float) _low2 (series float) _high3 (series float) _low3 (series float) _time1 (series int) _time2 (series int)Biblioteca Pine Script®por goodiaActualizado 2
MTFToolkit-LibraryLibrary "MTFToolkit" Multi-Timeframe Utilities Library: conversions, Fibonacci, TF sorting, MTF helpers, color gradients, demo table timeframeToMinutes(tf) Converts a timeframe string to minutes Parameters: tf (string) : Timeframe string (e.g., "1", "15", "1D", "1W", "1M") Returns: Number of minutes as float minutesToTimeframe(minutes) Converts minutes to a timeframe string Parameters: minutes (float) : Number of minutes Returns: Timeframe string timeframeToSeconds(tf) Converts a timeframe string to seconds Parameters: tf (string) : Timeframe string Returns: Number of seconds secondsToTimeframe(seconds) Converts seconds to a timeframe string Parameters: seconds (float) : Number of seconds Returns: Timeframe string fiboGenerate(n) Generates Fibonacci sequence up to n elements Parameters: n (int) : Number of elements Returns: Array of Fibonacci numbers fiboMapToTV(arrFibo) Maps Fibonacci values to TradingView timeframe strings Parameters: arrFibo (array) : Array of Fibonacci numbers Returns: Array of timeframe strings arrayMergeUnique(arr1, arr2) Merges two string arrays and keeps unique values Parameters: arr1 (array) : First array arr2 (array) : Second array Returns: Merged array with unique strings arrayFilterMax(arr, maxMinutes) Filters TF array by max minutes Parameters: arr (array) : Array of timeframe strings maxMinutes (float) : Maximum allowed minutes Returns: Filtered array arraySortTF(tf_array, show_array, ascending) Sorts TF array by minutes, optionally ascending Parameters: tf_array (array) : Array of timeframes show_array (array) : Array of bool flags (for visibility) ascending (bool) masterTF(arr) Returns the largest TF from array (master) Parameters: arr (array) : Array of TF strings Returns: Master TF slaveTF(arr) Returns all TFs except master (slaves) Parameters: arr (array) : Array of TF strings Returns: Array of slave TFs isTFIncreasing(prevTF, nextTF) Checks if next TF is larger than previous Parameters: prevTF (string) : Previous timeframe nextTF (string) : Next timeframe Returns: true if nextTF > prevTF TFScore(values) Computes simple average as score Parameters: values (array) : Array of float Returns: Simple average (na if empty) gradient_triangular(value, mid_point, min_color, mid_color, max_color) Produces a triangular gradient between 3 colors Parameters: value (float) : Current value (0–100 or any scale) mid_point (float) : Center point of gradient min_color (color) : Color at low end mid_color (color) : Color at midpoint max_color (color) : Color at high end Returns: A color value TFColorGradient(tf_val, min_val, max_val) Timeframe color gradient helper Converts a timeframe (in minutes) into a color using a red → yellow → green gradient. Parameters: tf_val (float) : Timeframe value in minutes min_val (float) : Minimum expected minutes max_val (float) : Maximum expected minutes Returns: Color based on position between min_val and max_val ------------------------------------------------------------ TFColorGradientEx(tf_val, min_val, mid_val, max_val, low_color, mid_color, high_color) Extended customizable timeframe gradient Parameters: tf_val (float) : Timeframe value in minutes min_val (float) : Minimum minutes mid_val (float) : Middle minutes max_val (float) : Maximum minutes low_color (color) : Color at min_val mid_color (color) : Color at mid_val high_color (color) : Color at max_val Returns: Color determined by TF position ------------------------------------------------------------ demoTable(tf_arr, show_arr, dashboard_position, horizontal_table, show_header) Creates a demo table for testing TF arrays Parameters: tf_arr (array) : Array of TF strings show_arr (array) : Array of bools to show TFs dashboard_position (string) : Position string horizontal_table (bool) : true=horizontal, false=vertical show_header (bool) : Show header rowBiblioteca Pine Script®por pGONZOActualizado 0
Mirpapa_Lib_SumBoxLibrary "Mirpapa_Lib_SumBox" CreateSumCandleStates() CreateSumCandleStates @desc Creates a set of sum candle state strings. Returns (SumCandleStates): State string set (pending, confirmed, completed) Returns: SumCandleStates state string set CreateSumCandleData(sumOpen, sumHigh, sumLow, sumClose, sumStartTime, sumEndTime, sumHighTime, sumLowTime, state) CreateSumCandleData @desc Creates sum candle data (factory function). sumOpen (float): Sum open price sumHigh (float): Sum high price sumLow (float): Sum low price sumClose (float): Sum close price sumStartTime (int): Sum start time (milliseconds) sumEndTime (int): Sum end time (milliseconds) sumHighTime (int): High point occurrence time (milliseconds) sumLowTime (int): Low point occurrence time (milliseconds) state (string): State (pending/confirmed/completed) Returns (SumCandleData): Created sum candle data Parameters: sumOpen (float): (float) Sum open price sumHigh (float): (float) Sum high price sumLow (float): (float) Sum low price sumClose (float): (float) Sum close price sumStartTime (int): (int) Sum start time sumEndTime (int): (int) Sum end time sumHighTime (int): (int) High point occurrence time sumLowTime (int): (int) Low point occurrence time state (string): (string) State Returns: SumCandleData Created sum candle data ValidateSumCandleData(sumData, confirmedState) ValidateSumCandleData @desc Validates sum candle data. sumData (SumCandleData): Sum candle data to validate confirmedState (string): CONFIRMED state string Returns ( ): Parameters: sumData (SumCandleData): (SumCandleData) Sum candle data to validate confirmedState (string): (string) CONFIRMED state string Returns: CanConfirmSumCandle(sumData, pendingState, confirmedState, completedState) CanConfirmSumCandle @desc Validates whether a sum candle can be confirmed. sumData (SumCandleData): Sum candle data to confirm pendingState (string): PENDING state string confirmedState (string): CONFIRMED state string completedState (string): COMPLETED state string Returns ( ): Parameters: sumData (SumCandleData): (SumCandleData) Sum candle data to confirm pendingState (string): (string) PENDING state string confirmedState (string): (string) CONFIRMED state string completedState (string): (string) COMPLETED state string Returns: UpdateSumCandleState(sumData, newState, pendingState, confirmedState, completedState) UpdateSumCandleState @desc Updates the state of a sum candle (includes validation). sumData (SumCandleData): Sum candle data to update newState (string): New state pendingState (string): PENDING state string confirmedState (string): CONFIRMED state string completedState (string): COMPLETED state string Returns ( ): Parameters: sumData (SumCandleData): (SumCandleData) Sum candle data to update newState (string): (string) New state pendingState (string): (string) PENDING state string confirmedState (string): (string) CONFIRMED state string completedState (string): (string) COMPLETED state string Returns: CreateSumCandleBox(sumOpen, sumClose, sumStartTime, endTime, bullColor, bearColor, borderColor, borderWidth) CreateSumCandleBox @desc Creates a sum candle body box. sumOpen (float): Sum open price sumClose (float): Sum close price sumStartTime (int): Sum start time (milliseconds) endTime (int): Sum end time (milliseconds) bullColor (color): Bullish candle color bearColor (color): Bearish candle color borderColor (color): Border color borderWidth (int): Border width (1-5) Returns (box): Created body box Parameters: sumOpen (float): (float) Sum open price sumClose (float): (float) Sum close price sumStartTime (int): (int) Sum start time endTime (int): (int) Sum end time bullColor (color): (color) Bullish candle color bearColor (color): (color) Bearish candle color borderColor (color): (color) Border color borderWidth (int): (int) Border width Returns: box Body box CreateSumCandleLine(x, y1, y2, lineColor, lineWidth) CreateSumCandleLine @desc Creates a sum candle wick line. x (int): Line x coordinate (time, milliseconds) y1 (float): Line start y coordinate (price) y2 (float): Line end y coordinate (price) lineColor (color): Line color lineWidth (int): Line width (1-5) Returns (line): Created wick line Parameters: x (int): (int) Line x coordinate (time) y1 (float): (float) Line start y coordinate y2 (float): (float) Line end y coordinate lineColor (color): (color) Line color lineWidth (int): (int) Line width Returns: line Wick line DeleteSumCandleVisuals(sumData) DeleteSumCandleVisuals @desc Deletes visualization objects (boxes, lines) of a sum candle. sumData (SumCandleData): Sum candle data to delete Returns (void): No return value Parameters: sumData (SumCandleData): (SumCandleData) Sum candle data to delete Returns: void GetBodyBounds(sumOpen, sumClose) GetBodyBounds @desc Calculates the top and bottom boundaries of the body. sumOpen (float): Sum open price sumClose (float): Sum close price Returns ( ): Parameters: sumOpen (float): (float) Sum open price sumClose (float): (float) Sum close price Returns: ManageMemory(sumArray, maxSize) ManageMemory @desc Manages array size and deletes old data. sumArray (array): Sum candle array to manage maxSize (int): Maximum size Returns (void): No return value Parameters: sumArray (array): (array) Sum candle array to manage maxSize (int): (int) Maximum size Returns: void IsSingleCandle(sumData) IsSingleCandle @desc Checks if it's a sum consisting of only one candle. sumData (SumCandleData): Sum candle data to check Returns (bool): true if single candle, false otherwise Parameters: sumData (SumCandleData): (SumCandleData) Sum candle data to check Returns: bool Single candle status CalculateWickCenterTime(startTime, endTime) CalculateWickCenterTime @desc Calculates the center time where the wick will be displayed. startTime (int): Sum start time (milliseconds) endTime (int): Sum end time (milliseconds) Returns (int): Center time (milliseconds) Parameters: startTime (int): (int) Sum start time endTime (int): (int) Sum end time Returns: int Center time SumCandleStates Fields: pending (series string) confirmed (series string) completed (series string) SumCandleData Fields: _open (series float) _high (series float) _low (series float) _close (series float) _startTime (series int) _endTime (series int) _highTime (series int) _lowTime (series int) _isBull (series bool) _state (series string) _boxBody (series box) _wickHigh (series line) _wickLow (series line)Biblioteca Pine Script®por goodia0
smaemarvwapClaireLibrary "smaemarvwapClaire" repeat_character(count) Parameters: count (int) f_1_k_line_width() is_price_in_merge_range(p1, p2, label_merge_range) Parameters: p1 (float) p2 (float) label_merge_range (float) get_pre_label_string(kc, t, is_every) Parameters: kc (VWAP_key_levels_draw_settings) t (int) is_every (bool) f_is_new_period_from_str(str) Parameters: str (string) total_for_time_when(source, days, ma_set) Parameters: source (float) days (int) ma_set (ma_setting) f_calculate_sma_ema_rolling_vwap(src, length, ma_settings) Parameters: src (float) length (simple int) ma_settings (ma_setting) f_calculate_sma_ema_rvwap(ma_settings) Parameters: ma_settings (ma_setting) f_get_ma_pre_label(ma_settings, sma, ema, rolling_vwap) Parameters: ma_settings (ma_setting) sma (float) ema (float) rolling_vwap (float) f_smart_ma_calculation(ma_settings2) Parameters: ma_settings2 (ma_setting) f_calculate_endpoint(start_time, kc, is_every, endp, extend1, extend2, line_label_extend_length) Parameters: start_time (int) kc (VWAP_key_levels_draw_settings) is_every (bool) endp (int) extend1 (bool) extend2 (bool) line_label_extend_length (int) f_single_line_label_fatory(left_point, right_point, line_col, line_width, lines_style_select, labeltext_col, label_text_size, label_array, line_array, label_col, label_text, l1, label1) 根据两个点创建线段和/或标签,并将其添加到对应的数组中 Parameters: left_point (chart.point) : 左侧起点坐标 right_point (chart.point) : 右侧终点坐标 line_col (color) : 线段颜色 line_width (int) : 线段宽度 lines_style_select (string) : 线段样式(实线、虚线等) labeltext_col (color) : 标签文字颜色 label_text_size (string) : 标签文字大小 label_array (array) : 存储标签对象的数组 line_array (array) : 存储线段对象的数组 label_col (color) : 标签背景颜色(默认:半透明色) label_text (string) : 标签文字内容(默认:空字符串) l1 (bool) : 是否创建线段(默认:false) label1 (bool) : 是否创建标签(默认:false) Returns: void f_line_and_label_merge_func(t, data, l_text, kc, is_every, endp, merge_str_map, label_array, line_array, extend1, extend2, line_label_extend_length, label_merge_control, line_width, lines_style_select, label_text_size) Parameters: t (int) data (float) l_text (string) kc (VWAP_key_levels_draw_settings) is_every (bool) endp (int) merge_str_map (map) label_array (array) line_array (array) extend1 (bool) extend2 (bool) line_label_extend_length (int) label_merge_control (bool) line_width (int) lines_style_select (string) label_text_size (string) plot_ohlc(kc, ohlc_data, extend1, extend2, merge_str_map, label_array, line_array, is_every, line_label_extend_length, label_merge_control, line_width, lines_style_select, label_text_size) Parameters: kc (VWAP_key_levels_draw_settings) ohlc_data (bardata) extend1 (bool) extend2 (bool) merge_str_map (map) label_array (array) line_array (array) is_every (bool) line_label_extend_length (int) label_merge_control (bool) line_width (int) lines_style_select (string) label_text_size (string) plot_vwap_keylevels(kc, vwap_data, extend1, extend2, merge_str_map, label_array, line_array, is_every, line_label_extend_length, label_merge_control, line_width, lines_style_select, label_text_size) Parameters: kc (VWAP_key_levels_draw_settings) vwap_data (vwap_snapshot) extend1 (bool) extend2 (bool) merge_str_map (map) label_array (array) line_array (array) is_every (bool) line_label_extend_length (int) label_merge_control (bool) line_width (int) lines_style_select (string) label_text_size (string) plot_vwap_bardata(kc, ohlc_data, vwap_data, extend1, extend2, merge_str_map, label_array, line_array, is_every, line_label_extend_length, label_merge_control, line_width, lines_style_select, label_text_size) Parameters: kc (VWAP_key_levels_draw_settings) ohlc_data (bardata) vwap_data (vwap_snapshot) extend1 (bool) extend2 (bool) merge_str_map (map) label_array (array) line_array (array) is_every (bool) line_label_extend_length (int) label_merge_control (bool) line_width (int) lines_style_select (string) label_text_size (string) f_start_end_total_min(session) Parameters: session (string) f_get_vwap_array(anchor1, data_manager, is_historical) Parameters: anchor1 (string) data_manager (data_manager) is_historical (bool) f_get_bardata_array(anchorh, data_manager, is_historical) Parameters: anchorh (string) data_manager (data_manager) is_historical (bool) vwap_snapshot Fields: t (series int) vwap (series float) upper1 (series float) lower1 (series float) upper2 (series float) lower2 (series float) upper3 (series float) lower3 (series float) VWAP_key_levels_draw_settings Fields: enable (series bool) index (series int) anchor (series string) session (series string) vwap_col (series color) bands_col (series color) bg_color (series color) text_color (series color) val (series bool) poc (series bool) vah (series bool) enable2x (series bool) enable3x (series bool) o_control (series bool) h_control (series bool) l_control (series bool) c_control (series bool) extend_control (series bool) only_show_the_lastone_control (series bool) bg_control (series bool) line_col_labeltext_col (series color) bardata Fields: o (series float) h (series float) l (series float) c (series float) v (series float) start_time (series int) end_time (series int) ma_setting Fields: day_control (series bool) kline_numbers (series int) ma_color (series color) ema_color (series color) rvwap_color (series color) ma_control (series bool) ema_control (series bool) rvwap_control (series bool) session (series string) merge_label_template Fields: left_point (chart.point) right_point (chart.point) label_text (series string) p (series float) label_color (series color) merge_init_false (series bool) anchor_snapshots Fields: vwap_current (array) vwap_historical (array) bardata_current (array) bardata_historical (array) data_manager Fields: snapshots_map (map) draw_settings_map (map)Biblioteca Pine Script®por Richochet950273
LapseBacktestingTableLibrary "LapseBacktestingMetrics" This library provides a robust set of quantitative backtesting and performance evaluation functions for Pine Script strategies. It’s designed to help traders, quants, and developers assess risk, return, and robustness through detailed statistical metrics — including Sharpe, Sortino, Omega, drawdowns, and trade efficiency. Built to enhance any trading strategy’s evaluation framework, this library allows you to visualize performance with the quantlapseTable() function, producing an interactive on-chart performance table. Credit to EliCobra and BikeLife76 for original concept inspiration. curve(disp_ind) Retrieves a selected performance curve of your strategy. Parameters: disp_ind (simple string): Type of curve to plot. Options include "Equity", "Open Profit", "Net Profit", "Gross Profit". Returns: (float) Corresponding performance curve value. cleaner(disp_ind, plot) Filters and displays selected strategy plots for clean visualization. Parameters: disp_ind (simple string): Type of display. plot (simple float): Strategy plot variable. Returns: (float) Filtered plot value. maxEquityDrawDown() Calculates the maximum equity drawdown during the strategy’s lifecycle. Returns: (float) Maximum equity drawdown percentage. maxTradeDrawDown() Computes the worst intra-trade drawdown among all closed trades. Returns: (float) Maximum intra-trade drawdown percentage. consecutive_wins() Finds the highest number of consecutive winning trades. Returns: (int) Maximum consecutive wins. consecutive_losses() Finds the highest number of consecutive losing trades. Returns: (int) Maximum consecutive losses. no_position() Counts the maximum consecutive bars where no position was held. Returns: (int) Maximum flat days count. long_profit() Calculates total profit generated by long positions as a percentage of initial capital. Returns: (float) Total long profit %. short_profit() Calculates total profit generated by short positions as a percentage of initial capital. Returns: (float) Total short profit %. prev_month() Measures the previous month’s profit or loss based on equity change. Returns: (float) Monthly equity delta. w_months() Counts the number of profitable months in the backtest. Returns: (int) Total winning months. l_months() Counts the number of losing months in the backtest. Returns: (int) Total losing months. checktf() Returns the time-adjusted scaling factor used in Sharpe and Sortino ratio calculations based on chart timeframe. Returns: (float) Annualization multiplier. stat_calc() Performs complete statistical computation including drawdowns, Sharpe, Sortino, Omega, trade stats, and profit ratios. Returns: (array) . f_colors(x, nv) Generates a color gradient for performance values, supporting dynamic table visualization. Parameters: x (simple string): Metric label name. nv (simple float): Metric numerical value. Returns: (color) Gradient color value for table background. quantlapseTable(option, position) Displays an interactive Performance Table summarizing all major backtesting metrics. Includes Sharpe, Sortino, Omega, Profit Factor, drawdowns, profitability %, and trade statistics. Parameters: option (simple string): Table type — "Full", "Simple", or "None". position (simple string): Table position — "Top Left", "Middle Right", "Bottom Left", etc. Returns: (table) On-chart performance visualization table. This library empowers advanced quantitative evaluation directly within Pine Script®, ideal for strategy developers seeking deeper performance diagnostics and intuitive on-chart metrics.Biblioteca Pine Script®por QuantLapse113