Get the copy settings defined for your trade copier accounts.
URL: https://www.trade-copier.com/webservice/v4/settings/getSettings.php
The request may specify an optional filter to only retrieve settings for a certain master and/or slave or group
Response: JSON object list
| Field Name | Field Type | Field Description |
|---|---|---|
| date | string | Datetime of the last time the setting was updated |
| id_master | string | Unique identifier of the master account |
| id_slave | string | Unique identifier of the slave account. Empty if it has a template ID |
| id_group | string | Unique identifier of the template. Empty if it has a slave ID |
| master_name | string | Name of the master account |
| slave_name | string | Name of the slave account |
| group_name | string | Name of the template |
| risk_factor_value | float | Value of the risk factor |
| risk_factor_type | int | RiskFactor type or not defined: 0: Auto Risk (Equity) 1: Auto Risk (Balance) 2: Auto Risk (Free Margin) 3: Multiplier (Notional) 4: Fixed Lot 5: Fixed Leverage (Equity) 6: Fixed Leverage (Balance) 7: Fixed Leverage (Free Margin) 10: Fixed Units 11. Multiplier(Lot) |
| risk_factor_type_string | string | Meaning of the risk factor type |
| order_side | int | -1 = sell only, 1 = buy only |
| max_order_size | float | Maximum order size |
| min_order_size | float | Minimum order size |
| copier_status | int | Status of the setting on the trade copier. See row underneath for codes |
| copier_status_string | string | Meaning of the copier status. -1 = close only, 0 = frozen, 1 = on, 2 = open only |
| symbol_master | string | Symbol on the master's broker |
| symbol | string | Symbol on the slave's broker |
| pending_order | int | Enable/disable copying on pending orders. 0 = off, 1 = on |
| stop_loss | int | 0 = off, 1 = on, 2 = on with updates |
| stop_loss_fixed_value | float | |
| stop_loss_fixed_format | int | 0 = %, 1 = amount, 2 = pips, 3 = decimal |
| stop_loss_min_value | float | |
| stop_loss_min_format | int | 0 = %, 1 = amount, 2 = pips, 3 = decimal |
| stop_loss_max_value | float | |
| stop_loss_max_format | int | 0 = %, 1 = amount, 2 = pips, 3 = decimal |
| take_profit | int | 0 = off, 1 = on, 2 = on with updates |
| take_profit_fixed_value | float | |
| take_profit_fixed_format | int | 0 = %, 1 = amount, 2 = pips, 3 = decimal |
| take_profit_min_value | float | |
| take_profit_min_format | int | 0 = %, 1 = amount, 2 = pips, 3 = decimal |
| take_profit_max_value | float | |
| take_profit_max_format | int | 0 = %, 1 = amount, 2 = pips, 3 = decimal |
| trailing_stop_value | float | |
| trailing_stop_format | int | 0 = %, 1 = amount, 2 = pips, 3 = decimal |
| max_risk_value | float | |
| max_risk_format | int | 0 = %, 1 = amount, 2 = pips, 3 = decimal |
| comment | string | |
| max_slippage | float | Max slippage in pips |
| max delay | float | Max delay in seconds |
| force_min_round_up | int | |
| round_down | int | |
| split_order | int | |
| price_improvement | float | Price improvement in pips |
| max_position_size_a | float | |
| max_position_size_s | float | |
| max_position_size_a_m | float | |
| max_position_size_s_m | float | |
| max_open_count_a | int | |
| max_open_count_s | int | |
| max_open_count_a_m | int | |
| max_open_count_s_m | int | |
| max_daily_order_count_a | int | |
| max_daily_order_count_s | int | |
| max_daily_order_count_a_m | int | |
| max_daily_order_count_s_m | int | |
| global_stop_loss | int | 0 = off, 1 = on |
| global_stop_loss_value | float | |
| global_stop_loss_type | int | 0 = close only, 1 = sell out, 2 = freeze |
| global_take_profit | int | 0 = off, 1 = on |
| global_take_profit_value | float | |
| global_take_profit_type | int | 0 = close only, 1 = sell out, 2 = freeze |
PHP example
<?php
echo "<link rel='stylesheet' type='text/css' href='https://www.trade-copier.com/webservice/example.css'>";
$url="https://www.trade-copier.com/webservice/v4/settings/getSettings.php";
$headers = array(
'Content-Type: application/x-www-form-urlencoded',
'Authorization: Bearer [[TOKEN]]',
);
// Open connection
$ch = curl_init();
// Setting the options
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
//Filter can specify a mix of fields, they are all optional
$filter = ['id_slave' => "ABC", 'id_master' => "DEF"];
//$filter = ['id_slave' => "ABC"];
//$filter = ['id_group' => "GHI"];
//$filter = [];
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($filter));
// Execute request
$json = json_decode(curl_exec($ch));
// Close connection
curl_close($ch);
//We access the settings list
if(array_key_exists('settings', $json)) {
echo '<table id="api_data">';
foreach($json->settings as $row) {
foreach($row as $key => $val) {
echo '<th>'.$key.'</th>';
}
break;
}
foreach($json->settings as $setting) {
echo '<tr>';
foreach($setting as $key => $val) {
echo '<td>'.$val.'</td>';
}
echo '</tr>';
}
echo '</table>';
} else {
//This is an error message that can be access like this:
//echo $json->code." ".$json->error;
echo json_encode($json);
}
?>