IG Store: Store Development.



  • Hello All,
    A long time ago I asked a question about how to integrate our broker of preference. I am personally interested in integrating IG markets for spread betting and CFD's.

    https://community.backtrader.com/topic/459/store-development

    I finally found some time this week to have a crack at it and have made a small milestone with basic data streaming. I thought it might be worth sharing should others be looking at doing a similar thing. The code and a sample script are available on Github.

    https://github.com/Dave-Vallance/bt-ig-store

    Comments and collaboration welcome if anyone else is interested in live trading with IG.



  • I am moving at a glacial pace on this side project but I have a couple of new miles-stones that I think are worth mentioning here. I see some others are interested in store development so maybe we can help each other out in understanding the inner workings. If you have any questions I am happy to share more (potentially wrong) knowledge. :)

    Current Status

    • Streaming (Integrated the trading_ig streamer into the store and created an IG data feed to load the ticks)
    • New: IG Broker: Performs the open position check when initialized to track existing positions
    • New: Opening and closing of simple Market orders using the self.buy() and self.close() is now supported.
    • New: Set IG currency code as a store initialization parameter (Default GBP).

    Still a very dirty development with lots of Oandastore methods that may or may not be needed. My aim is to only keep what is needed but am I not familiar enough with the inner workings yet. Will clean up as I learn more.

    Known Issues

    • On my MAC i get a 'fund mode' attribute error from the broker observer when running cerebro. Oddly enough on my Windows work machine, this does not happen. If you try to run the store and get a similar error, cerebro needs to be initialized with stdstats=false for now until I fix it.


  • New update today: Slow but steady progress

    Current Status

    • Basic instrument streaming
    • Performs the open position check when initialized to track existing positions
    • Opening and closing of simple Market orders using the self.buy() and self.close() is now supported.
    • Set IG currency code as a store initialization parameter (Default GBP).
    • New: Stop order creation and cancellation supported.
    • New: Limit order creation and cancellation supported.
    • New: expiry, guaranteed_stop, time_in_force, and good_till_date parameters
      can now all be passed as key word arguments during order creation and handled
      appropriately. Defaults are used where no kwarg is passed.

    New Issue

    _Value for header {Version: 2} must be of type str or bytes, not <class 'int'>_

    If you see it, you should make sure you have the latest trading_ig module code which this store relies upon.



  • New Update Today:

    Current Functionality

    • Basic instrument streaming
    • Performs the open position check when initialized to track existing positions
    • Opening and closing of simple Market orders using the self.buy() and self.close() is now supported.
    • Set IG currency code as a store initialization parameter (Default GBP).
    • Stop order creation and cancellation supported.
    • Limit order creation and cancellation supported.
    • expiry, guaranteed_stop, time_in_force, and good_till_date parameters
    • New: Improved streamer setup. Can use the same streamer for multiple get_instruments rather than creating multiple streamers
    • New: Manual pull of cash and value
    • New: Account cash and value live streaming
    • FIX: Level Set during order creation caused MARKET Orders to be rejected can now all be passed as key word arguments during order creation and handled appropriately. Defaults are used where no kwarg is passed..

Log in to reply
 

Looks like your connection to Backtrader Community was lost, please wait while we try to reconnect.