Amibroker与IB如何自动交易

Discussion in 'AmiBroker' started by qichxi, Dec 22, 2008.

  1. 我现在的阶段:
    1)amibroker与Ib连接可以看实时数据
    2)IB controller也注册了unclock code.
    3)交易系统也有了.

    就是找不到什么按钮是开始执行交易系统的.

    请哪位指点一点.

    WLD虽然比较慢,但是和IBDATA2连接以后,下单挺简单的.不象amibroker找不到方向.
     
  2. IB 没有按钮,需要自己编程实现自动交易的。详细可以看看IB CONTROLLER 的说明书。
     
  3. 有没有现成的程序呢?

    我编程太差了,不是学这个的.

    现在我已经可以用IB和WLD进行下单了,但是问题是每一次下单都要确认一下.而且感觉WLD有点慢.

    Amibroker,我就不知道如何下单...

    我是高频交易,没有自动下单要累死的.
     
  4. 看到josean的旧帖,可能回答是这个:
    method for autotrading multiple tickers. I haven't tried it with 800 tickers, but it may be adequate.

    Create the Autotrading AFL as an Exploration rather than as an Indicator. Then use the "Run Every" checkbox to run the Exploration every X seconds. Depending on how quickly you think you need to react to ticks in your 5 minute chart, you could use Run Every 5 seconds or Run Every 1 minute, for example.

    This way, you can easily issue orders for a large list of tickers without creating a chart for each one and it minimises performance issues.

    I found that it was also necessary to insert a pause in the AFL code after each new order to allow TWS to process each order before attempting a new order, because of the TWS message per second constraints. In an exploration, it's acceptable to have such a pause whereas in an indicator it might be more problematic.

    Secondly, I keep it fairly simple by placing a new order with its attached bracket orders for stop loss and profit taking, so all of the order handling for a new signal is taken care of during a single pass through the exploration. Otherwise, the coding will get much more complex in terms of tracking the status of open orders, and taking appropriate action in AFL code as the order progresses, using status variables.
     
  5. 又一joean旧贴:
    AB+IBcontroller+TWS传送Order?

    我也是这一步,但怎么发送order?有没有现成的程序?
     
  6. 楼上这个链接不错的,有很多现成的例子。 AMIBROKER的指标编程并不难,和tradestation 等差不多。自动交易部分编程稍复杂,但是ATS infrastructure 是一次性的努力,值得下功夫。
     
  7. 会者不难,对我没有基础的人来将,要从C语言开始学起了....最好有现成的,改改
     
  8. 谢谢,尝试一下~

    顺便说一下,IBDATA2可以获取完整的历史数据.这点比Amibroker强
     
  9. 能获取的数据长度是TWS 服务器上存放的数据长度决定的,IBDATA2 最长好像只能获取半年的数据吧。
     
  10. 至少,我可以收到一个合约执行期的全部一分钟数据.

    这是我实践中发现的,呵呵.而Amibroker只能收IB规定的限制的数量.
     
  11. 你说的是哪个合约啊?执行期是多久呢? AMIBROKER 不能收全它的数据吗?
     
  12. amibroker只能收IB规定的bar,比如1分钟可以收多少,5分钟可以收多少个.
    IBdata没有限制.不知道为什么,也是我无意间发现的.
     
  13. 你有空的时候可以试试1.8 版本以上的 ib.dll plugin, 可以收到180天的一分钟数据(只要IB服务器上有)。 做外汇还是蛮方便的。
     
  14. 呵呵,好的.谢谢
     
  15. 用AB来做自动交易系统,想要精确控制发单是比较困难的。如果已经有策略了,建议试下OpenQuant或RightEdge。
     
  16. 我觉得可以啊,15秒以上的周期里,实时自动modify order 基础上(不是 mkt order 基础上)的交易系统运行得还是蛮流畅。 5秒的就不好说了,除非是专线连交易所。
     
  17. 谢谢楼上两位的意见,都是宝贵经验啊~~
     
  18. 请问Joesan目前你用AB是全自动交易么?
    当一个买卖条件成立时,如何触发你的IBC.PlaceOrder?如何保证不会多发Order?如何确保Order的成交?
    我在用AB与IB连接用Paper account测试的时候会多发Order。我倾向于用5分钟线,在一个BAR里面如何保证不会重复发送Order?

    请不吝指教。谢谢。

    我目前在测试OQ,OQ用事件的方式来处理。