Opening Positions
Position types for opening new long or short positions.
LONG
Open a long position (buy). Expects the price to increase.
Required Parameters
action: Must be"BUY"strategy_key: Always required
Example
{
"strategy_key": "your_key",
"exchange": "BINANCE",
"ticker": "BTCUSDT.P",
"position_side": "LONG",
"action": "BUY",
"entry_price": 50000,
"stop_loss_price": 48000,
"take_profit_price": 55000,
"leverage": 10
}
Price Requirements
For LONG positions:
stop_loss_price < entry_price < take_profit_price
SHORT
Open a short position (sell). Expects the price to decrease.
Required Parameters
action: Must be"SELL"strategy_key: Always required
Example
{
"strategy_key": "your_key",
"exchange": "BYBIT",
"ticker": "ETHUSDT.P",
"position_side": "SHORT",
"action": "SELL",
"entry_price": 3000,
"stop_loss_price": 3100,
"take_profit_price": 2800,
"leverage": 5
}
Price Requirements
For SHORT positions:
take_profit_price < entry_price < stop_loss_price
Market vs Limit Entry
Market Order
{
"position_side": "LONG",
"action": "BUY",
"entry_order_type": "MARKET",
"stop_loss_price": 48000
}
Limit Order
{
"position_side": "LONG",
"action": "BUY",
"entry_price": 50000,
"entry_order_type": "LIMIT",
"stop_loss_price": 48000
}
Common Patterns
Conservative Entry with Tight Stop
{
"position_side": "LONG",
"action": "BUY",
"entry_price": 50000,
"stop_loss_price": 49500,
"take_profit_price": 51500,
"leverage": 5
}
Aggressive Entry with Trailing Stop
{
"position_side": "LONG",
"action": "BUY",
"entry_price": 50000,
"stop_loss_price": 48000,
"take_profit_price": 53000,
"is_trailing_stop_enabled": true,
"callback_rate": 1.0,
"leverage": 20
}
Range-Bound Short
{
"position_side": "SHORT",
"action": "SELL",
"entry_price": 50000,
"stop_loss_price": 50500,
"take_profit_price": 49000,
"leverage": 10
}
Next Steps
- Closing Positions - How to close positions
- Examples - Complete examples