콘텐츠로 이동

DSL API Contract (Generated)

contracts/dsl_contract.json을 기준으로 자동 생성됨. 수동 편집 금지.

  • Contract Version: 1.3.0
  • Schema Version: 1.3

Symbols

id namespace label kind detail
dsl.False global False Variable False: bool
dsl.None global None Variable None: NoneType
dsl.True global True Variable True: bool
dsl.abs global abs Function abs(x) -> float
dsl.buy global buy Function buy(qty=0, tag="", price=None)
dsl.chart global chart Function chart(timeframe: str) -> ScaleChart
dsl.description global description Function description(text: str)
dsl.event global event Variable event: str
dsl.hold global hold Function hold(tag="")
dsl.len global len Function len(series) -> int
dsl.log global log Function log(*args)
dsl.math global math Variable math: Math Namespace
dsl.max global max Function max(a, b) -> float
dsl.min global min Function min(a, b) -> float
dsl.notify global notify Function notify(*args)
dsl.param global param Function param(name: str, description: str, default) -> value
dsl.position global position Variable position: dict
dsl.price global price Variable price: float
dsl.print global print Function print(*args)
dsl.round global round Function round(x, ndigits=0) -> float
dsl.sell global sell Function sell(qty=0, tag="")
dsl.symbol global symbol Variable symbol: str
dsl.symbol_market global symbol_market Variable symbol_market: str
dsl.symbol_name global symbol_name Variable symbol_name: str
dsl.ta global ta Variable ta: Technical Indicator Namespace
dsl.var global var Variable var: Variable Namespace
dsl.version global version Function version(v: str)
dsl.volume global volume Variable volume: float
dsl.warm_up global warm_up Variable warm_up: bool
math.ceil math ceil Method math.ceil(x) -> float
math.exp math exp Method math.exp(x) -> float
math.floor math floor Method math.floor(x) -> float
math.isnan math isnan Method math.isnan(x) -> bool
math.log math log Method math.log(x) -> float
math.log10 math log10 Method math.log10(x) -> float
math.pi math pi Method math.pi() -> float
math.pow math pow Method math.pow(x, y) -> float
math.sqrt math sqrt Method math.sqrt(x) -> float
scale.bar_index chart bar_index Property .bar_index -> TSeries
scale.bars chart bars Property .bars -> int
scale.close chart close Property .close -> TSeries
scale.high chart high Property .high -> TSeries
scale.histogram chart histogram Method .histogram(name, value, color="#4caf50")
scale.hl2 chart hl2 Property .hl2 -> TSeries
scale.hlc3 chart hlc3 Property .hlc3 -> TSeries
scale.hline chart hline Method .hline(name, value, color="#ff9800")
scale.line chart line Method .line(name, value, color="#2196f3")
scale.low chart low Property .low -> TSeries
scale.marker chart marker Method .marker(text="", color="#f44336", position="above", shape="circle")
scale.status_marker chart status_marker Method .status_marker(text="", color="#f44336", position="above", shape="circle")
scale.arrow_up_marker chart arrow_up_marker Method .arrow_up_marker(text="", color="#f04452")
scale.arrow_down_marker chart arrow_down_marker Method .arrow_down_marker(text="", color="#3182f6")
scale.circle_marker chart circle_marker Method .circle_marker(text="", color="#f44336", position="above")
scale.square_marker chart square_marker Method .square_marker(text="", color="#f44336", position="above")
scale.ohlc4 chart ohlc4 Property .ohlc4 -> TSeries
scale.open chart open Property .open -> TSeries
scale.pane chart pane Method .pane(name) -> PaneProxy
scale.scale chart scale Property .scale -> str
scale.tr chart tr Property .tr -> TSeries
scale.vline chart vline Method .vline(name, color="#9c27b0")
scale.volume chart volume Property .volume -> TSeries
ta.adx ta adx Method ta.adx(high, low, close, length=14) -> TSeries
ta.atr ta atr Method ta.atr(high, low, close, length=14) -> TSeries
ta.barssince ta barssince Method ta.barssince(condition) -> TSeries
ta.bbands ta bbands Method ta.bbands(source, length=20, mult=2.0) -> (upper, mid, lower)
ta.cci ta cci Method ta.cci(high, low, close, length=20) -> TSeries
ta.change ta change Method ta.change(source, length=1) -> TSeries
ta.crossover ta crossover Method ta.crossover(s1, s2) -> bool
ta.crossunder ta crossunder Method ta.crossunder(s1, s2) -> bool
ta.ema ta ema Method ta.ema(source, length) -> TSeries
ta.highest ta highest Method ta.highest(source, length) -> TSeries
ta.lowest ta lowest Method ta.lowest(source, length) -> TSeries
ta.macd ta macd Method ta.macd(source, fast=12, slow=26, signal=9) -> (line, signal, hist)
ta.mom ta mom Method ta.mom(source, length=10) -> TSeries
ta.obv ta obv Method ta.obv(close, volume) -> TSeries
ta.rma ta rma Method ta.rma(source, length) -> TSeries
ta.roc ta roc Method ta.roc(source, length=10) -> TSeries
ta.rsi ta rsi Method ta.rsi(source, length=14) -> TSeries
ta.sma ta sma Method ta.sma(source, length) -> TSeries
ta.stdev ta stdev Method ta.stdev(source, length) -> TSeries
ta.stoch ta stoch Method ta.stoch(high, low, close, k=14, d=3, smooth=3) -> (k, d)
ta.sum ta sum Method ta.sum(source, length) -> TSeries
ta.valuewhen ta valuewhen Method ta.valuewhen(condition, source) -> TSeries
ta.vwap ta vwap Method ta.vwap(high, low, close, volume) -> TSeries
ta.wma ta wma Method ta.wma(source, length) -> TSeries
tseries.cross_down tseries cross_down Method .cross_down(other) -> bool
tseries.cross_up tseries cross_up Method .cross_up(other) -> bool
tseries.get_or_default tseries get_or_default Method .get_or_default(index, default=0.0) -> float
tseries.is_valid tseries is_valid Method .is_valid(index) -> bool
tseries.to_list tseries to_list Method .to_list(length=0) -> list[float]
dsl.bar global bar Variable bar: BarNamespace
dsl.strategy global strategy Variable strategy: StrategyNamespace
dsl.account global account Variable account: dict
dsl.int global int Function int(x) -> int
dsl.float global float Function float(x) -> float
dsl.str global str Function str(x) -> str
dsl.bool global bool Function bool(x) -> bool
dsl.list global list Function list(iterable?) -> list
dsl.dict global dict Function dict(**kwargs) -> dict
dsl.tuple global tuple Function tuple(iterable?) -> tuple
dsl.range global range Function range(stop) / range(start, stop, step?) -> range
dsl.enumerate global enumerate Function enumerate(iterable, start=0) -> enumerate
dsl.zip global zip Function zip(*iterables) -> zip
dsl.sorted global sorted Function sorted(iterable, key=None, reverse=False) -> list
dsl.all global all Function all(iterable) -> bool
dsl.any global any Function any(iterable) -> bool
dsl.isinstance global isinstance Function isinstance(obj, classinfo) -> bool

Details

dsl.False

  • namespace: global
  • kind: Variable
  • detail: False: bool
  • insert: False

기능

불리언 거짓 값.

파라미터

  • 없음

출력

  • 타입: bool
  • 설명: 참/거짓 불리언 결과.

예시

  • False 값을 조건식/계산식에서 사용한다.

