Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to get historical candle for index #34

Open
agrsanjay opened this issue Jan 2, 2022 · 1 comment
Open

Not able to get historical candle for index #34

agrsanjay opened this issue Jan 2, 2022 · 1 comment

Comments

@agrsanjay
Copy link

    PARAMS = {
        'candletype': 1,
        'data_duration': interval,
        'starttime': start_time,
        'endtime': end_time,
        'exchange': exchange + idx,
        'type': 'all',
        'token': instrument.token,
        'name': instrument.symbol
    }

in you package in the function get_historical_candles params value should be in this format

@darshshravge
Copy link

darshshravge commented Mar 8, 2022

sas = AlphaTrade(login_id=config.login_id, password=config.password, twofa=config.twofa,
access_token=config.access_token, master_contracts_to_download=['NSE'])

    nifty_bank_nse_index = sas.get_instrument_by_symbol('NSE', 'Nifty Bank')
    df = sas.get_historical_candles(nifty_bank_nse_index.exchange, nifty_bank_nse_index.symbol,
                                    datetime(2022, 3, 7, 9, 15, 0), datetime(2022, 3, 8, 15, 29, 0), interval=1,
                                    is_index=True)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants