|
...
|
...
|
@@ -286,4 +286,25 @@ class ExBroker |
|
|
|
}
|
|
|
|
return $levers;
|
|
|
|
}
|
|
|
|
//设置杠杆
|
|
|
|
public function setLever($instId, $lever)
|
|
|
|
{
|
|
|
|
$param = [
|
|
|
|
'instId' => $instId,
|
|
|
|
'lever' => $lever,
|
|
|
|
'mgnMode' => 'cross',
|
|
|
|
];
|
|
|
|
$res = $this->api->setLeverage($param);
|
|
|
|
if ($res && $res['code'] == 0) {
|
|
|
|
output($instId, '设置杠杆为:', $lever);
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
$msg = $res['msg'];
|
|
|
|
if ($res["data"] && $res["data"]["msg"]) {
|
|
|
|
$msg = $res["data"]["msg"];
|
|
|
|
}
|
|
|
|
output($instId, '设置杠杆错误', $msg);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|