HTFStructCore_v2Library "HTFStructCore_v2"
f_structure_from_pivots(phSeries, plSeries)
Parameters:
phSeries (float)
plSeries (float)
f_adx_from_series(plusDMSeries, minusDMSeries, trSeries, adxLen)
Parameters:
plusDMSeries (float)
minusDMSeries (float)
trSeries (float)
adxLen (simple int)
f_retest_triggers(trendRaw, lastHigh, lastLow, retestTol, enableRetest)
Parameters:
trendRaw (int)
lastHigh (float)
lastLow (float)
retestTol (float)
enableRetest (bool)
f_sweep_triggers(trendRaw, sweepLookback, enableSweep)
Parameters:
trendRaw (int)
sweepLookback (int)
enableSweep (bool)
f_risk(lastLow, lastHigh, atrLen, atrStopMult, atrTpMult, preferTightStop)
Parameters:
lastLow (float)
lastHigh (float)
atrLen (simple int)
atrStopMult (float)
atrTpMult (float)
preferTightStop (bool)
Alerts
GATS_LibLibrary "GATS_Lib"
GATS 선물/현물 자동매매를 위한 신호 생성 라이브러리
init(password, exchange, ticker, leverage, start_time, end_time)
Parameters:
password (string)
exchange (string)
ticker (string)
leverage (int)
start_time (int)
end_time (int)
method entry_long(bot, id, qty, comment)
Namespace types: Bot
Parameters:
bot (Bot)
id (string)
qty (float)
comment (string)
method entry_short(bot, id, qty, comment)
Namespace types: Bot
Parameters:
bot (Bot)
id (string)
qty (float)
comment (string)
method close(bot, id, comment)
Namespace types: Bot
Parameters:
bot (Bot)
id (string)
comment (string)
method close_all(bot, comment)
Namespace types: Bot
Parameters:
bot (Bot)
comment (string)
Bot
Fields:
password (series string)
exchange (series string)
ticker (series string)
leverage (series int)
start_time (series int)
end_time (series int)
News2024H1Library "News2024H1" - This contains news events from 2024 H1 News Events
f_loadNewsRows()
f_loadExcSevByTypeId()
f_loadExcTagByTypeId()
NewsTypesLibrary "NewsTypes" Provides the based library for the news system
f_hhmmToMs(_hhmm)
Parameters:
_hhmm (int)
f_addNews(_d, _hhmm, _tid, _dArr, _tArr, _idArr)
Parameters:
_d (string)
_hhmm (int)
_tid (int)
_dArr (array)
_tArr (array)
_idArr (array)
f_addNewsMs(_d, _ms, _tid, _dArr, _tArr, _idArr)
Parameters:
_d (string)
_ms (int)
_tid (int)
_dArr (array)
_tArr (array)
_idArr (array)
f_loadTypeSevByTypeId()
key_level_alerts_libLibrary "key_level_alerts_lib"
shouldFireAlertAbove(level, acceptableRange, filterEnabled)
Detects if price crossed above and closed above a level on this bar
Parameters:
level (float) : The price level to check for cross
acceptableRange (float) : The maximum distance from level for close to be considered valid (used when filterEnabled=true)
filterEnabled (bool) : When true, checks that close is within acceptable range above level
Returns: true if price crossed and closed above the level (optionally within acceptable range)
Detection logic:
Condition A: Opened below level AND closed above level (direct cross up)
Condition B: Opened above level, low touched/dipped to level (low <= level), closed above level
shouldFireAlertBelow(level, acceptableRange, filterEnabled)
Detects if price crossed below and closed below a level on this bar
Parameters:
level (float) : The price level to check for cross
acceptableRange (float) : The maximum distance from level for close to be considered valid (used when filterEnabled=true)
filterEnabled (bool) : When true, checks that close is within acceptable range below level
Returns: true if price crossed and closed below the level (optionally within acceptable range)
Detection logic:
Condition A: Opened above level AND closed below level (direct cross down)
Condition B: Opened below level, high touched/spiked to level (high >= level), closed below level
processAlertAbove(level, acceptableRange, currentState, alertEnabled, filterEnabled)
Process "crossed above" alert for a level - fires alert if transitioning from below/unknown to above
Parameters:
level (float) : The price level to check
acceptableRange (float) : The acceptable range threshold for filtering
currentState (int) : Current alert state (-1=below, 0=unknown, 1=above)
alertEnabled (bool) : Whether the alert is enabled
filterEnabled (bool) : Whether to apply acceptable range filtering
Returns: tuple where newState is updated alert state and shouldFire indicates if alert should trigger
State behavior:
- Alert fires when: state was -1 or 0 AND cross above detected AND alert enabled
- State updates to 1 (above) on any cross above
- State updates to -1 (below) on any cross below (resets for next above alert)
processAlertBelow(level, acceptableRange, currentState, alertEnabled, filterEnabled)
Process "crossed below" alert for a level - fires alert if transitioning from above/unknown to below
Parameters:
level (float) : The price level to check
acceptableRange (float) : The acceptable range threshold for filtering
currentState (int) : Current alert state (-1=below, 0=unknown, 1=above)
alertEnabled (bool) : Whether the alert is enabled
filterEnabled (bool) : Whether to apply acceptable range filtering
Returns: tuple where newState is updated alert state and shouldFire indicates if alert should trigger
State behavior:
- Alert fires when: state was 1 or 0 AND cross below detected AND alert enabled
- State updates to -1 (below) on any cross below
- State updates to 1 (above) on any cross above (resets for next below alert)
calculateAcceptableRange(atrValue, acceptableRangePct)
Calculates the acceptable range threshold for alert filtering based on ATR
Parameters:
atrValue (float) : The daily ATR value
acceptableRangePct (float) : The acceptable range percentage (e.g., 85 for 85%)
Returns: The acceptable range threshold in price units
Calculation: oneFullLevel = ATR × 0.24 (24% of daily ATR = one standard key level spacing)
acceptableRange = (acceptableRangePct / 100) × oneFullLevel
getAlertLabelTextSize(sizeStr)
Converts a size string to Pine Script size constant for labels
Parameters:
sizeStr (string) : The size string ("tiny", "small", "normal", "large", "huge")
Returns: The corresponding Pine Script size constant
MK_FractalLibrary "MK_Fractal"
ResCal(price, degree)
Parameters:
price (float)
degree (float)
SupCal(price, degree)
Parameters:
price (float)
degree (float)
CalcAllLevels(price)
Parameters:
price (float)
FindNearestLevel(current_price, resistances, supports)
Parameters:
current_price (float)
resistances (array)
supports (array)
IsTouchSupport(current_price, supports, tolerance_pct)
Parameters:
current_price (float)
supports (array)
tolerance_pct (float)
IsTouchResistance(current_price, resistances, tolerance_pct)
Parameters:
current_price (float)
resistances (array)
tolerance_pct (float)
GetLevelByDegree(price, degree)
Parameters:
price (float)
degree (float)
GetFormattedLevels(price)
Parameters:
price (float)
OrderlyWebhookJSONLibrary "OrderlyWebhookJSON"
Orderly 거래소 자동 거래를 위한 JSON Webhook 메시지 생성 라이브러리. Market/Limit 주문, TP/SL 설정, Percent/Absolute 수량 지정 등을 지원합니다.
createMarketOrder(symbol, leverage, side, position, quantity_type, quantity, tp_type, tp_value, sl_type, sl_value)
Market 주문 JSON 생성 (TP/SL 포함)
Parameters:
symbol (string) : 거래 심볼 (예: "BTCUSDT")
leverage (float) : 레버리지 배율 (예: 10)
side (string) : "Long" 또는 "Short"
position (string) : "Open" 또는 "Close"
quantity_type (string) : "Percent" 또는 "Absolute"
quantity (float) : 수량 값 (Percent인 경우 0-100, Absolute인 경우 실제 수량)
tp_type (string) : "percent" 또는 "price"
tp_value (float) : TP 값 (percent인 경우 퍼센트, price인 경우 절대가격)
sl_type (string) : "percent" 또는 "price"
sl_value (float) : SL 값 (percent인 경우 퍼센트, price인 경우 절대가격)
Returns: JSON 형식 문자열
createLimitOrder(symbol, leverage, side, position, limit_price, quantity_type, quantity, tp_type, tp_value, sl_type, sl_value)
Limit 주문 JSON 생성 (TP/SL 포함)
Parameters:
symbol (string) : 거래 심볼 (예: "BTCUSDT")
leverage (float) : 레버리지 배율 (예: 10)
side (string) : "Long" 또는 "Short"
position (string) : "Open" 또는 "Close"
limit_price (float) : Limit 주문 가격
quantity_type (string) : "Percent" 또는 "Absolute"
quantity (float) : 수량 값 (Percent인 경우 0-100, Absolute인 경우 실제 수량)
tp_type (string) : "percent" 또는 "price"
tp_value (float) : TP 값 (percent인 경우 퍼센트, price인 경우 절대가격)
sl_type (string) : "percent" 또는 "price"
sl_value (float) : SL 값 (percent인 경우 퍼센트, price인 경우 절대가격)
Returns: JSON 형식 문자열
createSimpleMarketOrder(symbol, leverage, side, position, quantity_type, quantity)
Market 주문 JSON 생성 (TP/SL 없음 - 간단 버전)
Parameters:
symbol (string) : 거래 심볼 (예: "BTCUSDT")
leverage (float) : 레버리지 배율 (예: 10)
side (string) : "Long" 또는 "Short"
position (string) : "Open" 또는 "Close"
quantity_type (string) : "Percent" 또는 "Absolute"
quantity (float) : 수량 값
Returns: JSON 형식 문자열
createSimpleLimitOrder(symbol, leverage, side, position, limit_price, quantity_type, quantity)
Limit 주문 JSON 생성 (TP/SL 없음 - 간단 버전)
Parameters:
symbol (string) : 거래 심볼 (예: "BTCUSDT")
leverage (float) : 레버리지 배율 (예: 10)
side (string) : "Long" 또는 "Short"
position (string) : "Open" 또는 "Close"
limit_price (float) : Limit 주문 가격
quantity_type (string) : "Percent" 또는 "Absolute"
quantity (float) : 수량 값
Returns: JSON 형식 문자열
createClosePosition(symbol, side, quantity_type, quantity)
포지션 종료 전용 JSON 생성
Parameters:
symbol (string) : 거래 심볼 (예: "BTCUSDT")
side (string) : "Long" 또는 "Short" (종료할 포지션의 반대 방향)
quantity_type (string) : "Percent" 또는 "Absolute"
quantity (float) : 수량 값 (Percent 100 = 전체 종료)
Returns: JSON 형식 문자열
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)
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)
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)
3 EMA with Alerts 2025This indicator plots three key EMAs (20, 50, and 200) directly on the chart, making it easy to track short-, medium-, and long-term trends. A color-coded table is displayed in the top-right corner for quick reference.
The script also includes smart alerts that trigger only when the state changes:
• 🔵 EMA 20 crossing above EMA 50 & EMA 200 → Bullish signal
• 🔴 EMA 20 crossing below EMA 50 & EMA 200 → Bearish signal
This tool is designed for traders who want clean visuals, reliable alerts, and simplified trend recognition in 2025 markets.
tgpFibonacciLib_v2Library "tgpFibonacciLib_v2"
getFib(tf, ratio)
Parameters:
tf (string)
ratio (float)
getGoldenPocket(tf)
Parameters:
tf (string)
getMonthlyFib(ratio)
Parameters:
ratio (float)
getWeeklyFib(ratio)
Parameters:
ratio (float)
getYestFib(ratio)
Parameters:
ratio (float)
AdjCloseLibLibrary "AdjCloseLib"
Library for producing gap-adjusted price series that removes intraday gaps at market open
get_adj_close(_gapThresholdPct)
Calculates gap-adjusted close price by detecting and removing gaps at market open (09:15)
Parameters:
_gapThresholdPct (float) : Minimum gap size (in percentage) required to trigger adjustment. Example: 0.5 for 0.5%
Returns: Adjusted close price for the current bar (always returns a numeric value, never na)
@details Detects gaps by comparing 09:15 open with previous day's close. If gap exceeds threshold,
subtracts the gap value from all bars between 09:15-15:29 inclusive. State resets after session close.
get_adj_ohlc(_gapThresholdPct)
Calculates gap-adjusted OHLC values by subtracting detected gap from all price components
Parameters:
_gapThresholdPct (float) : Minimum gap size (in percentage) required to trigger adjustment. Example: 0.5 for 0.5%
Returns: Tuple of
@details Useful for calculating indicators (ATR, Heikin-Ashi, etc.) on gap-adjusted data.
Applies the same gap adjustment logic to all OHLC components simultaneously.
AI Bot Regime Feed (v6) — stableThis indicator generates real-time, structured JSON alerts for external trading bots or automation systems.
It combines multiple technical layers to identify market regimes and high-probability buy/sell events, and sends them to any webhook endpoint (e.g., a FastAPI or Zapier listener).
phx_liq_tlLibrary "phx_liq_tl"
new_state()
update(st, len, cup, cdn, space, proximity_pct, shs)
Parameters:
st (LTState)
len (int)
cup (color)
cdn (color)
space (float)
proximity_pct (float)
shs (bool)
LTState
Fields:
upln (array)
dnln (array)
upBroken (series bool)
dnBroken (series bool)
phx_kroLibrary "phx_kro"
compute(src, bandwidth, bbwidth, sdLook, sdMult, obos_mult)
Parameters:
src (float)
bandwidth (int)
bbwidth (float)
sdLook (int)
sdMult (float)
obos_mult (float)
start_flags(src, bandwidth, bbwidth)
Parameters:
src (float)
bandwidth (int)
bbwidth (float)
KROFeed
Fields:
Wave (series float)
is_green (series bool)
is_red (series bool)
band_width (series float)
band_width_sma (series float)
band_width_std (series float)
is_hyper_wide (series bool)
wave_sma (series float)
wave_std (series float)
wave_ob_threshold (series float)
wave_os_threshold (series float)
is_overbought (series bool)
is_oversold (series bool)
is_oversold_confirmed (series bool)
is_overbought_confirmed (series bool)
enhanced_os_confirmed (series bool)
enhanced_ob_confirmed (series bool)
triple_green_transition (series bool)
triple_red_transition (series bool)
startwave_bull (series bool)
startwave_bear (series bool)
phx_fvgfvg generator 4h and current time frame
library to import fvg from 4h with midle line and proximity support and resistance
CarolTradeLibLibrary "CarolTradeLib"
f_generateSignalID(strategyName)
Parameters:
strategyName (string)
f_buildJSON(orderType, action, symbol, price, strategyName, apiKey, additionalFields, indicatorJSON)
Parameters:
orderType (string)
action (string)
symbol (string)
price (float)
strategyName (string)
apiKey (string)
additionalFields (string)
indicatorJSON (string)
sendSignal(action, symbol, price, strategyName, apiKey, indicatorJSON)
Parameters:
action (string)
symbol (string)
price (float)
strategyName (string)
apiKey (string)
indicatorJSON (string)
marketOrder(action, symbol, price, strategyName, apiKey, stopLoss, takeProfit, rrRatio, size, indicatorJSON)
Parameters:
action (string)
symbol (string)
price (float)
strategyName (string)
apiKey (string)
stopLoss (float)
takeProfit (float)
rrRatio (float)
size (float)
indicatorJSON (string)
limitOrder(action, symbol, price, strategyName, apiKey, limitPrice, size, indicatorJSON)
Parameters:
action (string)
symbol (string)
price (float)
strategyName (string)
apiKey (string)
limitPrice (float)
size (float)
indicatorJSON (string)
stopLimitOrder(action, symbol, price, strategyName, apiKey, stopPrice, limitPrice, size, indicatorJSON)
Parameters:
action (string)
symbol (string)
price (float)
strategyName (string)
apiKey (string)
stopPrice (float)
limitPrice (float)
size (float)
indicatorJSON (string)
AlertSenderLibrary_TradingFinderLibrary "AlertSenderLibrary_TradingFinder"
TODO: add library description here
AlertSender(Condition, Alert, AlertName, AlertType, DetectionType, SetupData, Frequncy, UTC, MoreInfo, Message, o, h, l, c, Entry, TP, SL, Distal, Proximal)
Parameters:
Condition (bool)
Alert (string)
AlertName (string)
AlertType (string)
DetectionType (string)
SetupData (string)
Frequncy (string)
UTC (string)
MoreInfo (string)
Message (string)
o (float)
h (float)
l (float)
c (float)
Entry (float)
TP (float)
SL (float)
Distal (float)
Proximal (float)
GoldenCrossLibrary "GoldenCross"
get_signals(short_len, long_len)
Parameters:
short_len (int)
long_len (int)






