dsl.None

  • namespace: global
  • kind: Variable
  • detail: None: NoneType
  • insert: None

기능

널(None) 값.

파라미터

  • 없음

출력

  • 타입: NoneType
  • 설명: 해당 타입 규약에 맞는 값을 반환한다.

예시

  • None 값을 조건식/계산식에서 사용한다.

dsl.True

  • namespace: global
  • kind: Variable
  • detail: True: bool
  • insert: True

기능

불리언 참 값.

파라미터

  • 없음

출력

  • 타입: bool
  • 설명: 참/거짓 불리언 결과.

예시

  • True 값을 조건식/계산식에서 사용한다.

dsl.abs

  • namespace: global
  • kind: Function
  • detail: abs(x) -> float
  • insert: abs(${1:value})
  • signature: abs(x)

기능

절대값을 반환한다.

파라미터

이름 타입 설명
x - 수치 입력

출력

  • 타입: float
  • 설명: 부동소수점 수치 결과.

예시

  • abs(value) 형태로 호출해 사용한다.

dsl.buy

  • namespace: global
  • kind: Function
  • detail: buy(qty=0, tag="", price=None)
  • insert: buy(qty=${1:1}, tag="${2:entry}")
  • signature: buy(qty=0, tag="", price=None)

기능

매수 결정을 기록한다.

파라미터

이름 타입 설명
qty int 수량(0이면 시스템 보정)
tag str 태그 문자열
price float | None 지정가(None이면 시장가)

출력

  • 타입: None
  • 설명: 반환값 없이 BUY 결정을 기록한다(마지막 호출이 최종 결정).

예시

  • buy(qty=1, tag="entry") 형태로 호출해 사용한다.

dsl.chart

  • namespace: global
  • kind: Function
  • detail: chart(timeframe: str) -> ScaleChart
  • insert: chart("${1:1T}")
  • signature: chart(timeframe)

기능

차트 오버레이 기능이 포함된 ScaleChart를 반환한다.

파라미터

이름 타입 설명
timeframe - 예: 1T, 5T, 1D

출력

  • 타입: ScaleChart
  • 설명: OHLCV 접근 및 오버레이 메서드를 제공하는 차트 객체.

예시

  • chart("1T") 형태로 호출해 사용한다.

dsl.description

  • namespace: global
  • kind: Function
  • detail: description(text: str)
  • insert: description("${1:전략 설명}")
  • signature: description(text)

기능

스크립트 설명(메타데이터)을 선언한다.

파라미터

이름 타입 설명
text - 설명 문자열

출력

  • 타입: None
  • 설명: 반환값 없이 런타임 상태/결정에 부수효과를 남긴다.

예시

  • description("전략 설명") 형태로 호출해 사용한다.

dsl.event

  • namespace: global
  • kind: Variable
  • detail: event: str
  • insert: event

기능

현재 이벤트 타입(price_change/candle_close).

파라미터

  • 없음

출력

  • 타입: str
  • 설명: 문자열 결과.

예시

  • event 값을 조건식/계산식에서 사용한다.

dsl.hold

  • namespace: global
  • kind: Function
  • detail: hold(tag="")
  • insert: hold(tag="${1:wait}")
  • signature: hold(tag="")

기능

관망 결정을 기록한다.

파라미터

이름 타입 설명
tag str 관망 사유 태그

출력

  • 타입: None
  • 설명: 반환값 없이 HOLD 결정을 기록한다(마지막 호출이 최종 결정).

예시

  • hold(tag="wait") 형태로 호출해 사용한다.

dsl.len

  • namespace: global
  • kind: Function
  • detail: len(series) -> int
  • insert: len(${1:series})
  • signature: len(series)

기능

시계열/리스트 길이를 반환한다.

파라미터

이름 타입 설명
series - 길이를 구할 시퀀스

출력

  • 타입: int
  • 설명: 정수 결과.

예시

  • len(series) 형태로 호출해 사용한다.

dsl.log

  • namespace: global
  • kind: Function
  • detail: log(*args)
  • insert: log("${1:message}")

기능

로그를 출력한다.

파라미터

이름 타입 설명
args Any... 가변 인자 목록. 문자열로 변환되어 순서대로 처리된다.

출력

  • 타입: None
  • 설명: 반환값 없이 런타임 상태/결정에 부수효과를 남긴다.

예시

  • log("message") 형태로 호출해 사용한다.

dsl.math

  • namespace: global
  • kind: Variable
  • detail: math: Math Namespace
  • insert: math

기능

수학 함수 네임스페이스(math.sqrt, math.log, ...).

파라미터

  • 없음

출력

  • 타입: Math Namespace
  • 설명: 해당 타입 규약에 맞는 값을 반환한다.

예시

  • math 값을 조건식/계산식에서 사용한다.

dsl.max

  • namespace: global
  • kind: Function
  • detail: max(a, b) -> float
  • insert: max(${1:a}, ${2:b})
  • signature: max(a, b)

기능

두 값 중 큰 값을 반환한다.

파라미터

이름 타입 설명
a - 첫 번째 값
b - 두 번째 값

출력

  • 타입: float
  • 설명: 부동소수점 수치 결과.

예시

  • max(a, b) 형태로 호출해 사용한다.

dsl.min

  • namespace: global
  • kind: Function
  • detail: min(a, b) -> float
  • insert: min(${1:a}, ${2:b})
  • signature: min(a, b)

기능

두 값 중 작은 값을 반환한다.

파라미터

이름 타입 설명
a - 첫 번째 값
b - 두 번째 값

출력

  • 타입: float
  • 설명: 부동소수점 수치 결과.

예시

  • min(a, b) 형태로 호출해 사용한다.

dsl.notify

  • namespace: global
  • kind: Function
  • detail: notify(*args)
  • insert: notify("${1:message}")

기능

알림 채널(예: Telegram)로 메시지를 전달한다.

파라미터

이름 타입 설명
args Any... 가변 인자 목록. 문자열로 변환되어 순서대로 처리된다.

출력

  • 타입: None
  • 설명: 반환값 없이 런타임 상태/결정에 부수효과를 남긴다.

예시

  • notify("message") 형태로 호출해 사용한다.

dsl.param

  • namespace: global
  • kind: Function
  • detail: param(name: str, description: str, default) -> value
  • insert: param("${1:name}", "${2:description}", ${3:10})
  • signature: param(name, description, default)

기능

런타임 파라미터를 선언/조회한다.

파라미터

이름 타입 설명
name - 파라미터 키
description - 파라미터 설명
default - 기본값

출력

  • 타입: value
  • 설명: 해당 타입 규약에 맞는 값을 반환한다.

예시

  • param("name", "설명", 10) 형태로 호출해 사용한다.

dsl.position

  • namespace: global
  • kind: Variable
  • detail: position: dict
  • insert: position

기능

현재 포지션 정보(dict).

파라미터

  • 없음

출력

  • 타입: dict
  • 설명: 해당 타입 규약에 맞는 값을 반환한다.

예시

  • position 값을 조건식/계산식에서 사용한다.

dsl.price

  • namespace: global
  • kind: Variable
  • detail: price: float
  • insert: price

기능

현재 가격.

파라미터

  • 없음

출력

  • 타입: float
  • 설명: 부동소수점 수치 결과.

예시

  • price 값을 조건식/계산식에서 사용한다.

dsl.print

  • namespace: global
  • kind: Function
  • detail: print(*args)
  • insert: print(${1})

