2017-07-16 54 views
1

API AddOrder()命令是否支持expiretm限制订单?当我设置这个参数时,我总是得到一个EGeneral:Invalid arguments:expiretm错误。Kraken Exchange API:AddOrder的expiretm参数

我想从现在到期3秒钟,进行如下设置:

1) expiretm = 3    # int 
2) expiretm = "+3"   # string 
3) expiretm = 1500226507 # int 

没有运气,都返回提到的错误。只接受expiretm = 0

  • expiretm是否支持限价订单?
  • 哪个语法是正确的:(1)或(2)?

THX

+0

我试过同样的事情。当前时间+ 90秒正常。看起来像克拉肯禁止几秒钟后到期的订单放置。很蹩脚。 Kraken很可爱。使用别的东西。 – enigmaticPhysicist

回答

1

我使用expiretm过我的订单上。这里有一个例子:

$res = $kraken->QueryPrivate('AddOrder', array(
    'pair' => $pair, 
    'type' => 'buy', 
    'ordertype' => 'limit', 
    'price' => $price, 
    'volume' => $volume, 
    'expiretm' => '+180' 
)); 
+0

我不是OP,但我有同样的问题,并添加''解决了这个问题。 –

0

两个expiretm = 1500226507expiretm = '1500226507'是正确的。但是您必须确保1500226507大于当前的unix时间。另外,请确保您使用的符号正确。犯错误太容易了。一个正确的用法可能是,比如说

currentUnixTime = 1500226507 
// set expiretm to a min from now 
expirationTime = 1500226567 // notice the last two digits 

blablabla{AddOrder{'pair: 'x', 'price: 'xx', 'volume: 'xxx', 'type: 'y', 'expiretm: expirationTime}}; 

顺便说一句,这是为nodejs。