问题标签 [ibrokers]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
541 浏览

r - R IBrokers (Interactive Brokers API)

任何人都知道如何使用algoStrategy和使用algoParamsIBrokers 包吗?我尝试创建一个列表algoParams但徒劳无功。

例如:

我的订单原来是市价单。algoStrategy因此,我假设我的输入algoParams被忽略了。如果这里有人可以提供帮助,我将不胜感激。谢谢!

0 投票
0 回答
224 浏览

r - Using reqMktDepth for trading in R

I am trying to test an intraday trading strategy using R, and I found the IBrokers API package that sends orders to Interactive Brokers TWS platrform, which would be perfect for me. Unfortunately my programming skills aren´t good enought to get the job done!

In any case, my strategy would be looking at the market depth placing orders above and below the market at prices that depend on the size of the bids and ask.

From what I have learned until now, I beleive the reqMktDepth function creates an infinite loop that updates the bids and asks through the twsCALLBACK.

What I tried to do is to create a function, called callback.intraday that does my trading strategy and subsequently calls the twsCALLBACK, from what I understood I should use the reqMktDepth and use my function inside it.

Below is the code of my function:

I still haven´t tested the sending the orders into the market since I am still stuck with the loop.

Below is the code that I am running and getting an "unused arguments" error.

Thanks for the help

Augusto

0 投票
1 回答
400 浏览

java - 提交 twsOrder 时的 R IBrokers algoStrategy 选项

我正在尝试使用 Interactive Brokers 的自适应算法。似乎 R 的 IBrokers 包(https://cran.r-project.org/web/packages/IBrokers/IBrokers.pdf - pg37 和 38 )没有完成,因为当我执行下面的代码时我的订单没有通过.

我在 GitHub ( http://interactivebrokers.github.io/tws-api/ibalgos.html ) 上找到了 JAVA、Python、C# 和 C++ 的 API 指南。我想知道是否有人知道如何将代码转换为 R。

Java的例子,

0 投票
2 回答
2498 浏览

r - 将三重嵌套列表转换为数据框

我正在尝试将三重嵌套列表转换为数据框。这个问题有帮助,但我无法获得我想要的数据框。

该列表是从 IBrokers 获得的期权链,摘要如下所示。我在这里上传了更详细的实际链。

我想将列表转换为这样的数据框:

我尝试了这段代码,但它没有给我想要的数据框。

请问有什么建议吗?

0 投票
0 回答
648 浏览

r - IBrokers 启用延迟市场数据?

我正在尝试从 IBrokers 下载数据,但目前出现错误。我不知道如何解决它。

注意:我没有订阅实时报价,但我确实收到了延迟的市场数据。

我的步骤是:

1

错误输出:

TWS 消息:2 1 162 历史市场数据服务错误消息:没有 ISLAND STK TWS 的市场数据许可消息:2 1 366 未找到代码 id 的历史数据查询:1 TWS 消息:2 1 10168 未订阅请求的市场数据。未启用延迟的市场数据

历史数据功能似乎也有问题。

我也试过链接中的例子

结果:

等待交易平台对 IBKR 的回复 ....失败。NULL 警告消息:在 errorHandler(con, verbose, OK = c(165, 300, 366, 2104, 2106, :
历史市场数据服务错误消息:没有 ISLAND 的市场数据权限

0 投票
1 回答
236 浏览

r - IBrokers 在中间下订单

我正在尝试使用 R 和 IBrokers 以及模拟交易账户来提出一些想法。我正在考虑通过 R 下订单,但想知道是否有一种简单的方法可以以中等价格下订单,因为我不希望总是以买价和卖价进行买卖。

我相信我正在寻找的是一个挂钩到中点的订单(https://www.interactivebrokers.com/en/index.php?f=1058)。在 IBrokers 包的 R 文档中,我没有将其视为订单类型。有谁知道这是否可行?

0 投票
0 回答
23 浏览

portfolio - 使用IBroker 包持续订阅投资组合数据?

我尝试使用 reqUpdateAccounts,但它只是一个快照。我想持续监控投资组合。我了解 .reqUpdateAccounts 可以订阅投资组合数据,但不知道如何正确呈现和处理数据?我知道这可能是非常基本的,但我对 R 不熟悉,也没有找到一个很好的例子。有人可以提供一种使用 IBrokers 持续监控投资组合数据的好方法吗?谢谢。

0 投票
1 回答
448 浏览

r - 如何在 R 中使用 IBrokers 获取 SPX 的最新期权价格

我正在尝试使用以下代码获取给定行使价 (2700) 和到期 (15/11/2018) 的 SPX 期权看跌期权价格:

下面报告了两个函数 eWrapper.data.Last 和 snapShot。

我明白了:

2 -1 2104 Connessione con il Server dei dati di mercato è OK:usfuture

2 -1 2104 Connessione con il Server dei dati di mercato è OK:eufarm

2 -1 2104 Connessione con il Server dei dati di mercato è OK:usopt

2 -1 2104 Connessione con il Server dei dati di mercato è OK:usfarm.us

2 -1 2106 Connessione con il HMDS 数据场 è OK:euhmds

2 -1 2106 Connessione con il HMDS 数据场 è OK:ushmds

2 1 10090 Parte dei dati di mercato richiesti non sono sottoscritti。Tick indipendenti dalle sottoscrizioni sono ancora attivi.Dati di mercatodifferiti non disponibili.SPX S&P 500 Stock Index/TOP/ALL

连接似乎有效,但没有创建任何对象。

0 投票
1 回答
337 浏览

r - 如何通过 IBrokers 请求延迟的市场数据

有没有一种方法可以请求延迟的市场数据,如TWS API v9.72+ 所述:市场数据类型

我特别在寻找设置client.reqMarketDataType(3);

这篇文章在 python 中工作,但我想在 R 中使用IBrokers

谢谢!

0 投票
1 回答
197 浏览

error-handling - 如何处理来自 reqMktData 调用的错误

网络上有没有使用 IBrokers软件包从 Interactive Brokers 下载数据时如何处理错误的示例?我已经查看了包裹的详细信息,eWrapper并且twsCALLBACK似乎可以处理这个问题,但我无法让它们工作。例如,下面的代码产生错误并且 R 挂起,错误消息未处理。感谢您的任何建议。