기능

log와 동일한 출력 함수.

파라미터

이름 타입 설명
args Any... 가변 인자 목록. 문자열로 변환되어 순서대로 처리된다.

출력

  • 타입: None
  • 설명: 반환값 없이 런타임 상태/결정에 부수효과를 남긴다.

예시

  • print(value) 형태로 호출해 사용한다.

dsl.round

  • namespace: global
  • kind: Function
  • detail: round(x, ndigits=0) -> float
  • insert: round(${1:value}, ${2:2})
  • signature: round(x, ndigits=0)

기능

반올림 값을 반환한다.

파라미터

이름 타입 설명
x - 수치 입력
ndigits - 소수점 자릿수

출력

  • 타입: float
  • 설명: 부동소수점 수치 결과.

예시

  • round(value, 2) 형태로 호출해 사용한다.

dsl.sell

  • namespace: global
  • kind: Function
  • detail: sell(qty=0, tag="")
  • insert: sell(qty=${1:1}, tag="${2:exit}")
  • signature: sell(qty=0, tag="")

기능

매도 결정을 기록한다.

파라미터

이름 타입 설명
qty int 수량(0이면 전량)
tag str 태그 문자열

출력

  • 타입: None
  • 설명: 반환값 없이 SELL 결정을 기록한다(마지막 호출이 최종 결정).

예시

  • sell(qty=1, tag="exit") 형태로 호출해 사용한다.

dsl.symbol

  • namespace: global
  • kind: Variable
  • detail: symbol: str
  • insert: symbol

기능

현재 종목 코드.

파라미터

  • 없음

출력

  • 타입: str
  • 설명: 문자열 결과.

예시

  • symbol 값을 조건식/계산식에서 사용한다.

dsl.symbol_market

  • namespace: global
  • kind: Variable
  • detail: symbol_market: str
  • insert: symbol_market

기능

시장 구분(KOSPI/KOSDAQ).

파라미터

  • 없음

출력

  • 타입: str
  • 설명: 문자열 결과.

예시

  • symbol_market 값을 조건식/계산식에서 사용한다.

dsl.symbol_name

  • namespace: global
  • kind: Variable
  • detail: symbol_name: str
  • insert: symbol_name

기능

현재 종목명.

파라미터

  • 없음

출력

  • 타입: str
  • 설명: 문자열 결과.

예시

  • symbol_name 값을 조건식/계산식에서 사용한다.

dsl.ta

  • namespace: global
  • kind: Variable
  • detail: ta: Technical Indicator Namespace
  • insert: ta

기능

기술지표 네임스페이스(ta.sma, ta.rsi, ...).

파라미터

  • 없음

출력

  • 타입: Technical Indicator Namespace
  • 설명: 해당 타입 규약에 맞는 값을 반환한다.

예시

  • ta 값을 조건식/계산식에서 사용한다.

dsl.var

  • namespace: global
  • kind: Variable
  • detail: var: Variable Namespace
  • insert: var

기능

전략 실행 간 상태를 저장하는 네임스페이스.

파라미터

  • 없음

출력

  • 타입: Variable Namespace
  • 설명: 해당 타입 규약에 맞는 값을 반환한다.

예시

  • var 값을 조건식/계산식에서 사용한다.

dsl.version

  • namespace: global
  • kind: Function
  • detail: version(v: str)
  • insert: version("1.0.0")
  • signature: version(v)

기능

스크립트 버전 선언. 모든 스크립트 첫 줄에 선언한다.

파라미터

이름 타입 설명
v - 스크립트 버전 문자열

출력

  • 타입: None
  • 설명: 반환값 없이 런타임 상태/결정에 부수효과를 남긴다.

예시

  • version("1.0.0") 형태로 호출해 사용한다.

dsl.volume

  • namespace: global
  • kind: Variable
  • detail: volume: float
  • insert: volume

기능

현재 거래량.

파라미터

  • 없음

출력

  • 타입: float
  • 설명: 부동소수점 수치 결과.

예시

  • volume 값을 조건식/계산식에서 사용한다.

dsl.warm_up

  • namespace: global
  • kind: Variable
  • detail: warm_up: bool
  • insert: warm_up

기능

워밍업 모드 여부.

파라미터

  • 없음

출력

  • 타입: bool
  • 설명: 참/거짓 불리언 결과.

예시

  • warm_up 값을 조건식/계산식에서 사용한다.

math.ceil

  • namespace: math
  • kind: Method
  • detail: math.ceil(x) -> float
  • insert: ceil(${1:x})
  • signature: ceil(x)

기능

올림 값을 반환한다.

파라미터

이름 타입 설명
x - 입력 값

출력

  • 타입: float
  • 설명: 부동소수점 수치 결과.

예시

  • math.ceil(x) 형태로 호출해 사용한다.

math.exp

  • namespace: math
  • kind: Method
  • detail: math.exp(x) -> float
  • insert: exp(${1:x})
  • signature: exp(x)

기능

e^x 값을 반환한다.

파라미터

이름 타입 설명
x - 지수

출력

  • 타입: float
  • 설명: 부동소수점 수치 결과.

예시

  • math.exp(x) 형태로 호출해 사용한다.

math.floor

  • namespace: math
  • kind: Method
  • detail: math.floor(x) -> float
  • insert: floor(${1:x})
  • signature: floor(x)

기능

내림 값을 반환한다.

파라미터

이름 타입 설명
x - 입력 값

출력

  • 타입: float
  • 설명: 부동소수점 수치 결과.

예시

  • math.floor(x) 형태로 호출해 사용한다.

math.isnan

  • namespace: math
  • kind: Method
  • detail: math.isnan(x) -> bool
  • insert: isnan(${1:x})
  • signature: isnan(x)

기능

입력 값이 NaN인지 반환한다.

파라미터

이름 타입 설명
x - 입력 값

출력

  • 타입: bool
  • 설명: 참/거짓 불리언 결과.

예시

  • math.isnan(x) 형태로 호출해 사용한다.

math.log

  • namespace: math
  • kind: Method
  • detail: math.log(x) -> float
  • insert: log(${1:x})
  • signature: log(x)

기능

자연로그(ln)를 반환한다.

파라미터

이름 타입 설명
x - 양수 입력 값

출력

  • 타입: float
  • 설명: 부동소수점 수치 결과.

예시

  • math.log(x) 형태로 호출해 사용한다.

math.log10

  • namespace: math
  • kind: Method
  • detail: math.log10(x) -> float
  • insert: log10(${1:x})
  • signature: log10(x)

기능

상용로그(log10)를 반환한다.

파라미터

이름 타입 설명
x - 양수 입력 값

출력

  • 타입: float
  • 설명: 부동소수점 수치 결과.

예시

  • math.log10(x) 형태로 호출해 사용한다.

math.pi

  • namespace: math
  • kind: Method
  • detail: math.pi() -> float
  • insert: pi()
  • signature: pi()

기능

원주율 상수를 반환한다.

파라미터

  • 없음

출력

  • 타입: float
  • 설명: 부동소수점 수치 결과.

예시

  • math.pi() 형태로 호출해 사용한다.

math.pow

  • namespace: math
  • kind: Method
  • detail: math.pow(x, y) -> float
  • insert: pow(${1:x}, ${2:y})
  • signature: pow(x, y)

기능

x^y 값을 반환한다.

파라미터

이름 타입 설명
x -
y - 지수

