本页源码来自 TradingView 公开发布的开源脚本,版权归原作者所有, 请遵循其原始许可(Pine 脚本常见 CC BY-NC-SA / MPL-2.0 / MIT)。 本项目仅用于研究检索与许可范围内的移植。
//@version=6
//@description K1 compact transport v1 for Swing v14.30. Preserves the complete v6 K1 dataset using compact arrays, with historical HTF preload, so one K1 alert remains safely below TradingView message limits.
library("K1TelemetryCompact", overlay=false, dynamic_requests=true)
// K1 telemetry library. No trading authority lives in this library.
// The importing Swing indicator remains the sole source of BUY/SELL and trade-plan levels.
export type Engine
string v146PrimaryStage
float v146Atr
float v146NormCloseReturn
float v146DcMode
float v146DcExtreme
float v146TurnUpOriginLow
float v146TurnDownOriginHigh
float v146FastArm
float v146QualityArm
float v146FastCusumPos
float v146FastCusumNeg
float v146QualityCusumPos
float v146QualityCusumNeg
float v146M2LastPivotHigh
float v146M2LastPivotLow
float v146FastState
float v146QualityState
float v146MainSignalState
float v146ProtectedDir
float v146ProtectedPendingFastDir
float v146OldTrendPendingDir
float v146TrendFast
float v146TrendSlow
float v146SoftTrendState
float v146SoftBullStreak
float v146SoftBearStreak
float v146SoftNeutralStreak
float v146HardState
float v146HardBullStreak
float v146HardBearStreak
float v146DiPlus
float v146DiMinus
float v146Adx
float v146Efficiency
float v146MaSeparationAtr
float v146SlowSlopeSignedAtr
float v146FlipCount
float v146ChopVotes
bool v146TurnUp
bool v146TurnDown
bool v146FastCusumUpNow
bool v146FastCusumDownNow
bool v146QualityCusumUpNow
bool v146QualityCusumDownNow
bool v146FastSeenCusum
bool v146QualitySeenCusum
bool v146M2PivotHighConfirmedNow
bool v146M2PivotLowConfirmedNow
bool v146M2BreakUpNow
bool v146M2BreakDownNow
bool v146FastSeenM2
bool v146QualitySeenM2
bool v146FastUpNow
bool v146FastDownNow
bool v146QualityUpNow
bool v146QualityDownNow
bool v146BaseBuyNow
bool v146BaseSellNow
bool v146PrimaryBuy
bool v146PrimarySell
bool v146RawTrendBull
bool v146RawTrendBear
bool v146RawTrendNeutral
bool v146HardBullCandidate
bool v146HardBearCandidate
bool v146HardUpNow
bool v146HardDownNow
bool v146NoTradeState
bool v146HardBullDirectional
bool v146HardBearDirectional
bool v146ExceptionalBull
bool v146ExceptionalBear
export type ContextScore
float bullScore
float bearScore
float rsiRaw
float rsiBullLTF
float rsiBearLTF
float qqeBullLTF
float qqeBearLTF
float obvBull
float obvBear
float volBull
float volBear
float macdBull
float macdBear
float candleBull
float candleBear
float srScoreBull
float srScoreBear
export type Structure
float support
float resistance
float srSupportTouches
float srResistanceTouches
float srSupportSpan
float srResistanceSpan
float v1429SrLookbackEff
float v1429TlLookbackEff
float tlMinTouches
float retestSupport
float retestResistance
float res_tl_y
float sup_tl_y
float smsUp
float smsDn
float smsPos
float v146SDemandTop
float v146SDemandBottom
float v146SSupplyTop
float v146SSupplyBottom
float domResOldT
float domResOldY
float domResNewT
float domResNewY
float domResOldB
float domResNewB
float domResTouches
float domSupOldT
float domSupOldY
float domSupNewT
float domSupNewY
float domSupOldB
float domSupNewB
float domSupTouches
float developing_res_tl
float developing_sup_tl
float tlFlipSupportLine
float tlFlipResistanceLine
float flipSupportPrice
float flipResistancePrice
bool isNearSupport
bool isNearResistance
bool trend_break_up
bool trend_break_dn
bool trend_retest_up
bool trend_retest_dn
bool smsChochUp
bool smsChochDn
bool smsSmsUp
bool smsSmsDn
bool smsBmsUp
bool smsBmsDn
bool v146SDemandActive
bool v146SSupplyActive
bool tlUpActive
bool tlDnActive
export type Options
float v146SlowReleaseBufferAtr
float v146Q11AtrMult
float v1429T1CapR
float eqhLvl
float eqlLvl
float volSMA
bool v146ProtectEstablished
bool v146GateAgainstOldTrend
bool showRSIGame
bool showMACDDiv
bool showOBVFilter
bool showVolumeGame
bool showQQEFilter
bool showCandleScanner
bool v1429UseT1OpportunityCap
bool bslSweep
bool sslSweep
bool bslReclaim
bool sslReclaim
bool bullTrap
bool bearTrap
bool springBull
bool springBear
bool isSOS
bool isSOW
bool volCheck
type H4
int t
int tc
float o
float h
float l
float c
float v
float atr
float ema50
float ema100
float rsi
int pt
int ptc
float po
float ph
float pl
float pc
float pv
float patr
float pema50
float pema100
float prsi
type HTFSnap
int t
float c
float atr
float ema17
float ema20
float ema50
float ema100
float ema200
float rsi
// Higher-timeframe request results remain internal to the library.
// The importing indicator receives one string fragment instead of an exported UDT.
// This preserves every HTF value while avoiding cross-library UDT declaration issues.
_jn(float x) => na(x) ? "null" : str.tostring(x, "#.########")
_ji(float x) => na(x) ? "null" : str.tostring(int(x))
_jb(bool x) => x ? "true" : "false"
_js(string x) =>
string y = str.replace_all(x, "\\", "\\\\")
y := str.replace_all(y, "\"", "\\\"")
y := str.replace_all(y, "\n", "\\n")
y := str.replace_all(y, "\r", "\\r")
y := str.replace_all(y, "\t", "\\t")
"\"" + y + "\""
_history(int requested) =>
int count = math.min(math.max(requested, 1), bar_index + 1)
string out = "["
if count > 0
for j = 0 to count - 1
int i = count - 1 - j
string row = "[" + _ji(time[i]) + "," + _ji(time_close[i]) + "," + _jn(open[i]) + "," + _jn(high[i]) + "," + _jn(low[i]) + "," + _jn(close[i]) + "," + _jn(volume[i]) + "]"
out := out + (j == 0 ? "" : ",") + row
out + "]"
_trace(Engine e, ContextScore c, Structure s, int requested) =>
int count = math.min(math.max(requested, 1), bar_index + 1)
string out = "["
if count > 0
for j = 0 to count - 1
int i = count - 1 - j
Engine he = e[i]
ContextScore hc = c[i]
Structure hs = s[i]
string row = "[" + _ji(time[i]) + "," + _jn(he.v146NormCloseReturn) + "," + str.tostring(he.v146DcMode) + "," + _jb(he.v146TurnUp) + "," + _jb(he.v146TurnDown) + "," + str.tostring(he.v146FastState) + "," + str.tostring(he.v146QualityState) + "," + _jn(he.v146FastCusumPos) + "," + _jn(he.v146FastCusumNeg) + "," + _jn(he.v146QualityCusumPos) + "," + _jn(he.v146QualityCusumNeg) + "," + _jb(he.v146FastSeenCusum) + "," + _jb(he.v146QualitySeenCusum) + "," + _jn(he.v146M2LastPivotHigh) + "," + _jn(he.v146M2LastPivotLow) + "," + _jb(he.v146M2BreakUpNow) + "," + _jb(he.v146M2BreakDownNow) + "," + _jb(he.v146FastSeenM2) + "," + _jb(he.v146QualitySeenM2) + "," + str.tostring(he.v146SoftTrendState) + "," + str.tostring(he.v146HardState) + "," + _jn(he.v146Adx) + "," + _jn(he.v146Efficiency) + "," + str.tostring(hc.bullScore) + "," + str.tostring(hc.bearScore) + "," + _jn(hs.support) + "," + _jn(hs.resistance) + "," + _jb(hs.isNearSupport) + "," + _jb(hs.isNearResistance) + "," + _jb(he.v146PrimaryBuy) + "," + _jb(he.v146PrimarySell) + "]"
out := out + (j == 0 ? "" : ",") + row
out + "]"
_h4_request() =>
request.security(syminfo.tickerid, "240", H4.new(time, time_close, open, high, low, close, volume, ta.atr(14), ta.ema(close, 50), ta.ema(close, 100), ta.rsi(close, 14), time[1], time_close[1], open[1], high[1], low[1], close[1], volume[1], ta.atr(14)[1], ta.ema(close, 50)[1], ta.ema(close, 100)[1], ta.rsi(close, 14)[1]), gaps=barmerge.gaps_off, lookahead=barmerge.lookahead_off)
_htf_snap(string tf) =>
request.security(syminfo.tickerid, tf, HTFSnap.new(time[1], close[1], ta.atr(14)[1], ta.ema(close, 17)[1], ta.ema(close, 20)[1], ta.ema(close, 50)[1], ta.ema(close, 100)[1], ta.ema(close, 200)[1], ta.rsi(close, 14)[1]), gaps=barmerge.gaps_off, lookahead=barmerge.lookahead_on)
_h4_row_current(H4 x) =>
"[" + _ji(x.t) + "," + _ji(x.tc) + "," + _jn(x.o) + "," + _jn(x.h) + "," + _jn(x.l) + "," + _jn(x.c) + "," + _jn(x.v) + "," + _jn(x.atr) + "," + _jn(x.ema50) + "," + _jn(x.ema100) + "," + _jn(x.rsi) + "]"
_h4_row_previous(H4 x) =>
"[" + _ji(x.pt) + "," + _ji(x.ptc) + "," + _jn(x.po) + "," + _jn(x.ph) + "," + _jn(x.pl) + "," + _jn(x.pc) + "," + _jn(x.pv) + "," + _jn(x.patr) + "," + _jn(x.pema50) + "," + _jn(x.pema100) + "," + _jn(x.prsi) + "]"
_h4_compact(H4 x) =>
float chartTfSeconds = timeframe.in_seconds(timeframe.period)
bool developing = not na(x.tc) and chartTfSeconds < 14400 and time_close < x.tc
"[" + _jb(developing) + "," + _h4_row_current(x) + "," + _h4_row_previous(x) + "]"
_htf_row(HTFSnap x) =>
"[" + _ji(x.t) + "," + _jn(x.c) + "," + _jn(x.atr) + "," + _jn(x.ema17) + "," + _jn(x.ema20) + "," + _jn(x.ema50) + "," + _jn(x.ema100) + "," + _jn(x.ema200) + "," + _jn(x.rsi) + "]"
//@function Preloads all K1 external datasets on every historical/realtime execution.
//@returns Compact JSON fragment for 4H current/previous and confirmed 6H/8H/1D/1W.
export preload() =>
H4 h4 = _h4_request()
HTFSnap h6 = _htf_snap("360")
HTFSnap h8 = _htf_snap("480")
HTFSnap d1 = _htf_snap("1D")
HTFSnap w1 = _htf_snap("1W")
"\"h4\":" + _h4_compact(h4) + ",\"htf\":[" + _htf_row(h6) + "," + _htf_row(h8) + "," + _htf_row(d1) + "," + _htf_row(w1) + "]"
//@function Builds a lossless compact representation of k1_signal_context_v6.
//@returns k1_signal_context_compact_v1 JSON. Backend expands it back to v6 before K1 review.
export compact(Engine e, ContextScore c, Structure s, Options o, string htfFragment, int _eventTimestamp) =>
int _barsSent = math.min(180, bar_index + 1)
int _traceBars = math.min(24, bar_index + 1)
float _preMainSignalState = nz((e[1]).v146MainSignalState, 0)
float _preProtectedDir = nz((e[1]).v146ProtectedDir, 0)
float _preProtectedPendingFastDir = nz((e[1]).v146ProtectedPendingFastDir, 0)
float _preOldTrendPendingDir = nz((e[1]).v146OldTrendPendingDir, 0)
bool _slowReleaseBullNow = close > e.v146TrendSlow + e.v146Atr * o.v146SlowReleaseBufferAtr and not e.v146HardBearDirectional
bool _slowReleaseBearNow = close < e.v146TrendSlow - e.v146Atr * o.v146SlowReleaseBufferAtr and not e.v146HardBullDirectional
float _resTlSlope = not na(s.domResOldB) and not na(s.domResNewB) and s.domResNewB != s.domResOldB ? (s.domResNewY - s.domResOldY) / (s.domResNewB - s.domResOldB) : na
float _supTlSlope = not na(s.domSupOldB) and not na(s.domSupNewB) and s.domSupNewB != s.domSupOldB ? (s.domSupNewY - s.domSupOldY) / (s.domSupNewB - s.domSupOldB) : na
float _resTlSlopeAtr = not na(_resTlSlope) ? _resTlSlope / math.max(e.v146Atr, syminfo.mintick) : na
float _supTlSlopeAtr = not na(_supTlSlope) ? _supTlSlope / math.max(e.v146Atr, syminfo.mintick) : na
float _resTlDistAtr = not na(s.res_tl_y) ? math.abs(close - s.res_tl_y) / math.max(e.v146Atr, syminfo.mintick) : na
float _supTlDistAtr = not na(s.sup_tl_y) ? math.abs(close - s.sup_tl_y) / math.max(e.v146Atr, syminfo.mintick) : na
float _ema17 = ta.ema(close, 17)
float _ema20 = ta.ema(close, 20)
float _ema200 = ta.ema(close, 200)
float _volMean20 = ta.sma(volume, 20)
float _relVolume20 = not na(volume) and not na(_volMean20) and _volMean20 > 0 ? volume / _volMean20 : na
float _bbBasis20 = ta.sma(close, 20)
float _bbDev20 = ta.stdev(close, 20)
float _bbZ20 = not na(_bbDev20) and _bbDev20 > 0 ? (close - _bbBasis20) / _bbDev20 : na
float _cci20 = ta.cci(hlc3, 20)
float _barRange = math.max(high - low, syminfo.mintick)
float _bodyAtr = math.abs(close - open) / math.max(e.v146Atr, syminfo.mintick)
float _closePos = (close - low) / _barRange
string _authorityPath = e.v146PrimaryBuy ? (_preProtectedDir == -1 and _preMainSignalState == -1 ? "PATH_B_PROTECTED_RELEASE" : _preOldTrendPendingDir == 1 ? (e.v146QualityUpNow ? "PATH_A_PENDING_QUALITY" : _slowReleaseBullNow ? "PATH_A_PENDING_SLOW_RELEASE" : "PATH_A_PENDING_PROMOTION") : "PATH_A_DIRECT") : e.v146PrimarySell ? (_preProtectedDir == 1 and _preMainSignalState == 1 ? "PATH_B_PROTECTED_RELEASE" : _preOldTrendPendingDir == -1 ? (e.v146QualityDownNow ? "PATH_A_PENDING_QUALITY" : _slowReleaseBearNow ? "PATH_A_PENDING_SLOW_RELEASE" : "PATH_A_PENDING_PROMOTION") : "PATH_A_DIRECT") : "NO_PRIMARY_SIGNAL"
string _ctx = "{\"schema\":\"k1_signal_context_compact_v1\",\"t\":" + _ji(_eventTimestamp) + ",\"hb\":" + str.tostring(_barsSent) + ",\"tb\":" + str.tostring(_traceBars)
_ctx := _ctx + ",\"m\":[" + _ji(time) + "," + _ji(time_close) + "," + _jn(open) + "," + _jn(high) + "," + _jn(low) + "," + _jn(close) + "," + _jn(volume) + "," + _jn(e.v146Atr) + "," + _jn(_ema17) + "," + _jn(_ema20) + "," + _jn(_ema200) + "," + _jn(_relVolume20) + "," + _jn(_bbZ20) + "," + _jn(_cci20) + "," + _jn(_bodyAtr) + "," + _jn(_closePos) + "]"
_ctx := _ctx + ",\"pe\":[" + _js(e.v146PrimaryStage) + "," + _js(_authorityPath) + "," + str.tostring(e.v146DcMode) + "," + _jn(e.v146DcExtreme) + "," + _jn(e.v146NormCloseReturn) + "," + _jb(e.v146TurnUp) + "," + _jb(e.v146TurnDown) + "," + _jn(e.v146TurnUpOriginLow) + "," + _jn(e.v146TurnDownOriginHigh) + "," + str.tostring(e.v146FastArm) + "," + str.tostring(e.v146QualityArm) + "," + _jb(e.v146FastCusumUpNow) + "," + _jb(e.v146FastCusumDownNow) + "," + _jb(e.v146QualityCusumUpNow) + "," + _jb(e.v146QualityCusumDownNow) + "," + _jn(e.v146FastCusumPos) + "," + _jn(e.v146FastCusumNeg) + "," + _jn(e.v146QualityCusumPos) + "," + _jn(e.v146QualityCusumNeg) + "," + _jb(e.v146FastSeenCusum) + "," + _jb(e.v146QualitySeenCusum) + "," + _jn(e.v146M2LastPivotHigh) + "," + _jn(e.v146M2LastPivotLow) + "," + _jb(e.v146M2PivotHighConfirmedNow) + "," + _jb(e.v146M2PivotLowConfirmedNow) + "," + _jb(e.v146M2BreakUpNow) + "," + _jb(e.v146M2BreakDownNow) + "," + _jb(e.v146FastSeenM2) + "," + _jb(e.v146QualitySeenM2) + "," + _jb(e.v146FastUpNow) + "," + _jb(e.v146FastDownNow) + "," + _jb(e.v146QualityUpNow) + "," + _jb(e.v146QualityDownNow) + "," + str.tostring(e.v146FastState) + "," + str.tostring(e.v146QualityState) + "," + _jb(e.v146BaseBuyNow) + "," + _jb(e.v146BaseSellNow) + "," + str.tostring(_preMainSignalState) + "," + str.tostring(_preProtectedDir) + "," + str.tostring(_preProtectedPendingFastDir) + "," + str.tostring(_preOldTrendPendingDir) + "," + _jb(_slowReleaseBullNow) + "," + _jb(_slowReleaseBearNow) + "," + _jb(e.v146PrimaryBuy) + "," + _jb(e.v146PrimarySell) + "]"
_ctx := _ctx + ",\"tr\":[" + _jn(e.v146TrendFast) + "," + _jn(e.v146TrendSlow) + "," + _jb(e.v146RawTrendBull) + "," + _jb(e.v146RawTrendBear) + "," + _jb(e.v146RawTrendNeutral) + "," + str.tostring(e.v146SoftTrendState) + "," + str.tostring(e.v146SoftBullStreak) + "," + str.tostring(e.v146SoftBearStreak) + "," + str.tostring(e.v146SoftNeutralStreak) + "," + str.tostring(e.v146HardState) + "," + str.tostring(e.v146HardBullStreak) + "," + str.tostring(e.v146HardBearStreak) + "," + _jb(e.v146HardBullCandidate) + "," + _jb(e.v146HardBearCandidate) + "," + _jb(e.v146HardUpNow) + "," + _jb(e.v146HardDownNow) + "," + _jn(e.v146DiPlus) + "," + _jn(e.v146DiMinus) + "," + _jn(e.v146Adx) + "," + _jn(e.v146Efficiency) + "," + _jn(e.v146MaSeparationAtr) + "," + _jn(e.v146SlowSlopeSignedAtr) + "," + _jn(e.v146FlipCount) + "," + str.tostring(e.v146ChopVotes) + "," + _jb(e.v146NoTradeState) + "," + _jb(e.v146HardBullDirectional) + "," + _jb(e.v146HardBearDirectional) + "," + _jb(e.v146ExceptionalBull) + "," + _jb(e.v146ExceptionalBear) + "]"
_ctx := _ctx + ",\"cs\":[" + str.tostring(c.bullScore) + "," + str.tostring(c.bearScore) + "," + _jn(c.rsiRaw) + "," + str.tostring(c.rsiBullLTF) + "," + str.tostring(c.rsiBearLTF) + "," + str.tostring(c.qqeBullLTF) + "," + str.tostring(c.qqeBearLTF) + "," + str.tostring(c.obvBull) + "," + str.tostring(c.obvBear) + "," + str.tostring(c.volBull) + "," + str.tostring(c.volBear) + "," + str.tostring(c.macdBull) + "," + str.tostring(c.macdBear) + "," + str.tostring(c.candleBull) + "," + str.tostring(c.candleBear) + "," + str.tostring(c.srScoreBull) + "," + str.tostring(c.srScoreBear) + "]"
_ctx := _ctx + ",\"st\":[" + _jn(s.support) + "," + _jn(s.resistance) + "," + str.tostring(s.srSupportTouches) + "," + str.tostring(s.srResistanceTouches) + "," + str.tostring(s.srSupportSpan) + "," + str.tostring(s.srResistanceSpan) + "," + str.tostring(s.v1429SrLookbackEff) + "," + str.tostring(s.v1429TlLookbackEff) + "," + str.tostring(s.tlMinTouches) + "," + _jb(s.isNearSupport) + "," + _jb(s.isNearResistance) + "," + _jn(s.retestSupport) + "," + _jn(s.retestResistance) + "," + _jn(s.res_tl_y) + "," + _jn(s.sup_tl_y) + "," + _jb(s.trend_break_up) + "," + _jb(s.trend_break_dn) + "," + _jb(s.trend_retest_up) + "," + _jb(s.trend_retest_dn) + "," + _jn(s.smsUp) + "," + _jn(s.smsDn) + "," + str.tostring(s.smsPos) + "," + _jb(s.smsChochUp) + "," + _jb(s.smsChochDn) + "," + _jb(s.smsSmsUp) + "," + _jb(s.smsSmsDn) + "," + _jb(s.smsBmsUp) + "," + _jb(s.smsBmsDn) + "," + _jb(s.v146SDemandActive) + "," + _jn(s.v146SDemandTop) + "," + _jn(s.v146SDemandBottom) + "," + _jb(s.v146SSupplyActive) + "," + _jn(s.v146SSupplyTop) + "," + _jn(s.v146SSupplyBottom) + "]"
_ctx := _ctx + ",\"rg\":[" + _ji(s.domResOldT) + "," + _jn(s.domResOldY) + "," + _ji(s.domResNewT) + "," + _jn(s.domResNewY) + "," + str.tostring(s.domResTouches) + "," + (not na(s.domResOldB) and not na(s.domResNewB) ? str.tostring(math.max(s.domResNewB - s.domResOldB, 0)) : "null") + "," + _jb(not na(s.res_tl_y)) + "," + _jb(not na(s.developing_res_tl)) + "," + _jb(not na(s.tlFlipSupportLine)) + "," + _jn(_resTlSlopeAtr) + "," + _jn(s.res_tl_y) + "," + _jn(_resTlDistAtr) + "," + _jb(s.trend_break_up) + "," + _jb(s.trend_retest_up) + "," + _jb(s.tlUpActive) + "]"
_ctx := _ctx + ",\"sg\":[" + _ji(s.domSupOldT) + "," + _jn(s.domSupOldY) + "," + _ji(s.domSupNewT) + "," + _jn(s.domSupNewY) + "," + str.tostring(s.domSupTouches) + "," + (not na(s.domSupOldB) and not na(s.domSupNewB) ? str.tostring(math.max(s.domSupNewB - s.domSupOldB, 0)) : "null") + "," + _jb(not na(s.sup_tl_y)) + "," + _jb(not na(s.developing_sup_tl)) + "," + _jb(not na(s.tlFlipResistanceLine)) + "," + _jn(_supTlSlopeAtr) + "," + _jn(s.sup_tl_y) + "," + _jn(_supTlDistAtr) + "," + _jb(s.trend_break_dn) + "," + _jb(s.trend_retest_dn) + "," + _jb(s.tlDnActive) + "]"
_ctx := _ctx + ",\"fp\":[" + _jn(s.flipSupportPrice) + "," + _jn(s.flipResistancePrice) + "]"
_ctx := _ctx + ",\"lq\":[" + _jn(o.eqhLvl) + "," + _jn(o.eqlLvl) + "," + _jb(o.bslSweep) + "," + _jb(o.sslSweep) + "," + _jb(o.bslReclaim) + "," + _jb(o.sslReclaim) + "," + _jb(o.bullTrap) + "," + _jb(o.bearTrap) + "," + _jb(o.springBull) + "," + _jb(o.springBear) + "," + _jb(o.isSOS) + "," + _jb(o.isSOW) + "," + _jn(o.volSMA) + "," + _jb(o.volCheck) + "]"
_ctx := _ctx + ",\"set\":[" + _js(e.v146PrimaryStage) + "," + _jb(o.v146ProtectEstablished) + "," + _jb(o.v146GateAgainstOldTrend) + "," + _jn(o.v146SlowReleaseBufferAtr) + "," + _jn(o.v146Q11AtrMult) + "," + _jb(o.showRSIGame) + "," + _jb(o.showMACDDiv) + "," + _jb(o.showOBVFilter) + "," + _jb(o.showVolumeGame) + "," + _jb(o.showQQEFilter) + "," + _jb(o.showCandleScanner) + "," + _jb(o.v1429UseT1OpportunityCap) + "," + _jn(o.v1429T1CapR) + "]"
if str.length(htfFragment) > 0
_ctx := _ctx + "," + htfFragment
_ctx := _ctx + ",\"et\":" + _trace(e, c, s, _traceBars)
_ctx := _ctx + ",\"h\":" + _history(180) + "}"
_ctx