akapur / pyiqfeed

Python LIbrary for reading DTN's IQFeed
GNU General Public License v2.0
172 stars 109 forks source link

process_history_bar() #46

Closed blonc closed 4 years ago

blonc commented 4 years ago

I'm not seeing a clear path to access process_history_bar() to actually process the returned array. could you please at the needed function to this piece of code from the example calling the function to process the history bar :

def get_live_interval_bars(ticker: str, bar_len: int, seconds: int):
    """Get real-time interval bars"""
    bar_conn = iq.BarConn(name='pyiqfeed-Example-interval-bars')
    bar_listener = iq.VerboseBarListener("Bar Listener")
    bar_conn.add_listener(bar_listener)

    with iq.ConnConnector([bar_conn]) as connector:
        bar_conn.watch(symbol=ticker, interval_len=bar_len,
                       interval_type='s', update=60, lookback_bars=5)
        bar_listener.process_history_bar(bar_conn.)
        time.sleep(seconds)

thank you

akapur commented 4 years ago

I don't understand your question.

On Mon, Apr 27, 2020 at 10:08 AM Mathew Blonc notifications@github.com wrote:

I'm not seeing a clear path to access process_history_bar() to actually process the returned array. could you please at the needed function to this piece of code from the example calling the function to process the history bar :

def get_live_interval_bars(ticker: str, bar_len: int, seconds: int): """Get real-time interval bars""" bar_conn = iq.BarConn(name='pyiqfeed-Example-interval-bars') bar_listener = iq.VerboseBarListener("Bar Listener") bar_conn.add_listener(bar_listener)

with iq.ConnConnector([bar_conn]) as connector:
    bar_conn.watch(symbol=ticker, interval_len=bar_len,
                   interval_type='s', update=60, lookback_bars=5)
    bar_listener.process_history_bar(bar_conn.)
    time.sleep(seconds)

thank you

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/akapur/pyiqfeed/issues/46, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGJAVDJ5QCDNC27EYB5FH3ROWGVLANCNFSM4MR6UF2A .

blonc commented 4 years ago

cannot seem to override the def process_history_bar(self, bar_data: np.array) inside of def get_live_interval_bars to actually process the array vs just printing to command. the above snippet works fine to simply output to command and I know that I need to override the function process_history_bar or process_live_bar to manipulate in real-time but can not seem to be able to do so. Could you update the small snippet to show how you are overriding the process function? Also, did you get access to IQ feed?

blonc commented 4 years ago

resolved -thanks

emilge commented 4 years ago

@blonc Hey, could you share how you resolved this ? I have the same issue