출력

  • 타입: float
  • 설명: 부동소수점 수치 결과.

예시

  • math.pow(x, y) 형태로 호출해 사용한다.

math.sqrt

  • namespace: math
  • kind: Method
  • detail: math.sqrt(x) -> float
  • insert: sqrt(${1:x})
  • signature: sqrt(x)

기능

제곱근을 반환한다.

파라미터

이름 타입 설명
x - 입력 값

출력

  • 타입: float
  • 설명: 부동소수점 수치 결과.

예시

  • math.sqrt(x) 형태로 호출해 사용한다.

scale.bar_index

  • namespace: chart
  • kind: Property
  • detail: .bar_index -> TSeries
  • insert: bar_index

기능

봉 인덱스 시계열.

파라미터

  • 없음

출력

  • 타입: TSeries
  • 설명: 시계열(TSeries) 객체. [0]은 최신값, [1]은 직전값.

예시

  • c.bar_index 값을 조건식/계산식에서 사용한다.

scale.bars

  • namespace: chart
  • kind: Property
  • detail: .bars -> int
  • insert: bars

기능

현재 보유 캔들 수.

파라미터

  • 없음

출력

  • 타입: int
  • 설명: 정수 결과.

예시

  • c.bars 값을 조건식/계산식에서 사용한다.

scale.close

  • namespace: chart
  • kind: Property
  • detail: .close -> TSeries
  • insert: close

기능

종가 시계열.

파라미터

  • 없음

출력

  • 타입: TSeries
  • 설명: 시계열(TSeries) 객체. [0]은 최신값, [1]은 직전값.

예시

  • c.close 값을 조건식/계산식에서 사용한다.

scale.high

  • namespace: chart
  • kind: Property
  • detail: .high -> TSeries
  • insert: high

기능

고가 시계열.

파라미터

  • 없음

출력

  • 타입: TSeries
  • 설명: 시계열(TSeries) 객체. [0]은 최신값, [1]은 직전값.

예시

  • c.high 값을 조건식/계산식에서 사용한다.

scale.histogram

  • namespace: chart
  • kind: Method
  • detail: .histogram(name, value, color="#4caf50")
  • insert: histogram(name="${1:hist}", value=${2:series}, color="${3:#4caf50}")
  • signature: histogram(name, value, color="#4caf50")

기능

히스토그램 오버레이를 추가한다.

파라미터

이름 타입 설명
name - 히스토그램 이름
value - 값 또는 시계열
color - 색상

출력

  • 타입: None
  • 설명: 반환값 없이 히스토그램 오버레이를 추가/갱신한다.

예시

  • c.histogram(name="hist", value=series, color="#4caf50") 형태로 호출해 사용한다.

scale.hl2

  • namespace: chart
  • kind: Property
  • detail: .hl2 -> TSeries
  • insert: hl2

기능

(high+low)/2 시계열.

파라미터

  • 없음

출력

  • 타입: TSeries
  • 설명: 시계열(TSeries) 객체. [0]은 최신값, [1]은 직전값.

예시

  • c.hl2 값을 조건식/계산식에서 사용한다.

scale.hlc3

  • namespace: chart
  • kind: Property
  • detail: .hlc3 -> TSeries
  • insert: hlc3

기능

(high+low+close)/3 시계열.

파라미터

  • 없음

출력

  • 타입: TSeries
  • 설명: 시계열(TSeries) 객체. [0]은 최신값, [1]은 직전값.

예시

  • c.hlc3 값을 조건식/계산식에서 사용한다.

scale.hline

  • namespace: chart
  • kind: Method
  • detail: .hline(name, value, color="#ff9800")
  • insert: hline(name="${1:level}", value=${2:0}, color="${3:#ff9800}")
  • signature: hline(name, value, color="#ff9800")

기능

수평선 오버레이를 추가한다.

파라미터

이름 타입 설명
name - 라인 이름
value - 가격값
color - 색상

출력

  • 타입: None
  • 설명: 반환값 없이 수평선 오버레이를 추가/갱신한다.

예시

  • c.hline(name="level", value=0, color="#ff9800") 형태로 호출해 사용한다.

scale.line

  • namespace: chart
  • kind: Method
  • detail: .line(name, value, color="#2196f3")
  • insert: line(name="${1:line}", value=${2:series}, color="${3:#2196f3}")
  • signature: line(name, value, color="#2196f3")

기능

라인 오버레이를 추가한다.

파라미터

이름 타입 설명
name - 라인 이름
value - 값 또는 시계열
color - 색상

출력

  • 타입: None
  • 설명: 반환값 없이 현재 스케일에 라인 오버레이를 추가/갱신한다.

예시

  • c.line(name="line", value=series, color="#2196f3") 형태로 호출해 사용한다.

scale.low

  • namespace: chart
  • kind: Property
  • detail: .low -> TSeries
  • insert: low

기능

저가 시계열.

파라미터

  • 없음

출력

  • 타입: TSeries
  • 설명: 시계열(TSeries) 객체. [0]은 최신값, [1]은 직전값.

예시

  • c.low 값을 조건식/계산식에서 사용한다.

scale.marker

  • namespace: chart
  • kind: Method
  • detail: .marker(text="", color="#f44336", position="above", shape="circle")
  • insert: marker(text="${1:signal}", position="${2:below}", shape="${3:arrow_up}", color="${4:#4caf50}")
  • signature: marker(text="", color="#f44336", position="above", shape="circle")

기능

상태형 marker를 추가한다. 하위 호환을 위해 유지되는 기본 API이며, 새 코드는 status_marker() 또는 shape helper를 우선한다.

파라미터

이름 타입 설명
text - 텍스트
color - 색상
position - above/below
shape - 마커 모양

출력

  • 타입: None
  • 설명: 반환값 없이 마커 오버레이를 추가/갱신한다.

예시

  • c.marker(text="signal", position="below", shape="arrow_up", color="#4caf50") 형태로 호출해 사용한다.

scale.status_marker

  • namespace: chart
  • kind: Method
  • detail: .status_marker(text="", color="#f44336", position="above", shape="circle")
  • insert: status_marker(text="${1:ready}", position="${2:below}", shape="${3:square}", color="${4:#22c55e}")
  • signature: status_marker(text="", color="#f44336", position="above", shape="circle")

기능

상태형 marker를 명시적으로 추가한다. 동일 candle 안에서는 최종 상태를 구성하는 marker로 해석된다.

파라미터

이름 타입 설명
text - 텍스트
color - 색상
position - above/below
shape - circle/square/arrow_up/arrow_down

출력

  • 타입: None
  • 설명: 반환값 없이 상태형 marker를 추가/갱신한다.

예시

  • c.status_marker(text="READY", position="below", shape="square", color="#22c55e") 형태로 호출해 사용한다.

scale.arrow_up_marker

  • namespace: chart
  • kind: Method
  • detail: .arrow_up_marker(text="", color="#f04452")
  • insert: arrow_up_marker(text="${1:buy}", color="${2:#f04452}")
  • signature: arrow_up_marker(text="", color="#f04452")

기능

아래쪽에 고정된 상승 arrow marker를 추가한다. position/shape 인자를 반복하지 않아도 된다.

파라미터

이름 타입 설명
text - 텍스트
color - 색상

출력

  • 타입: None
  • 설명: 반환값 없이 below + arrow_up 상태형 marker를 추가한다.

예시

  • c.arrow_up_marker("BUY") 형태로 호출해 사용한다.

