PINE LIBRARY
OrderTicketBuilder

Library "OrderTicketBuilder"
Assembles broker order ticket payloads as JSON strings.
BuildTicket(licenseId, symbol, action, orderType, tradeType, size, price, tp, sl, risk, trailPrice, trailOffset)
BuildTicket assembles a JSON order ticket string for downstream execution.
Parameters:
licenseId (string): License identifier
symbol (string): Symbol to trade
action (string): "MRKT" or "PENDING"
orderType (string): "BUY" or "SELL"
tradeType (string): "SPREAD" or "SINGLE"
size (float): (Optional) Trade size
price (float): (Optional) Price for pending orders
tp (float): (Optional) Take profit
sl (float): (Optional) Stop loss
risk (float): (Optional) Percent risk if size unspecified
trailPrice (float): (Optional) Trailing-stop trigger price
trailOffset (float): (Optional) Trailing-stop offset
Returns: JSON order ticket string
Assembles broker order ticket payloads as JSON strings.
BuildTicket(licenseId, symbol, action, orderType, tradeType, size, price, tp, sl, risk, trailPrice, trailOffset)
BuildTicket assembles a JSON order ticket string for downstream execution.
Parameters:
licenseId (string): License identifier
symbol (string): Symbol to trade
action (string): "MRKT" or "PENDING"
orderType (string): "BUY" or "SELL"
tradeType (string): "SPREAD" or "SINGLE"
size (float): (Optional) Trade size
price (float): (Optional) Price for pending orders
tp (float): (Optional) Take profit
sl (float): (Optional) Stop loss
risk (float): (Optional) Percent risk if size unspecified
trailPrice (float): (Optional) Trailing-stop trigger price
trailOffset (float): (Optional) Trailing-stop offset
Returns: JSON order ticket string
Biblioteka Pine
W zgodzie z duchem TradingView autor opublikował ten kod Pine jako bibliotekę open-source, aby inni programiści Pine z naszej społeczności mogli go ponownie wykorzystać. Ukłony dla autora. Można korzystać z tej biblioteki prywatnie lub w innych publikacjach open-source, jednak ponowne wykorzystanie tego kodu w publikacjach podlega Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Biblioteka Pine
W zgodzie z duchem TradingView autor opublikował ten kod Pine jako bibliotekę open-source, aby inni programiści Pine z naszej społeczności mogli go ponownie wykorzystać. Ukłony dla autora. Można korzystać z tej biblioteki prywatnie lub w innych publikacjach open-source, jednak ponowne wykorzystanie tego kodu w publikacjach podlega Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.