Backtesting IBridgePy / Interactive Brokers

Hi wonder if anyone out there can shed some light on this problem of getting pricing data, I'm trying to download the pricing data for backtesting purposes from Interactive Brokers following the IBridgePy course, the Interactive brokers platfrom is thowing an error message:

I managed to connect to the broker and send some basic requests but getting the pricing from a specific UK exchange (Quantra's blueshift wont work) is a problem.

Some of the functionality on the IBridgePy video tutorial doesn't seem to work, apperantly we have to put quite a sum of money on the acocunt to get the pricing data, after speaking to interactive brokers support team there seems to be an option for free delayed pricing data but I can’t seem to get it to work. 

There are no explanations on the IBridgePy course on this which doesnt really help the flow of learning.  The final option resolution from interactive brokers is to fund the account with 2000 USD, wondering if anyone can throw some light on this issue to help with an alternative option allowing a continuation of the couse study without breaking the bank!!

Kind Regards

Alex

Error message for histoical and pricing data below:

IBridgePy version 5.2.3
fileName = example_get_historical_data.py
####    Starting to initialize trader    ####
..............................................
####    Initialize trader COMPLETED    ####
Historical Data of STK,SPY,USD
broker_client_factory.CallBacks:errorId=13 errorCode=162 errorMessage=Historical Market Data Service error message:No market data permissions for AMEX STK
broker_client_factory.CallBacks:EXIT IBridgePy version = 5.2.3
An exception has occurred, use %tb to see the full traceback.

SystemExit

If you are using a demo account while fetching the data, then you will not have access at all the tickers. Your access will be limited to Forex pairs mostly. In such a case, try the below code to fetch the data.

 

import pandas as pd
import datetime as dt

def initialize(context):
    context.run_once=False 
    context.security=symbol('CASH,EUR,USD')
    
def handle_data(context, data):
    sTime=get_datetime() 
    print(sTime)   
    data=request_historical_data(context.security, '1 min', '1000 S')
    print(data.head())
    end()
 
 
I do understand your concern of the UK tickers data not available and only certain dataset is available for free with IB. I recommend that you practise and get comfortable with the automation on forex pairs data which is available for free.
 
Could you please highlight which functionality is not working and we will check and inform the package author Dr. Hui Liu.

Cheers

Thank you for the update Dr Lui, I will certainly take up your recomendation, I have managed to retrieve the data as you have specified in the code to see how I get along with testing some strategies with the currency pairs as the test data.



Kind Regards



Alex