scale.arrow_down_marker

  • namespace: chart
  • kind: Method
  • detail: .arrow_down_marker(text="", color="#3182f6")
  • insert: arrow_down_marker(text="${1:sell}", color="${2:#3182f6}")
  • signature: arrow_down_marker(text="", color="#3182f6")

기능

위쪽에 고정된 하락 arrow marker를 추가한다. position/shape 인자를 반복하지 않아도 된다.

파라미터

이름 타입 설명
text - 텍스트
color - 색상

출력

  • 타입: None
  • 설명: 반환값 없이 above + arrow_down 상태형 marker를 추가한다.

예시

  • c.arrow_down_marker("SELL") 형태로 호출해 사용한다.

scale.circle_marker

  • namespace: chart
  • kind: Method
  • detail: .circle_marker(text="", color="#f44336", position="above")
  • insert: circle_marker(text="${1:note}", position="${2:above}", color="${3:#f44336}")
  • signature: circle_marker(text="", color="#f44336", position="above")

기능

circle shape를 고정한 상태형 marker helper다.

파라미터

이름 타입 설명
text - 텍스트
color - 색상
position - above/below

출력

  • 타입: None
  • 설명: 반환값 없이 circle 상태형 marker를 추가한다.

예시

  • c.circle_marker(text="VOL", position="below", color="#22c55e") 형태로 호출해 사용한다.

scale.square_marker

  • namespace: chart
  • kind: Method
  • detail: .square_marker(text="", color="#f44336", position="above")
  • insert: square_marker(text="${1:ready}", position="${2:below}", color="${3:#22c55e}")
  • signature: square_marker(text="", color="#f44336", position="above")

기능

square shape를 고정한 상태형 marker helper다.

파라미터

이름 타입 설명
text - 텍스트
color - 색상
position - above/below

출력

  • 타입: None
  • 설명: 반환값 없이 square 상태형 marker를 추가한다.

예시

  • c.square_marker(text="READY", position="below", color="#22c55e") 형태로 호출해 사용한다.

scale.ohlc4

  • namespace: chart
  • kind: Property
  • detail: .ohlc4 -> TSeries
  • insert: ohlc4

기능

(open+high+low+close)/4 시계열.

파라미터

  • 없음

출력

  • 타입: TSeries
  • 설명: 시계열(TSeries) 객체. [0]은 최신값, [1]은 직전값.

예시

  • c.ohlc4 값을 조건식/계산식에서 사용한다.

scale.open

  • namespace: chart
  • kind: Property
  • detail: .open -> TSeries
  • insert: open

기능

시가 시계열.

파라미터

  • 없음

출력

  • 타입: TSeries
  • 설명: 시계열(TSeries) 객체. [0]은 최신값, [1]은 직전값.

예시

  • c.open 값을 조건식/계산식에서 사용한다.

scale.pane

  • namespace: chart
  • kind: Method
  • detail: .pane(name) -> PaneProxy
  • insert: pane("${1:name}")
  • signature: pane(name) -> PaneProxy

기능

서브 패인 핸들을 반환한다.

파라미터

이름 타입 설명
name - 패인 이름

출력

  • 타입: PaneProxy
  • 설명: 지정 이름의 서브 패인 핸들을 반환한다.

예시

  • c.pane("name") 형태로 호출해 사용한다.

scale.scale

  • namespace: chart
  • kind: Property
  • detail: .scale -> str
  • insert: scale

기능

타임프레임 문자열.

파라미터

  • 없음

출력

  • 타입: str
  • 설명: 문자열 결과.

예시

  • c.scale 값을 조건식/계산식에서 사용한다.

scale.tr

  • namespace: chart
  • kind: Property
  • detail: .tr -> TSeries
  • insert: tr

기능

True Range 시계열.

파라미터

  • 없음

출력

  • 타입: TSeries
  • 설명: 시계열(TSeries) 객체. [0]은 최신값, [1]은 직전값.

예시

  • c.tr 값을 조건식/계산식에서 사용한다.

scale.vline

  • namespace: chart
  • kind: Method
  • detail: .vline(name, color="#9c27b0")
  • insert: vline(name="${1:signal}", color="${2:#9c27b0}")
  • signature: vline(name, color="#9c27b0")

기능

수직선 오버레이를 추가한다.

파라미터

이름 타입 설명
name - 라인 이름
color - 색상

출력

  • 타입: None
  • 설명: 반환값 없이 수직선 오버레이를 추가/갱신한다.

예시

  • c.vline(name="signal", color="#9c27b0") 형태로 호출해 사용한다.

scale.volume

  • namespace: chart
  • kind: Property
  • detail: .volume -> TSeries
  • insert: volume

기능

거래량 시계열.

파라미터

  • 없음

출력

  • 타입: TSeries
  • 설명: 시계열(TSeries) 객체. [0]은 최신값, [1]은 직전값.

예시

  • c.volume 값을 조건식/계산식에서 사용한다.

ta.adx

  • namespace: ta
  • kind: Method
  • detail: ta.adx(high, low, close, length=14) -> TSeries
  • insert: adx(${1:c.high}, ${2:c.low}, ${3:c.close}, ${4:14})
  • signature: adx(high, low, close, length=14)

기능

ADX 추세강도 시계열을 반환한다.

파라미터

이름 타입 설명
high - 고가 시계열
low - 저가 시계열
close - 종가 시계열
length - 기간

출력

  • 타입: TSeries
  • 설명: 시계열(TSeries) 객체. [0]은 최신값, [1]은 직전값.

예시

  • ta.adx(c.high, c.low, c.close, 14) 형태로 호출해 사용한다.

ta.atr

  • namespace: ta
  • kind: Method
  • detail: ta.atr(high, low, close, length=14) -> TSeries
  • insert: atr(${1:c.high}, ${2:c.low}, ${3:c.close}, ${4:14})
  • signature: atr(high, low, close, length=14)

기능

ATR 시계열을 반환한다.

파라미터

이름 타입 설명
high - 고가 시계열
low - 저가 시계열
close - 종가 시계열
length - 기간

출력

  • 타입: TSeries
  • 설명: 시계열(TSeries) 객체. [0]은 최신값, [1]은 직전값.

예시

  • ta.atr(c.high, c.low, c.close, 14) 형태로 호출해 사용한다.

ta.barssince

  • namespace: ta
  • kind: Method
  • detail: ta.barssince(condition) -> TSeries
  • insert: barssince(${1:condition})
  • signature: barssince(condition)

기능

조건을 마지막으로 만족한 이후 경과 봉 수를 반환한다.

파라미터

이름 타입 설명
condition - 불리언 조건 시계열

출력

  • 타입: TSeries
  • 설명: 시계열(TSeries) 객체. [0]은 최신값, [1]은 직전값.

예시

  • ta.barssince(condition) 형태로 호출해 사용한다.

ta.bbands

  • namespace: ta
  • kind: Method
  • detail: ta.bbands(source, length=20, mult=2.0) -> (upper, mid, lower)
  • insert: bbands(${1:c.close}, ${2:20}, ${3:2.0})
  • signature: bbands(source, length=20, mult=2.0)

기능

볼린저 밴드 상단/중단/하단 시계열을 반환한다.

파라미터

이름 타입 설명
source - 입력 시계열
length - 기간
mult - 표준편차 배수

출력

  • 타입: (upper, mid, lower)
  • 설명: 상단/중단/하단 밴드 3개 시계열 튜플을 반환한다.

