Live Streaming Historical Data

Discussion in 'Automated Trading' started by wackytacky, Nov 28, 2016.

  1. I have a small confusion-
    Please help me on this as I m little new to Automating trading
    I cant understand one thing -
    When i call historical data (be it of any interval), I get the data till that particular time. Suppose I assign it to a variable [spy= spy-OHLC for 5 min interval] and when I call spy, it will everythime give me same data. This is good for back testing.

    But when I want to trade in live market where I would require some historical data to apply logic and than take it to live amrket for 'that same Interval' how do I do it?
    Brokers' do provide WebSockets for live streaming data. But then it is simply TBT and not interval wise OHLC.
    What is the solution for this


    Thanks in advance
     
  2. suggest me the best and interesting Live Streaming Historical channel
     
  3. Live Streaming, I doubt.
    quantopian.com
     
  4. JackRab

    JackRab

    Wut? :confused:

    Are you confusing live streaming with a real time data feed? Don't you just need the current 5 min interval in addition to the historical ones?
     
  5. I mean ya. You are right. So where do I get the current 5 min interval?
     
  6. JackRab

    JackRab

    Through a real-time data feed... duh
     
  7. Real-Time Data Feed from a broker would give Tick Data and not OHLC
    Apart from I converting TD to OHLC, is there any other way?
     
  8. JackRab

    JackRab

    OHLC is easy to build.

    Open is first tick in current 5 min interval
    High is either current price if higher than previous ticks in the current 5min interval
    Low is similar
    Close is current price...

    That's the way the current 5 min candle/bar etc is build.
     
  9. But how to go about building the OHLC?
    I mean The data that we receive from Broker end which is live and streaming, how shall we take it and where?
    Can you help me the code plz?
     
  10. MarcG

    MarcG

    Better you start with basics of programming.
    The most basic solution: Use an array with certain type of structures/objects for historical OHLC and one separate structure, which might be of identical type to the structures/objects in the array to store your current bar, as suggested by JackRab. When done (next OHLC bar), append/insert at end it to array.
     
    #10     Nov 30, 2016