krishnavelu / alice_blue

Official Python library for Alice Blue API trading
GNU General Public License v3.0
134 stars 82 forks source link

Is there any api available to get candlestick data #26

Closed Jeyanthinath closed 4 years ago

Jeyanthinath commented 4 years ago

Hi is there any api available to get historical candle data for 5 minutes and 15 minutes.

Parva14 commented 4 years ago

@Jeyanthinath Not Really, Zerodha does provide a historical API for getting candlestick data but No API streams Candlestick data in real time, you will have to re-sample the ticks to generate candles of specific timeframe on your local system only.

krishnavelu commented 4 years ago

Alice-blue doesn't provide historical data. Historical data are provided by upstox & zerodha.

PSAlmighty commented 4 years ago

Is there any sample code available to recreate candlestick using websocket data?

amit-kumar27742 commented 4 years ago

If you dont want to write more lines of code, most simplest way is to store every tick in a dataframe and use the resample function.

https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.resample.html

krishnavelu commented 4 years ago

If you understand what is candle stick you can easily recreate using tick data. Candle stick is nothing but OHLC, open, high, low, close. Store the tick data in a list (as per the time frame you want).

open = lst[0] high = max(lst) low = min(lst) close = lst[-1]

krishnavelu commented 4 years ago

Hope this is answered. Reopen if you need something else related to this question.

mallinlr commented 4 years ago

sir, Can you please provide code snippet to get OHLC data for a stock.

krishnavelu commented 4 years ago

I've explained above, how to get OHLC.

mallinlr commented 4 years ago

Sir, this is half code, can you please write what should be above lst[0],

open = lst[0] high = max(lst) low = min(lst) close = lst[-1]

krishnavelu commented 4 years ago

If you understand what is candle stick you can easily recreate using tick data. Candle stick is nothing but OHLC, open, high, low, close. Store the tick data in a list (as per the time frame you want).

Yes it’s half code. I cannot write code for your application. You’ve to write your own. lst is list

mallinlr commented 4 years ago

Hi Sir,

Is there any sample script to access aliceblue Oauth2 access, please let me know.

Thank you Mallikarjuna M

On Mon, May 18, 2020 at 12:25 AM Krishna Velu notifications@github.com wrote:

If you understand what is candle stick you can easily recreate using tick data. Candle stick is nothing but OHLC, open, high, low, close. Store the tick data in a list (as per the time frame you want).

Yes it’s half code. I cannot write code for your application. You’ve to write your own. lst is list

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/krishnavelu/alice_blue/issues/26#issuecomment-629843886, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMMJIXY3EEA5YHXDKQKBY2LRSAXJ3ANCNFSM4JUY65YA .

krishnavelu commented 4 years ago

What do you mean by alice blue Oauth2 access?

sasi143 commented 4 years ago

@krishnavelu Is there any way we can get the last one month data?

krishnavelu commented 4 years ago

Alice blue doesn’t provide historical data.

SanketGanvir commented 4 years ago

If you dont want to write more lines of code, most simplest way is to store every tick in a dataframe and use the resample function.

https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.resample.html

Can you write a small snippet showing how it's done?

pbrijesh26 commented 3 years ago

This means that if i am trading in 1 min TF(suppose) ,i won't be able to make a 20 moving average until i gets 20 ticks therefore i have to wait for 20 mins for a my system (algo) to work.

krishnavelu commented 3 years ago

Thats how moving average works. You cannot take average till all data points are available.

pbrijesh26 commented 3 years ago

Does Aliceblue has a plan to come up with historical data api in the near future??

krishnavelu commented 3 years ago

Nope.