All URIs are relative to https://api.bybit.com
Method | HTTP request | Description |
---|---|---|
linearPositionsChangeMargin | POST /private/linear/position/add-margin | Add/Reduce Margin |
linearPositionsClosePnlRecords | GET /private/linear/trade/closed-pnl/list | Get user's closed profit and loss records. |
linearPositionsMyPosition | GET /private/linear/position/list | Get my position list. |
linearPositionsSaveLeverage | POST /private/linear/position/set-leverage | Set leverage |
linearPositionsSetAutoAddMargin | POST /private/linear/position/set-auto-add-margin | Set auto add margin |
linearPositionsSwitchIsolated | POST /private/linear/position/switch-isolated | Switch isolated |
linearPositionsSwitchMode | POST /private/linear/tpsl/switch-mode | Switch Mode |
linearPositionsTradingStop | POST /private/linear/position/trading-stop | Set tradingStop |
Object linearPositionsChangeMargin(symbol, side, margin)
Add/Reduce Margin
This will Add/Reduce Margin
// Import classes:
//import io.swagger.client.api.LinearPositionsApi;
LinearPositionsApi apiInstance = new LinearPositionsApi();
String symbol = "symbol_example"; // String |
String side = "side_example"; // String |
Double margin = 3.4D; // Double |
try {
Object result = apiInstance.linearPositionsChangeMargin(symbol, side, margin);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling LinearPositionsApi#linearPositionsChangeMargin");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
symbol | String | [optional] | |
side | String | [optional] | |
margin | Double | [optional] |
Object
apiKey, apiSignature, timestamp
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
Object linearPositionsClosePnlRecords(symbol, startTime, endTime, execType, page, limit)
Get user's closed profit and loss records.
This will get user's closed profit and loss records.
// Import classes:
//import io.swagger.client.api.LinearPositionsApi;
LinearPositionsApi apiInstance = new LinearPositionsApi();
String symbol = "symbol_example"; // String |
Long startTime = 789L; // Long |
Long endTime = 789L; // Long |
String execType = "execType_example"; // String |
Long page = 789L; // Long |
Long limit = 789L; // Long |
try {
Object result = apiInstance.linearPositionsClosePnlRecords(symbol, startTime, endTime, execType, page, limit);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling LinearPositionsApi#linearPositionsClosePnlRecords");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
symbol | String | [optional] | |
startTime | Long | [optional] | |
endTime | Long | [optional] | |
execType | String | [optional] | |
page | Long | [optional] | |
limit | Long | [optional] |
Object
apiKey, apiSignature, timestamp
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json
Object linearPositionsMyPosition(symbol)
Get my position list.
This will get my position list.
// Import classes:
//import io.swagger.client.api.LinearPositionsApi;
LinearPositionsApi apiInstance = new LinearPositionsApi();
String symbol = "symbol_example"; // String |
try {
Object result = apiInstance.linearPositionsMyPosition(symbol);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling LinearPositionsApi#linearPositionsMyPosition");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
symbol | String | [optional] |
Object
apiKey, apiSignature, timestamp
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json
Object linearPositionsSaveLeverage(symbol, buyLeverage, sellLeverage)
Set leverage
This will Set Leverage
// Import classes:
//import io.swagger.client.api.LinearPositionsApi;
LinearPositionsApi apiInstance = new LinearPositionsApi();
String symbol = "symbol_example"; // String |
Double buyLeverage = 3.4D; // Double |
Double sellLeverage = 3.4D; // Double |
try {
Object result = apiInstance.linearPositionsSaveLeverage(symbol, buyLeverage, sellLeverage);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling LinearPositionsApi#linearPositionsSaveLeverage");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
symbol | String | [optional] | |
buyLeverage | Double | [optional] | |
sellLeverage | Double | [optional] |
Object
apiKey, apiSignature, timestamp
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
Object linearPositionsSetAutoAddMargin(symbol, side, autoAddMargin)
Set auto add margin
This will Set auto add margin
// Import classes:
//import io.swagger.client.api.LinearPositionsApi;
LinearPositionsApi apiInstance = new LinearPositionsApi();
String symbol = "symbol_example"; // String |
String side = "side_example"; // String |
Boolean autoAddMargin = true; // Boolean |
try {
Object result = apiInstance.linearPositionsSetAutoAddMargin(symbol, side, autoAddMargin);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling LinearPositionsApi#linearPositionsSetAutoAddMargin");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
symbol | String | [optional] | |
side | String | [optional] | |
autoAddMargin | Boolean | [optional] |
Object
apiKey, apiSignature, timestamp
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
Object linearPositionsSwitchIsolated(symbol, isIsolated, buyLeverage, sellLeverage)
Switch isolated
This will switch isolated
// Import classes:
//import io.swagger.client.api.LinearPositionsApi;
LinearPositionsApi apiInstance = new LinearPositionsApi();
String symbol = "symbol_example"; // String |
Boolean isIsolated = true; // Boolean |
Double buyLeverage = 3.4D; // Double |
Double sellLeverage = 3.4D; // Double |
try {
Object result = apiInstance.linearPositionsSwitchIsolated(symbol, isIsolated, buyLeverage, sellLeverage);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling LinearPositionsApi#linearPositionsSwitchIsolated");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
symbol | String | [optional] | |
isIsolated | Boolean | [optional] | |
buyLeverage | Double | [optional] | |
sellLeverage | Double | [optional] |
Object
apiKey, apiSignature, timestamp
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
Object linearPositionsSwitchMode(symbol, tpSlMode)
Switch Mode
This will Switch TP/SL Mode
// Import classes:
//import io.swagger.client.api.LinearPositionsApi;
LinearPositionsApi apiInstance = new LinearPositionsApi();
String symbol = "symbol_example"; // String |
String tpSlMode = "tpSlMode_example"; // String |
try {
Object result = apiInstance.linearPositionsSwitchMode(symbol, tpSlMode);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling LinearPositionsApi#linearPositionsSwitchMode");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
symbol | String | [optional] | |
tpSlMode | String | [optional] |
Object
apiKey, apiSignature, timestamp
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
Object linearPositionsTradingStop(symbol, side, takeProfit, stopLoss, trailingStop, tpTriggerBy, slTriggerBy, slSize, tpSize)
Set tradingStop
This will set tradingStop
// Import classes:
//import io.swagger.client.api.LinearPositionsApi;
LinearPositionsApi apiInstance = new LinearPositionsApi();
String symbol = "symbol_example"; // String |
String side = "side_example"; // String |
Double takeProfit = 3.4D; // Double |
Double stopLoss = 3.4D; // Double |
Double trailingStop = 3.4D; // Double |
String tpTriggerBy = "tpTriggerBy_example"; // String |
String slTriggerBy = "slTriggerBy_example"; // String |
Double slSize = 3.4D; // Double |
Double tpSize = 3.4D; // Double |
try {
Object result = apiInstance.linearPositionsTradingStop(symbol, side, takeProfit, stopLoss, trailingStop, tpTriggerBy, slTriggerBy, slSize, tpSize);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling LinearPositionsApi#linearPositionsTradingStop");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
symbol | String | [optional] | |
side | String | [optional] | |
takeProfit | Double | [optional] | |
stopLoss | Double | [optional] | |
trailingStop | Double | [optional] | |
tpTriggerBy | String | [optional] | |
slTriggerBy | String | [optional] | |
slSize | Double | [optional] | |
tpSize | Double | [optional] |
Object
apiKey, apiSignature, timestamp
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json