예시

  • ta.bbands(c.close, 20, 2.0) 형태로 호출해 사용한다.

ta.cci

  • namespace: ta
  • kind: Method
  • detail: ta.cci(high, low, close, length=20) -> TSeries
  • insert: cci(${1:c.high}, ${2:c.low}, ${3:c.close}, ${4:20})
  • signature: cci(high, low, close, length=20)

기능

CCI 시계열을 반환한다.

파라미터

이름 타입 설명
high - 고가 시계열
low - 저가 시계열
close - 종가 시계열
length - 기간

출력

  • 타입: TSeries
  • 설명: 시계열(TSeries) 객체. [0]은 최신값, [1]은 직전값.

예시

  • ta.cci(c.high, c.low, c.close, 20) 형태로 호출해 사용한다.

ta.change

  • namespace: ta
  • kind: Method
  • detail: ta.change(source, length=1) -> TSeries
  • insert: change(${1:c.close}, ${2:1})
  • signature: change(source, length=1)

기능

변화량 시계열을 반환한다.

파라미터

이름 타입 설명
source - 입력 시계열
length - 기간

출력

  • 타입: TSeries
  • 설명: 시계열(TSeries) 객체. [0]은 최신값, [1]은 직전값.

예시

  • ta.change(c.close, 1) 형태로 호출해 사용한다.

ta.crossover

  • namespace: ta
  • kind: Method
  • detail: ta.crossover(s1, s2) -> bool
  • insert: crossover(${1:fast}, ${2:slow})
  • signature: crossover(s1, s2)

기능

s1이 s2를 하향->상향 교차했는지 반환한다.

파라미터

이름 타입 설명
s1 - 첫 번째 시계열
s2 - 두 번째 시계열

출력

  • 타입: bool
  • 설명: 참/거짓 불리언 결과.

예시

  • ta.crossover(fast, slow) 형태로 호출해 사용한다.

ta.crossunder

  • namespace: ta
  • kind: Method
  • detail: ta.crossunder(s1, s2) -> bool
  • insert: crossunder(${1:fast}, ${2:slow})
  • signature: crossunder(s1, s2)

기능

s1이 s2를 상향->하향 교차했는지 반환한다.

파라미터

이름 타입 설명
s1 - 첫 번째 시계열
s2 - 두 번째 시계열

출력

  • 타입: bool
  • 설명: 참/거짓 불리언 결과.

예시

  • ta.crossunder(fast, slow) 형태로 호출해 사용한다.

ta.ema

  • namespace: ta
  • kind: Method
  • detail: ta.ema(source, length) -> TSeries
  • insert: ema(${1:c.close}, ${2:12})
  • signature: ema(source, length)

기능

지수이동평균(EMA) 시계열을 반환한다.

파라미터

이름 타입 설명
source - 입력 시계열
length - 기간

출력

  • 타입: TSeries
  • 설명: 시계열(TSeries) 객체. [0]은 최신값, [1]은 직전값.

예시

  • ta.ema(c.close, 12) 형태로 호출해 사용한다.

ta.highest

  • namespace: ta
  • kind: Method
  • detail: ta.highest(source, length) -> TSeries
  • insert: highest(${1:c.high}, ${2:20})
  • signature: highest(source, length)

기능

롤링 최고값 시계열을 반환한다.

파라미터

이름 타입 설명
source - 입력 시계열
length - 기간

출력

  • 타입: TSeries
  • 설명: 시계열(TSeries) 객체. [0]은 최신값, [1]은 직전값.

예시

  • ta.highest(c.high, 20) 형태로 호출해 사용한다.

ta.lowest

  • namespace: ta
  • kind: Method
  • detail: ta.lowest(source, length) -> TSeries
  • insert: lowest(${1:c.low}, ${2:20})
  • signature: lowest(source, length)

기능

롤링 최저값 시계열을 반환한다.

파라미터

이름 타입 설명
source - 입력 시계열
length - 기간

출력

  • 타입: TSeries
  • 설명: 시계열(TSeries) 객체. [0]은 최신값, [1]은 직전값.

예시

  • ta.lowest(c.low, 20) 형태로 호출해 사용한다.

ta.macd

  • namespace: ta
  • kind: Method
  • detail: ta.macd(source, fast=12, slow=26, signal=9) -> (line, signal, hist)
  • insert: macd(${1:c.close}, ${2:12}, ${3:26}, ${4:9})
  • signature: macd(source, fast=12, slow=26, signal=9)

기능

MACD 선/시그널/히스토그램 3개 시계열을 반환한다.

파라미터

이름 타입 설명
source - 입력 시계열
fast - 단기 EMA 기간
slow - 장기 EMA 기간
signal - 시그널 EMA 기간

출력

  • 타입: (line, signal, hist)
  • 설명: MACD선, Signal선, Histogram의 3개 시계열 튜플을 반환한다.

예시

  • ta.macd(c.close, 12, 26, 9) 형태로 호출해 사용한다.

ta.mom

  • namespace: ta
  • kind: Method
  • detail: ta.mom(source, length=10) -> TSeries
  • insert: mom(${1:c.close}, ${2:10})
  • signature: mom(source, length=10)

기능

모멘텀(현재값-과거값) 시계열을 반환한다.

파라미터

이름 타입 설명
source - 입력 시계열
length - 기간

출력

  • 타입: TSeries
  • 설명: 시계열(TSeries) 객체. [0]은 최신값, [1]은 직전값.

예시

  • ta.mom(c.close, 10) 형태로 호출해 사용한다.

ta.obv

  • namespace: ta
  • kind: Method
  • detail: ta.obv(close, volume) -> TSeries
  • insert: obv(${1:c.close}, ${2:c.volume})
  • signature: obv(close, volume)

기능

OBV 시계열을 반환한다.

파라미터

이름 타입 설명
close - 종가 시계열
volume - 거래량 시계열

출력

  • 타입: TSeries
  • 설명: 시계열(TSeries) 객체. [0]은 최신값, [1]은 직전값.

예시

  • ta.obv(c.close, c.volume) 형태로 호출해 사용한다.

ta.rma

  • namespace: ta
  • kind: Method
  • detail: ta.rma(source, length) -> TSeries
  • insert: rma(${1:c.close}, ${2:14})
  • signature: rma(source, length)

기능

와일더 평활(RMA/SMMA) 시계열을 반환한다.

파라미터

이름 타입 설명
source - 입력 시계열
length - 기간

출력

  • 타입: TSeries
  • 설명: 시계열(TSeries) 객체. [0]은 최신값, [1]은 직전값.

예시

  • ta.rma(c.close, 14) 형태로 호출해 사용한다.

ta.roc

  • namespace: ta
  • kind: Method
  • detail: ta.roc(source, length=10) -> TSeries
  • insert: roc(${1:c.close}, ${2:10})
  • signature: roc(source, length=10)

기능

ROC(변화율 %) 시계열을 반환한다.

파라미터

이름 타입 설명
source - 입력 시계열
length - 기간

출력

  • 타입: TSeries
  • 설명: 시계열(TSeries) 객체. [0]은 최신값, [1]은 직전값.

예시

  • ta.roc(c.close, 10) 형태로 호출해 사용한다.

ta.rsi

  • namespace: ta
  • kind: Method
  • detail: ta.rsi(source, length=14) -> TSeries
  • insert: rsi(${1:c.close}, ${2:14})
  • signature: rsi(source, length=14)

기능

RSI(0~100) 시계열을 반환한다.

