PINE LIBRARY
Diupdate

TradersPostDeluxe

349
Library "TradersPostDeluxe"
TradersPost integration. It's currently not very deluxe

SendEntryAlert(ticker, action, quantity, orderType, takeProfit, stopLoss, id, price, timestamp, timezone)
  Sends an alert to TradersPost to trigger an Entry
  Parameters:
    ticker (string): Symbol to trade. Default is syminfo.ticker
    action (series Action): TradersPostAction (.buy, .sell) default = buy
    quantity (float): Amount to trade, default = 1
    orderType (series OrderType): TradersPostOrderType, default =e TradersPostOrderType.market
    takeProfit (float): Take profit limit price
    stopLoss (float): Stop loss price
    id (string): id for the trade
    price (float): Expected price
    timestamp (int): Time of the trade for reporting, defaults to timenow
    timezone (string): associated with the time, defaults to syminfo.timezone
  Returns: Nothing

SendExitAlert(ticker, price, timestamp, timezone)
  Sends an alert to TradersPost to trigger an Exit
  Parameters:
    ticker (string): Symbol to flatten
    price (float): Documented planned price
    timestamp (int): Time of the trade for reporting, defaults to timenow
    timezone (string): associated with the time, defaults to syminfo.timezone
  Returns: Nothing
Catatan Rilis
A million things
Catatan Rilis
v3
Catatan Rilis
v4

Updated: supports signalPrice
Catatan Rilis
v5
Catatan Rilis
Better alignment with TradersPost parameters
Removed unrealistic order tracking
Catatan Rilis
v7
Match TradersPost fields whenever possible
Replace all TradersPost magic strings with enums for type safety
Catatan Rilis
**v8.0 (2025-09-14)**

- **Enhanced SendBracketOrder logic**: Fixed entryPrice routing to properly support all order types (market, limit, stop, stop_limit, trailing_stop)
- **New _buildBracketOrderParams helper function**: Automatically routes entryPrice to the correct parameter based on orderType, preventing order type/price parameter mismatches
- **signalPrice parameter added to all helper functions**: SendSentiment, SendBracketOrder, SendOTOOrder, SendOCOOrder, and SendOrderNoCancelExisting now all support signalPrice for better slippage tracking
- **Comprehensive bracket order testing**: Added unit tests to ensure proper JSON generation for each order type
- **Improved documentation**: Enhanced guide with clear explanations of entryPrice/orderType relationships

### Breaking Changes

- **SendBracketOrder behavior change**: The entryPrice parameter now correctly routes to limitPrice or stopPrice based on orderType instead of always going to limitPrice
- **Helper function signatures updated**: All helper functions now include signalPrice parameter (optional, defaults to na)
Catatan Rilis
v9
fix validation error on cancels and exits
Catatan Rilis
v10
Catatan Rilis
v11

Pernyataan Penyangkalan

Informasi dan publikasi tidak dimaksudkan untuk menjadi, dan bukan merupakan saran keuangan, investasi, perdagangan, atau rekomendasi lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Persyaratan Penggunaan.