How to Work on lookback period(Intraday) using iBridgePy

 iBridgePy history function always points to last days(starting from yesterday) and back but not any lookback period on the current day. Lets say, if i'm working with a strategy and wanna place an order intraday, then i need to work on last ‘n’ bars in the look back period for a aggregation period, here lets say 10mins and my current day RSI is above 40 and with a positive MACD crossover. So i need to look history intraday and not going back to yesterday's data. Eg: Place order on 1Min/2Min timeframe intraday when MACD crossover(10M mv8 crosses above 10M mv21) with RSI > 50(agg period = 10M).

Hey Kris,



Here's a link that will guide you on how you can use IBridgePy to request historical data in various frequencies such as 1 min, 2 mins, 3 mins, 5 mins, 15 mins, 30 mins, 1 hour, 1 day.



Additionally, do check out the webinar on Backtesting and Live Trading Algorithmic Strategies with Interactive Brokers using Python, linked here.



This webinar will be very helpful to you as it covers topics such as:

  • Basic steps to building a trading strategy.
  • Backtesting strategies using IB's historical data.
  • Backtesting strategies using user-supplied data.
  • Analysing backtest results.



    I hope this helps!