Correct JSON Structure for TradersPost Take Profit Webhooks
Learn how to configure TradersPost take profit webhooks with proper JSON examples, including percentage-based, absolute price, and combined stop-loss setups.
Marketing
-
Current TradersPost documentation lists four mutually exclusive take-profit modes and does not confirm a distinct simulation workflow, so the guidance has been qualified while the supported JSON examples and combined exit orders still stand.
TradersPost allows seamless automation of trading strategies through webhooks. For features like take profit, following the correct JSON structure is crucial to ensure trades execute as intended. This guide explains the proper webhook JSON format for configuring take profit and how to integrate it into your trading strategy.
Understanding the JSON Structure for Take Profit
A webhook JSON must adhere to TradersPost’s documented standards. The minimum required fields are "ticker" and "action"; other fields depend on your use case1. Here's how to set up a take profit with webhook JSON:
Example: Basic Take Profit Webhook
{
"ticker": "BTCUSD",
"action": "buy",
"orderType": "market",
"quantity": 1,
"takeProfit": {
"amount": 1000
}
}
Explanation:
"ticker": The symbol for the asset to trade (e.g., Bitcoin/US Dollar pair)."action": The trading action (e.g.,"buy","sell","exit")."orderType": Defines the type of order ("market","limit", etc.)."quantity": Number of units to trade."takeProfit": Contains one of four mutually exclusive profit-taking modes:"limitPrice","amount","percent", or"pnlAmount"2."amount": Sets a $1,000 profit target relative to the entry price.
Advanced Configurations
1. Percentage-Based Take Profit
Set a take profit relative to the entry price as a percentage.
{
"ticker": "AAPL",
"action": "buy",
"orderType": "limit",
"limitPrice": 150,
"quantity": 10,
"takeProfit": {
"percent": 10
}
}
This configuration will trigger a profit-taking order 10% above the entry price.
2. Absolute Price Take Profit
Use an exact price level for your take profit order.
{
"ticker": "ETHUSD",
"action": "buy",
"orderType": "market",
"quantity": 2,
"takeProfit": {
"limitPrice": 3000
}
}
Here, the system will set the take profit at $3,000 for Ethereum.
3. Combining Take Profit with Stop Loss
Include both take profit and stop loss in a single webhook for comprehensive risk management.
{
"ticker": "TSLA",
"action": "buy",
"orderType": "market",
"quantity": 5,
"takeProfit": {
"limitPrice": 800
},
"stopLoss": {
"type": "stop",
"stopPrice": 600
}
}
Key Additions:
"stopLoss": Defines the stop-loss parameters."type": Specifies the stop-loss type ("stop","stop_limit", etc.)."stopPrice": Sets the absolute price for triggering the stop loss.
Tips for Successful Webhook Execution
Validate Your JSON
Use a JSON validation tool to confirm the structure is error-free before sending it to TradersPost.
Test Before Live Trading
Test your webhook configurations before live trading to avoid errors2.
Review Broker Capabilities
Ensure your broker supports the specified order types and configurations, such as take profit and stop loss.
Conclusion
Using the correct JSON structure is vital for executing take profit orders in TradersPost. By following the official documentation and using examples like those above, you can automate your trading strategies with precision. Whether you're targeting absolute price levels, percentages, or combining take profit with stop loss, the flexibility of TradersPost ensures your trading goals are achievable.
References
1 docs.traderspost.io, Signal Template Creator | Documentation - Getting Started
2 Signal Message Reference | Documentation | TradersPost