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
ไลบรารีไพน์
ด้วยเจตนารมณ์หลักของ TradingView ผู้เขียนได้เผยแพร่ Pine code นี้เป็นโอเพนซอร์สไลบรารีเพื่อให้ Pine โปรแกรมเมอร์คนอื่นในชุมชนของเราสามารถนำไปใช้ซ้ำได้ ต้องขอบคุณผู้เขียน! คุณสามารถใช้ไลบรารีนี้ในแบบส่วนตัวหรือในการเผยแพร่แบบโอเพนซอร์สอื่น ๆ แต่การนำโค้ดนี้ไปใช้ในการเผยแพร่ซ้ำจะต้องอยู่ภายใต้ กฎระเบียบการใช้งาน
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
ไลบรารีไพน์
ด้วยเจตนารมณ์หลักของ TradingView ผู้เขียนได้เผยแพร่ Pine code นี้เป็นโอเพนซอร์สไลบรารีเพื่อให้ Pine โปรแกรมเมอร์คนอื่นในชุมชนของเราสามารถนำไปใช้ซ้ำได้ ต้องขอบคุณผู้เขียน! คุณสามารถใช้ไลบรารีนี้ในแบบส่วนตัวหรือในการเผยแพร่แบบโอเพนซอร์สอื่น ๆ แต่การนำโค้ดนี้ไปใช้ในการเผยแพร่ซ้ำจะต้องอยู่ภายใต้ กฎระเบียบการใช้งาน
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน