Skip to content

Option based trading - subscribe function throwing error #2

@assistuelectronics

Description

@assistuelectronics

My code is like below

alice = Aliceblue(user_id='',api_key='')
session_id = alice.get_session_id()
alice.get_contract_master("NFO")

symbol_cepe = alice.get_instrument_for_fno(exch="NFO", symbol='NIFTY', expiry_date="2023-01-12", is_fut=False, strike=18000, is_CE=True)

alice.subscribe(symbol_cepe)

Is throwing below error: What wrong I am doing
line 582, in main
alice.subscribe(symbol_cepe)

line 728, in subscribe
scripts=scripts+__instrument.exchange+"|"+str(__instrument.token)+"#"
AttributeError: 'str' object has no attribute 'exchange'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions