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.
릴리즈 노트
Updated
alertsformattingmilvettistrategiesstrategytraderposttradingbot

파인 라이브러리

진정한 TradingView 정신에 따라, 저자는 이 파인 코드를 다른 파인 프로그래머들이 재사용할 수 있도록 오픈 소스 라이브러리로 공개했습니다. 저자에게 박수를 보냅니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈 소스 출판물에서 사용할 수 있지만, 이 코드를 출판물에서 재사용하는 것은 하우스 룰에 의해 관리됩니다.


Milvetti
Trader/Developer
milvetti.com
또한 다음에서도:

면책사항