파라미터

이름 타입 설명
source - 입력 시계열
length - 기간(기본 14)

출력

  • 타입: TSeries
  • 설명: 시계열(TSeries) 객체. [0]은 최신값, [1]은 직전값.

예시

  • ta.rsi(c.close, 14) 형태로 호출해 사용한다.

ta.sma

  • namespace: ta
  • kind: Method
  • detail: ta.sma(source, length) -> TSeries
  • insert: sma(${1:c.close}, ${2:20})
  • signature: sma(source, length)

기능

단순이동평균(SMA) 시계열을 반환한다.

파라미터

이름 타입 설명
source - 입력 시계열
length - 기간

출력

  • 타입: TSeries
  • 설명: 시계열(TSeries) 객체. [0]은 최신값, [1]은 직전값.

예시

  • ta.sma(c.close, 20) 형태로 호출해 사용한다.

ta.stdev

  • namespace: ta
  • kind: Method
  • detail: ta.stdev(source, length) -> TSeries
  • insert: stdev(${1:c.close}, ${2:20})
  • signature: stdev(source, length)

기능

표준편차 시계열을 반환한다.

파라미터

이름 타입 설명
source - 입력 시계열
length - 기간

출력

  • 타입: TSeries
  • 설명: 시계열(TSeries) 객체. [0]은 최신값, [1]은 직전값.

예시

  • ta.stdev(c.close, 20) 형태로 호출해 사용한다.

ta.stoch

  • namespace: ta
  • kind: Method
  • detail: ta.stoch(high, low, close, k=14, d=3, smooth=3) -> (k, d)
  • insert: stoch(${1:c.high}, ${2:c.low}, ${3:c.close}, ${4:14}, ${5:3}, ${6:3})
  • signature: stoch(high, low, close, k=14, d=3, smooth=3)

기능

스토캐스틱 %K/%D 시계열을 반환한다.

파라미터

이름 타입 설명
high - 고가 시계열
low - 저가 시계열
close - 종가 시계열
k - K 기간
d - D 기간
smooth - K 스무딩 기간

출력

  • 타입: (k, d)
  • 설명: %K, %D의 2개 시계열 튜플을 반환한다.

예시

  • ta.stoch(c.high, c.low, c.close, 14, 3, 3) 형태로 호출해 사용한다.

ta.sum

  • namespace: ta
  • kind: Method
  • detail: ta.sum(source, length) -> TSeries
  • insert: sum(${1:c.volume}, ${2:20})
  • signature: sum(source, length)

기능

롤링 합계 시계열을 반환한다.

파라미터

이름 타입 설명
source - 입력 시계열
length - 기간

출력

  • 타입: TSeries
  • 설명: 시계열(TSeries) 객체. [0]은 최신값, [1]은 직전값.

예시

  • ta.sum(c.volume, 20) 형태로 호출해 사용한다.

ta.valuewhen

  • namespace: ta
  • kind: Method
  • detail: ta.valuewhen(condition, source) -> TSeries
  • insert: valuewhen(${1:condition}, ${2:c.close})
  • signature: valuewhen(condition, source)

기능

조건을 마지막으로 만족한 시점의 source 값을 반환한다.

파라미터

이름 타입 설명
condition - 불리언 조건 시계열
source - 입력 시계열

출력

  • 타입: TSeries
  • 설명: 시계열(TSeries) 객체. [0]은 최신값, [1]은 직전값.

예시

  • ta.valuewhen(condition, c.close) 형태로 호출해 사용한다.

ta.vwap

  • namespace: ta
  • kind: Method
  • detail: ta.vwap(high, low, close, volume) -> TSeries
  • insert: vwap(${1:c.high}, ${2:c.low}, ${3:c.close}, ${4:c.volume})
  • signature: vwap(high, low, close, volume)

기능

VWAP 시계열을 반환한다.

파라미터

이름 타입 설명
high - 고가 시계열
low - 저가 시계열
close - 종가 시계열
volume - 거래량 시계열

출력

  • 타입: TSeries
  • 설명: 시계열(TSeries) 객체. [0]은 최신값, [1]은 직전값.

예시

  • ta.vwap(c.high, c.low, c.close, c.volume) 형태로 호출해 사용한다.

ta.wma

  • namespace: ta
  • kind: Method
  • detail: ta.wma(source, length) -> TSeries
  • insert: wma(${1:c.close}, ${2:10})
  • signature: wma(source, length)

기능

가중이동평균(WMA) 시계열을 반환한다.

파라미터

이름 타입 설명
source - 입력 시계열
length - 기간

출력

  • 타입: TSeries
  • 설명: 시계열(TSeries) 객체. [0]은 최신값, [1]은 직전값.

예시

  • ta.wma(c.close, 10) 형태로 호출해 사용한다.

tseries.cross_down

  • namespace: tseries
  • kind: Method
  • detail: .cross_down(other) -> bool
  • insert: cross_down(${1:other})
  • signature: cross_down(other) -> bool

기능

하향 교차 여부를 반환한다.

파라미터

이름 타입 설명
other - 비교 대상 시계열

출력

  • 타입: bool
  • 설명: 참/거짓 불리언 결과.

예시

  • tseries.cross_down(other) 형태로 호출해 사용한다.

tseries.cross_up

  • namespace: tseries
  • kind: Method
  • detail: .cross_up(other) -> bool
  • insert: cross_up(${1:other})
  • signature: cross_up(other) -> bool

기능

상향 교차 여부를 반환한다.

파라미터

이름 타입 설명
other - 비교 대상 시계열

출력

  • 타입: bool
  • 설명: 참/거짓 불리언 결과.

예시

  • tseries.cross_up(other) 형태로 호출해 사용한다.

tseries.get_or_default

  • namespace: tseries
  • kind: Method
  • detail: .get_or_default(index, default=0.0) -> float
  • insert: get_or_default(${1:0}, ${2:0.0})
  • signature: get_or_default(index, default=0.0) -> float

기능

인덱스 범위 밖이면 기본값을 반환한다.

파라미터

이름 타입 설명
index - 조회 인덱스
default - 기본값

출력

  • 타입: float
  • 설명: 부동소수점 수치 결과.

예시

  • tseries.get_or_default(0, 0.0) 형태로 호출해 사용한다.

tseries.is_valid

  • namespace: tseries
  • kind: Method
  • detail: .is_valid(index) -> bool
  • insert: is_valid(${1:0})
  • signature: is_valid(index) -> bool

기능

인덱스 접근 가능 여부를 반환한다.

파라미터

이름 타입 설명
index - 조회 인덱스

출력

  • 타입: bool
  • 설명: 참/거짓 불리언 결과.

예시

  • tseries.is_valid(0) 형태로 호출해 사용한다.

tseries.to_list

  • namespace: tseries
  • kind: Method
  • detail: .to_list(length=0) -> list[float]
  • insert: to_list(${1})
  • signature: to_list(length=0) -> list[float]

기능

시계열을 리스트로 변환한다.

파라미터

이름 타입 설명
length - 길이(0이면 전체)

출력

  • 타입: list[float]
  • 설명: 부동소수점 수치 결과.

예시

  • tseries.to_list(value) 형태로 호출해 사용한다.

dsl.bar

  • namespace: global
  • kind: Variable
  • detail: bar: BarNamespace
  • insert: bar

기능

현재 봉의 상태를 읽는 읽기 전용 네임스페이스.

파라미터

  • 없음

