作者 karlet

feat:复制实例

... ... @@ -96,6 +96,19 @@ class CmBroker
}
$this->init();
}
//复制一个新的实例
public function copy()
{
$apiInfo = new ApiInfo($this->apiInfo->key, $this->apiInfo->secret, $this->apiInfo->passphrase);
$cmBroker = new CmBroker($this->plat, $apiInfo);
$cmBroker->symbolInfos = $this->symbolInfos;
$cmBroker->positions = $this->positions;
$cmBroker->name = $this->name;
$cmBroker->levers = $this->levers;
$cmBroker->uid = $this->uid;
$cmBroker->posMode = $this->posMode;
return $cmBroker;
}
public function setName($name)
{
$this->name = $name;
... ...