PINE LIBRARY
업데이트됨 Milvetti_TraderPost_Library

Library "Milvetti_TraderPost_Library"
This library has methods that provide practical signal transmission for traderpost.Developed By Milvetti
cancelOrders(symbol)
This method generates a signal in JSON format that cancels all orders for the specified pair. (If you want to cancel stop loss and takeprofit orders together, use the “exitOrder” method.
Parameters:
symbol (string)
exitOrders(symbol)
This method generates a signal in JSON format that close all orders for the specified pair.
Parameters:
symbol (string)
createOrder(ticker, positionType, orderType, entryPrice, signalPrice, qtyType, qty, stopLoss, stopType, stopValue, takeProfit, profitType, profitValue, timeInForce)
This function is designed to send buy or sell orders to traderpost. It can create customized orders by flexibly specifying parameters such as order type, position type, entry price, quantity calculation method, stop-loss, and take-profit. The purpose of the function is to consolidate all necessary details for opening a position into a single structure and present it as a structured JSON output. This format can be sent to trading platforms via webhooks.
Parameters:
ticker (string): The ticker symbol of the instrument. Default value is the current chart's ticker (syminfo.ticker).
positionType (string): Determines the type of order (e.g., "long" or "buy" for buying and "short" or "sell" for selling).
orderType (string): Defines the order type for execution. Options: "market", "limit", "stop". Default is "market"
entryPrice (float): The price level for entry orders. Only applicable for limit or stop orders. Default is 0 (market orders ignore this).
signalPrice (float): Optional. Only necessary when using relative take profit or stop losses, and the broker does not support fetching quotes to perform the calculation. Default is 0
qtyType (string): Determines how the order quantity is calculated. Options: "fixed_quantity", "dollar_amount", "percent_of_equity", "percent_of_position".
qty (float): Quantity value. Can represent units of shares/contracts or a dollar amount, depending on qtyType.
stopLoss (bool): Enable or disable stop-loss functionality. Set to `true` to activate.
stopType (string): Specifies the stop-loss calculation type. Options: percent, "amount", "stopPrice", "trailPercent", "trailAmount". Default is "stopPrice"
stopValue (float): Stop-loss value based on stopType. Can be a percentage, dollar amount, or a specific stop price. Default is "stopPrice"
takeProfit (bool): Enable or disable take-profit functionality. Set to `true` to activate.
profitType (string): Specifies the take-profit calculation type. Options: "percent", "amount", "limitPrice". Default is "limitPrice"
profitValue (float): Take-profit value based on profitType. Can be a percentage, dollar amount, or a specific limit price. Default is 0
timeInForce (string): The time in force for your order. Options: day, gtc, opg, cls, ioc and fok
Returns: Return result in Json format.
addTsl(symbol, stopType, stopValue, price)
This method adds trailing stop loss to the current position. “Price” is the trailing stop loss starting level. You can leave price blank if you want it to start immediately
Parameters:
symbol (string)
stopType (string): Specifies the trailing stoploss calculation type. Options: "trailPercent", "trailAmount".
stopValue (float): Stop-loss value based on stopType. Can be a percentage, dollar amount.
price (float): The trailing stop loss starting level. You can leave price blank if you want it to start immediately. Default is current price.
This library has methods that provide practical signal transmission for traderpost.Developed By Milvetti
cancelOrders(symbol)
This method generates a signal in JSON format that cancels all orders for the specified pair. (If you want to cancel stop loss and takeprofit orders together, use the “exitOrder” method.
Parameters:
symbol (string)
exitOrders(symbol)
This method generates a signal in JSON format that close all orders for the specified pair.
Parameters:
symbol (string)
createOrder(ticker, positionType, orderType, entryPrice, signalPrice, qtyType, qty, stopLoss, stopType, stopValue, takeProfit, profitType, profitValue, timeInForce)
This function is designed to send buy or sell orders to traderpost. It can create customized orders by flexibly specifying parameters such as order type, position type, entry price, quantity calculation method, stop-loss, and take-profit. The purpose of the function is to consolidate all necessary details for opening a position into a single structure and present it as a structured JSON output. This format can be sent to trading platforms via webhooks.
Parameters:
ticker (string): The ticker symbol of the instrument. Default value is the current chart's ticker (syminfo.ticker).
positionType (string): Determines the type of order (e.g., "long" or "buy" for buying and "short" or "sell" for selling).
orderType (string): Defines the order type for execution. Options: "market", "limit", "stop". Default is "market"
entryPrice (float): The price level for entry orders. Only applicable for limit or stop orders. Default is 0 (market orders ignore this).
signalPrice (float): Optional. Only necessary when using relative take profit or stop losses, and the broker does not support fetching quotes to perform the calculation. Default is 0
qtyType (string): Determines how the order quantity is calculated. Options: "fixed_quantity", "dollar_amount", "percent_of_equity", "percent_of_position".
qty (float): Quantity value. Can represent units of shares/contracts or a dollar amount, depending on qtyType.
stopLoss (bool): Enable or disable stop-loss functionality. Set to `true` to activate.
stopType (string): Specifies the stop-loss calculation type. Options: percent, "amount", "stopPrice", "trailPercent", "trailAmount". Default is "stopPrice"
stopValue (float): Stop-loss value based on stopType. Can be a percentage, dollar amount, or a specific stop price. Default is "stopPrice"
takeProfit (bool): Enable or disable take-profit functionality. Set to `true` to activate.
profitType (string): Specifies the take-profit calculation type. Options: "percent", "amount", "limitPrice". Default is "limitPrice"
profitValue (float): Take-profit value based on profitType. Can be a percentage, dollar amount, or a specific limit price. Default is 0
timeInForce (string): The time in force for your order. Options: day, gtc, opg, cls, ioc and fok
Returns: Return result in Json format.
addTsl(symbol, stopType, stopValue, price)
This method adds trailing stop loss to the current position. “Price” is the trailing stop loss starting level. You can leave price blank if you want it to start immediately
Parameters:
symbol (string)
stopType (string): Specifies the trailing stoploss calculation type. Options: "trailPercent", "trailAmount".
stopValue (float): Stop-loss value based on stopType. Can be a percentage, dollar amount.
price (float): The trailing stop loss starting level. You can leave price blank if you want it to start immediately. Default is current price.
릴리즈 노트
Updated릴리즈 노트
v3릴리즈 노트
updated릴리즈 노트
v5파인 라이브러리
진정한 트레이딩뷰 정신에 따라 작성자는 이 파인 코드를 오픈 소스 라이브러리로 공개하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 건배! 이 라이브러리는 개인적으로 또는 다른 오픈 소스 출판물에서 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰의 적용을 받습니다.
Built your TradingView Tools with Pine Script Experts - milvetti.com
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
파인 라이브러리
진정한 트레이딩뷰 정신에 따라 작성자는 이 파인 코드를 오픈 소스 라이브러리로 공개하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 건배! 이 라이브러리는 개인적으로 또는 다른 오픈 소스 출판물에서 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰의 적용을 받습니다.
Built your TradingView Tools with Pine Script Experts - milvetti.com
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.