繁簡切換您正在訪問的是FX168財經網,本網站所提供的內容及信息均遵守中華人民共和國香港特別行政區當地法律法規。

FX168财经网>人物频道>帖子

float infinity to integer

作者/我是小编 2019-08-02 10:38 0 来源: FX168财经网人物频道

//测试代码如下:
from jqdata import *
import random

def initialize(context):
set_subportfolios([SubPortfolioConfig(cash=context.portfolio.starting_cash, type='futures')])
run_daily(run_time, time='09:00')

def run_time(context):
orderinfo = order('CJ1912.XZCE', amount=6, side='short')

//设置
2019-07-22 到 2019-07-31, ¥1000000, 每天

//报错
2019-07-22 09:00:00 - INFO - 订单已提交:FuturesOrder(entrust_id=1564712581 security=CJ1912.XZCE mode=OrderAmount: _amount=6 style=MarketOrderStyle: _limit_price=0.0 side=short action=open margin=False entrust_time=2019-07-22 09:00:00 error=)

2019-07-22 09:00:00 - WARNING - /tmp/jqcore/jqboson/jqboson/account/base.py:1817: RuntimeWarning: divide by zero encountered in double_scalars
(trade_price multiplier margin_rate))

2019-07-22 09:00:00 - ERROR - Traceback (most recent call last):
File "/tmp/jqcore/jqboson/jqboson/core/entry.py", line 368, in _run
engine.start()
File "/tmp/jqcore/jqboson/jqboson/core/engine.py", line 232, in start
self._dispatcher.start()
File "/tmp/jqcore/jqboson/jqboson/core/dispatcher.py", line 273, in start
self._run_loop()
File "/tmp/jqcore/jqboson/jqboson/core/dispatcher.py", line 240, in _run_loop
self._loop.run()
File "/tmp/jqcore/jqboson/jqboson/core/loop/loop.py", line 84, in run
self._handle_queue()
File "/tmp/jqcore/jqboson/jqboson/core/loop/loop.py", line 124, in _handle_queue
message.callback(message.callback_data)
File "/tmp/jqcore/jqboson/jqboson/core/dispatcher.py", line 110, in callback
self._event_bus.emit(evt)
File "/tmp/jqcore/jqboson/jqboson/core/bus.py", line 47, in emit
ret.append(call(event))
File "/tmp/jqcore/jqboson/jqboson/core/strategy.py", line 376, in _wrapper
return cb(self._context.strategy_environment.strategy_context,
cb_kwargs)
File "/tmp/strategy/user_code.py", line 10, in run_time
orderinfo = order('CJ1912.XZCE', amount=6, side='short')
File "/tmp/jqcore/jqboson/jqboson/api/account.py", line 121, in order
account, security, mode, style, side, entrust_time=entrust_time, close_today=close_today)
File "/tmp/jqcore/jqboson/jqboson/account/account_manager.py", line 627, in request_order
**kwargs)
File "/tmp/jqcore/jqboson/jqboson/account/broker.py", line 289, in submit_order
return account.submit_order(order)
File "/tmp/jqcore/jqboson/jqboson/account/base.py", line 1969, in submit_order
if not self.entrust_order(order):
File "/tmp/jqcore/jqboson/jqboson/account/base.py", line 2004, in entrust_order
ret = self.check_entrust_order(order)
File "/tmp/jqcore/jqboson/jqboson/account/base.py", line 1940, in check_entrust_order
new_amount = self.check_order(order, real_amount)
File "/tmp/jqcore/jqboson/jqboson/account/futures.py", line 222, in check_order
amount = super(FuturesAccount, self).check_order(order, amount)
File "/tmp/jqcore/jqboson/jqboson/account/base.py", line 1819, in check_order
aval_amount = int(aval_amount)
OverflowError: cannot convert float infinity to integer

分享到:
举报财经168客户端下载

全部回复

0/140

投稿 您想发表你的观点和看法?

更多人气分析师

  • 张亦巧

    人气2184文章4145粉丝45

    暂无个人简介信息

  • 梁孟梵

    人气2176文章3177粉丝39

    qq:2294906466 了解群指导添加微信mfmacd

  • 指导老师

    人气1864文章4423粉丝52

    暂无个人简介信息

  • 李冉晴

    人气2320文章3821粉丝34

    李冉晴,专业现贷实盘分析师。

  • 王启蒙现货黄金

    人气296文章3135粉丝8

    本人做分析师以来,并专注于贵金属投资市场,尤其是在现货黄金...

  • 张迎妤

    人气1896文章3305粉丝34

    个人专注于行情技术分析,消息面解读剖析,给予您第一时间方向...

  • 金泰铬J

    人气2328文章3925粉丝51

    投资问答解咨询金泰铬V/信tgtg67即可获取每日的实时资讯、行情...

  • 金算盘

    人气2696文章7761粉丝125

    高级分析师,混过名校,厮杀于股市和期货、证券市场多年,专注...

  • 金帝财神

    人气4760文章8329粉丝119

    本文由资深分析师金帝财神微信:934295330,指导黄金,白银,...

FX168财经

FX168财经学院

FX168财经

FX168北美