출력

  • 타입: BarNamespace
  • 설명: 봉 상태 속성을 가진 네임스페이스 객체.

예시

  • if bar.is_confirmed: — 봉 확정 시에만 주문 판단.

dsl.strategy

  • namespace: global
  • kind: Variable
  • detail: strategy: StrategyNamespace
  • insert: strategy

기능

전략 실행 파라미터를 읽고 쓰는 네임스페이스.

파라미터

  • 없음

출력

  • 타입: StrategyNamespace
  • 설명: 전략 설정 속성을 가진 네임스페이스 객체.

예시

  • strategy.order_on = "1D" — 일봉 기준으로 주문.

dsl.account

  • namespace: global
  • kind: Variable
  • detail: account: dict
  • insert: account

기능

브로커 계좌 정보 (잔고, 수익률 등)를 읽는 읽기 전용 뷰.

파라미터

  • 없음

출력

  • 타입: dict
  • 설명: 계좌 정보 딕셔너리.

예시

  • log(account) — 계좌 상태를 로그에 출력.

dsl.int

  • namespace: global
  • kind: Function
  • detail: int(x) -> int
  • insert: int(${1:x})

기능

값을 정수로 변환한다.

파라미터

이름 타입 설명
x any 변환할 값.

출력

  • 타입: int
  • 설명: 정수 값.

예시

  • int(3.7)3

dsl.float

  • namespace: global
  • kind: Function
  • detail: float(x) -> float
  • insert: float(${1:x})

기능

값을 부동소수점으로 변환한다.

파라미터

이름 타입 설명
x any 변환할 값.

출력

  • 타입: float
  • 설명: 부동소수점 값.

예시

  • float("3.14")3.14

dsl.str

  • namespace: global
  • kind: Function
  • detail: str(x) -> str
  • insert: str(${1:x})

기능

값을 문자열로 변환한다.

파라미터

이름 타입 설명
x any 변환할 값.

출력

  • 타입: str
  • 설명: 문자열.

예시

  • str(42)"42"

dsl.bool

  • namespace: global
  • kind: Function
  • detail: bool(x) -> bool
  • insert: bool(${1:x})

기능

값을 불리언으로 변환한다.

파라미터

이름 타입 설명
x any 변환할 값.

출력

  • 타입: bool
  • 설명: 불리언 값.

예시

  • bool(0)False

dsl.list

  • namespace: global
  • kind: Function
  • detail: list(iterable?) -> list
  • insert: list(${1:iterable})

기능

리스트를 생성하거나 이터러블을 리스트로 변환한다.

파라미터

이름 타입 설명
iterable iterable 변환할 이터러블 (선택).

출력

  • 타입: list
  • 설명: 리스트.

예시

  • list(range(5))[0, 1, 2, 3, 4]

dsl.dict

  • namespace: global
  • kind: Function
  • detail: dict(**kwargs) -> dict
  • insert: dict()

기능

딕셔너리를 생성한다.

파라미터

  • 없음

출력

  • 타입: dict
  • 설명: 딕셔너리.

예시

  • dict(a=1, b=2){"a": 1, "b": 2}

dsl.tuple

  • namespace: global
  • kind: Function
  • detail: tuple(iterable?) -> tuple
  • insert: tuple(${1:iterable})

기능

튜플을 생성하거나 이터러블을 튜플로 변환한다.

파라미터

이름 타입 설명
iterable iterable 변환할 이터러블 (선택).

출력

  • 타입: tuple
  • 설명: 튜플.

예시

  • tuple([1, 2, 3])(1, 2, 3)

dsl.range

  • namespace: global
  • kind: Function
  • detail: range(stop) / range(start, stop, step?) -> range
  • insert: range(${1:stop})

기능

정수 시퀀스를 생성한다.

파라미터

이름 타입 설명
start int 시작값 (기본 0).
stop int 종료값 (미포함).
step int 증분 (기본 1).

출력

  • 타입: range
  • 설명: 정수 시퀀스.

예시

  • for i in range(5): — 0부터 4까지 반복.

dsl.enumerate

  • namespace: global
  • kind: Function
  • detail: enumerate(iterable, start=0) -> enumerate
  • insert: enumerate(${1:iterable})

기능

이터러블에 인덱스를 붙여 (index, value) 쌍으로 반복한다.

파라미터

이름 타입 설명
iterable iterable 반복할 이터러블.
start int 시작 인덱스 (기본 0).

출력

  • 타입: enumerate
  • 설명: (인덱스, 값) 튜플 이터레이터.

예시

  • for i, v in enumerate(values): — 인덱스와 값을 함께 반복.

dsl.zip

  • namespace: global
  • kind: Function
  • detail: zip(*iterables) -> zip
  • insert: zip(${1:iter1}, ${2:iter2})

기능

여러 이터러블을 병렬로 묶어 튜플 이터레이터를 만든다.

파라미터

이름 타입 설명
iterables iterable 병렬로 묶을 이터러블들.

출력

  • 타입: zip
  • 설명: 튜플 이터레이터.

예시

  • for a, b in zip(list1, list2):

dsl.sorted

  • namespace: global
  • kind: Function
  • detail: sorted(iterable, key=None, reverse=False) -> list
  • insert: sorted(${1:iterable})

기능

이터러블을 정렬한 새 리스트를 반환한다.

파라미터

이름 타입 설명
iterable iterable 정렬할 이터러블.
reverse bool True이면 내림차순 (기본 False).

출력

  • 타입: list
  • 설명: 정렬된 리스트.

예시

  • sorted([3, 1, 2])[1, 2, 3]

dsl.all

  • namespace: global
  • kind: Function
  • detail: all(iterable) -> bool
  • insert: all(${1:iterable})

기능

이터러블의 모든 요소가 참이면 True를 반환한다.

파라미터

이름 타입 설명
iterable iterable 검사할 이터러블.

출력

  • 타입: bool
  • 설명: 모두 참이면 True.

예시

  • all([True, True, False])False

dsl.any

  • namespace: global
  • kind: Function
  • detail: any(iterable) -> bool
  • insert: any(${1:iterable})

기능

이터러블에 참인 요소가 하나라도 있으면 True를 반환한다.

파라미터

이름 타입 설명
iterable iterable 검사할 이터러블.

출력

  • 타입: bool
  • 설명: 하나라도 참이면 True.

예시

  • any([False, False, True])True

dsl.isinstance

  • namespace: global
  • kind: Function
  • detail: isinstance(obj, classinfo) -> bool
  • insert: isinstance(${1:obj}, ${2:type})

기능

객체가 지정한 타입의 인스턴스인지 검사한다.

파라미터

이름 타입 설명
obj any 검사할 객체.
classinfo type 검사할 타입.

출력

  • 타입: bool
  • 설명: 인스턴스이면 True.

예시

  • isinstance(42, int)True

Dynamic Enums

Provider Model Catalog

alias models
anthropic claude-sonnet-4-6, claude-haiku-4-5-20251001, claude-opus-4-6
claude-cli claude-sonnet-4-6, claude-haiku-4-5-20251001, claude-opus-4-6
codex-cli gpt-5.3-codex
google gemini-2.5-pro, gemini-2.5-flash
openai gpt-4o, gpt-4o-mini, gpt-4.1, gpt-4.1-mini, o3, o4-mini
xai grok-3, grok-3-mini

안내

  • 이 문서는 사용자 문서와 에디터 인텔리센스 정합성을 보장하기 위한 계약 레퍼런스입니다.