buy(account, amount, unit, leverage) Sends a trading alert to execute a market buy order. Parameters: account (string): The account ID. amount (float): The amount to buy (can be in USD, units, or percentage). unit (string): The unit of the amount (optional, defaults to "units"). leverage (float): The leverage to use (optional, defaults to 1x).
sell(account, amount, unit, leverage) Sends a trading alert to execute a market sell order. Parameters: account (string): The account ID. amount (float): The amount to sell (can be in USD, units, or percentage). unit (string): The unit of the amount (optional, defaults to "units"). leverage (float): The leverage to use (optional, defaults to 1x).
set_position(account, amount, unit, leverage) Sends a trading alert to set a position. Parameters: account (string): The account ID. amount (float): The amount to set the position to (can be in USD, units, or percentage). unit (string): The unit of the amount (optional, defaults to "units"). leverage (float): The leverage to use (optional, defaults to 1x).
limit_buy(account, amount, price, unit, leverage, id) Sends a trading alert to place a limit buy order. Parameters: account (string): The account ID. amount (float): The amount to buy (can be in USD, units, or percentage). price (float): The limit price. unit (string): The unit of the amount (optional, defaults to "units"). leverage (float): The leverage to use (optional, defaults to 1x). id (string): An optional custom ID for the limit order.
limit_sell(account, amount, price, unit, leverage, id) Sends a trading alert to place a limit sell order. Parameters: account (string): The account ID. amount (float): The amount to sell (can be in USD, units, or percentage). price (float): The limit price. unit (string): The unit of the amount (optional, defaults to "units"). leverage (float): The leverage to use (optional, defaults to 1x). id (string): An optional custom ID for the limit order.
close_percent(account, pct) Sends an alert to close a position on Phemex. Parameters: account (string): The account ID. pct (float): The percentage of the position to close (optional, defaults to 100%).
릴리즈 노트
v2
릴리즈 노트
v3
릴리즈 노트
v4
Added: cancel(account, ticker, id) Sends an alert to cancel a specific limit order. Parameters: account (string): The account ID. ticker (string) id (string): The ID of the limit order to cancel.
cancel_all(account, ticker) Sends an alert to cancel all orders for a symbol. Parameters: account (string): The account ID. ticker (string)
Updated: buy(account, ticker, amount, unit, leverage) Sends a trading alert to execute a market buy order. Parameters: account (string): The account ID. ticker (string) amount (float): The amount to buy (can be in USD, units, or percentage). unit (string): The unit of the amount (optional, defaults to "units"). leverage (float): The leverage to use (optional, defaults to 1x).
sell(account, ticker, amount, unit, leverage) Sends a trading alert to execute a market sell order. Parameters: account (string): The account ID. ticker (string) amount (float): The amount to sell (can be in USD, units, or percentage). unit (string): The unit of the amount (optional, defaults to "units"). leverage (float): The leverage to use (optional, defaults to 1x).
set_position(account, ticker, amount, unit, leverage) Sends a trading alert to set a position. Parameters: account (string): The account ID. ticker (string) amount (float): The amount to set the position to (can be in USD, units, or percentage). unit (string): The unit of the amount (optional, defaults to "units"). leverage (float): The leverage to use (optional, defaults to 1x).
limit_buy(account, ticker, amount, price, unit, leverage, id) Sends a trading alert to place a limit buy order. Parameters: account (string): The account ID. ticker (string) amount (float): The amount to buy (can be in USD, units, or percentage). price (float): The limit price. unit (string): The unit of the amount (optional, defaults to "units"). leverage (float): The leverage to use (optional, defaults to 1x). id (string): An optional custom ID for the limit order.
limit_sell(account, ticker, amount, price, unit, leverage, id) Sends a trading alert to place a limit sell order. Parameters: account (string): The account ID. ticker (string) amount (float): The amount to sell (can be in USD, units, or percentage). price (float): The limit price. unit (string): The unit of the amount (optional, defaults to "units"). leverage (float): The leverage to use (optional, defaults to 1x). id (string): An optional custom ID for the limit order.
close_percent(account, ticker, pct, price) Sends an alert to close a position on Phemex. Parameters: account (string): The account ID. ticker (string) pct (float): The percentage of the position to close (optional, defaults to 100%). price (float)
진정한 TradingView 정신에 따라, 저자는 이 파인 코드를 다른 파인 프로그래머들이 재사용할 수 있도록 오픈 소스 라이브러리로 공개했습니다. 저자에게 박수를 보냅니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈 소스 출판물에서 사용할 수 있지만, 이 코드를 출판물에서 재사용하는 것은 하우스 룰에 의해 관리됩니다.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.