Coder Social home page Coder Social logo

algo2t / alphatrade Goto Github PK

View Code? Open in Web Editor NEW
44.0 9.0 23.0 314 KB

Python APIs for SAS Online Alpha Trade Web platform for creating algo trading using python

Home Page: https://algo2t.github.io/alphatrade

License: MIT License

Python 100.00%
python trading sasonline alpha-trade-api zerodha aliceblue alice-blue algotrading algo-trading apis

alphatrade's People

Contributors

algo2t avatar rahulmr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alphatrade's Issues

Not able to Place Equity Plus Order for Delivery.

While i try to place Delivery order, it is only placing CNC order.
How do i make it to take it as NRML order so that order is placed under Equity Plus feature utilising margin of 2-4 times?

`sas.place_order(transaction_type = TransactionType.Buy,
                     instrument = sas.get_instrument_by_symbol('NSE', "PHOENIXLTD"),
                     quantity = 1,
                     order_type = OrderType.Market,
                     product_type = ProductType.Delivery,
                     price = 0.0,
                     trigger_price = None,
                     stop_loss = None,
                     square_off = None,
                     trailing_sl = None,
                     is_amo = False)`

What changes should i make to this order placement code for placing delivery order as NRML?

Getting the Intraday data and the historical data together for Talib Library

fetching the data for this

from datetime import datetime
nifty_bank_nse_index = sas.get_instrument_by_symbol('NSE', 'Nifty Bank')
print(sas.get_intraday_candles(nifty_bank_nse_index.exchange, nifty_bank_nse_index.symbol, datetime(2020, 10, 19), datetime.now(), interval=10))

is giving error of number of arguments here ! i guesss there is an issue !
getting the historical as well as intraday in this code :
get_intraday_candles() takes from 3 to 4 positional arguments but 6 were given
get_intraday_candles() got multiple values for argument 'interval'

Help to code Nifty Shortstrangle using Nifty spot price

Can anyone help assit to code nifty short strangle (current week expiry) using nifty spot at particular time (say 9:30).
also 2 exit criterior
place a SL-Limit order for both legs at 30% of premium sold
Exit at loss of 3000

for Indices remove the upper method

Hi,

Data for Nifty and Banknifty returns None because you have made it upper for all symbols where as for Nifty and Banknifty these are "Nifty 50" and "Nifty Bank" respectively. Upper case wont work for them. So please make the necessary changes.

Better examples with sample output

Thanks for such a amazing package.

Is your feature request related to a problem? Please describe.
The readme file is very comprehensive but its hard to develop on because there is no documentation of how the output will look like. Only way to check right now is to run the package in live market and check the data from there.

Describe the solution you'd like
It would be great if sample output format for each function can be provided. Maybe as comment in examples or as a jupyter notebook.

Describe alternatives you've considered
Run live and dont code while market closed.

Additional context
kite has some amazing documentations. https://kite.trade/docs/connect/v3/portfolio/#position-conversion.

Historical candles and intraday candles do not work

This issue has been reported earlier (#4), where I have put the same comments as below. However, the issue was in the closed state, so I was not sure if it would be flagged to the owners. Sorry for the duplicate one here.


I came across the resolution to this issue which states that SAS Alpha Web platform does not support historical/intraday data. However, this does not seem to be true.

I think I have figured out what should be used for different indices and FNOs for the 'exchange' and 'symbol' names.

Eg:
For indices, we need to have the following in the 'PARAMS' in the functions that get the historical and intra-day data:

exchange: NSE_INDICES
symbol: 'Bank Nifty' / 'Nifty 50' / 'Nifty IT' / 'Nifty Auto' etc => Note that there are spaces and it is case sensitive

For FUT, we need to have the following in the 'PARAMS':
exchanbe: FNO
symbol: 'BANKNIFTY21DECFUT' / 'BANKNIFTY21DEC37800CE' / 'BANKNIFTY21D0937300PE' etc => Note that there are no spaces in between

Can this package be updated to handle the above?

New version APIs

Hi @algo2t , Got a mail from SASOnline that they are going to support Algo soon but from the docs, it seems like they have changed all the APIs from v2 to v1. Do you have any plans to update this library? Thanks!

LIMIT order placed instead or MARKET order

Hi, While I placed the orders through the 'place_order' method, I could see the orders placed as 'LIMIT' order instead of 'MARKET' order, even after mentioning that it should be a market order. PFB the screenshot shown below from the debugger which shows the finally constructed order object, there it is showing as 'MARKET'. However, when the order gets executed, it goes to 'LIMIT' as shown in the next screenshot.

Also check the 'Price' and 'Average price' values that I have highlighted. If it is placed as market order, then it should right away fill the available price. I am confused why some value is show in the 'Price' field even though I passed the price value as zero as you can see in the first screenshot. The weird part is, the instrument never came to that price or 42 in that candle. I verified it with the minute level candle. So from where this number is coming? Kindly help.

Finally, if you see the order update time or exchange time, the values are shown as 04:00:58. Whereas this order was executed morning at 09:30:58 am. I don't know whether this is related to API or SAS Online. But this is also an issue. Please note that the server timing and all other stuffs are set to proper Indian time zones. Thanks.

image

image

Websocket not starting

Websocket is not opening since morning, it was working till yesterday. If I use an earlier version of Alphatrade to test, there also WebSocket not working(which used to work) and throwing error ERROR:websocket:error from callback <bound method AlphaTrade.__on_close_callback of <alphatrade.alphatrade.AlphaTrade object at 0x000001873CD0EF48>>: __on_close_callback() takes from 1 to 2 positional arguments but 4 were given. Please look into it.

get master contract by exchange

nfo_master = sas.get_master_contract('NFO')

when i try this it is returning all contracts from CDS and nothing from FNO.

As a result sas.get_intraday_candles('NFO', instrument , 1) is returning nonetype object.
Is it because NFO market is closed now? This seems weird.

installation of alphatrade.git giving error

-mac-0 ~ % python3 -m pip install https://github.com/algo2t/alphatrade.git
Defaulting to user installation because normal site-packages is not writeable
Collecting https://github.com/algo2t/alphatrade.git
Downloading https://github.com/algo2t/alphatrade.git
| 350.5 kB 1.7 MB/s 0:00:00
ERROR: Cannot unpack file /private/var/folders/1j/8_pm1x6d4tl6yxjb6d66x9d40000gp/T/pip-unpack-45dz7nwe/alphatrade.git (downloaded from /private/var/folders/1j/8_pm1x6d4tl6yxjb6d66x9d40000gp/T/pip-req-build-ipjid2y_, content-type: text/html; charset=utf-8); cannot detect archive format
ERROR: Cannot determine archive format of /private/var/folders/1j/8_pm1x6d4tl6yxjb6d66x9d40000gp/T/pip-req-build-ipjid2y_

Live feeds not working. Socket issue

Hi there,

Since today morning, socket is not getting connected and live feeds are not working. Till yesterday it was working fine.

Here is my code, socket_opened is not getting True.

def SubscribeIndex():
global isSocketRunning
sas.start_websocket(subscribe_callback=event_handler_quote_update,
socket_open_callback=open_callback,
run_in_background=True)
while(socket_opened==False):
pass

Buy limit order of a sell order getting executed at market price

Hi,

I am placing the see order of bankniffty call at market order which is getting placed properly. But when i am trying to place order buy order for this call with limit price(basically placing a stop loss order of the sell order) it is getting executed at the market price instead of the limit price. Please see below image, the order got executed at 306 and my trigger price is 364 and limit 366.

image

not able to generate access token

I am not able to generate an access token please help in SASas online
I tried your config code but it is not able to generate access token

Unable to login itself

This is the issue that I have encountered.
what I did?

  1. created config.py in the same folder as sas_login_eg.py and gave credentials loginid, password,twofa(being same for all questions)
  2. ran sas_login_eg.py
  3. I am not using access_token

Below is the errorI encountered. Please help.

C:\AlgoTrade\venv\Scripts\python.exe C:/AlgoTrade/alphatrade-main/examples/sas_login_eg.py
Exception occurred :: [Errno 2] No such file or directory: 'access_token.txt'
Exception occurred :: [Errno 2] No such file or directory: 'access_token.txt'
{'status': 'error', 'message': 'Please Enter Valid Password', 'data': {}}
Traceback (most recent call last):
File "C:\AlgoTrade\alphatrade-main\examples\sas_login_eg.py", line 24, in
sas = AlphaTrade(login_id=config.login_id, password=config.password, twofa=config.twofa)
File "C:\AlgoTrade\venv\lib\site-packages\alphatrade\alphatrade.py", line 233, in init
self.__get_question_ids()
File "C:\AlgoTrade\venv\lib\site-packages\alphatrade\alphatrade.py", line 287, in __get_question_ids
raise requests.HTTPError(response.text)
requests.exceptions.HTTPError: {"status":"error","message":"Please Enter Valid Password","data":{}}

Process finished with exit code 1

How to get access to API?

What is the process to get access to APIkey and Secret. I tired reaching out to support, but they are not sure weather they can provide access or not and have forwarded the request to developer, which I assume is you.

I have good user base and if API access is provided some 1000 odd users will start using the platform.

Not able to get historical candle for index

    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

Unable to generate access token

Giving this Error:

HTTPError Traceback (most recent call last)
Input In [14], in <cell line: 10>()
7 totp = f"{int(pin):06d}" if len(pin) <=5 else pin
8 print(config.access_token)
---> 10 sas = AlphaTrade(login_id=config.login_id, password=config.password, twofa=totp, access_token=config.access_token)
11 socket_opened = False
12 def event_handler_quote_update(message):

File ~/opt/anaconda3/lib/python3.9/site-packages/alphatrade/alphatrade.py:240, in AlphaTrade.init(self, login_id, password, twofa, access_token, master_contracts_to_download)
238 if not self.__is_token_valid():
239 self.__get_question_ids()
--> 240 self.__set_access_token()
241 else:
242 self.__headers['X-Authorization-Token'] = self.__access_token

File ~/opt/anaconda3/lib/python3.9/site-packages/alphatrade/alphatrade.py:309, in AlphaTrade.__set_access_token(self)
306 response = self.reqsession.post(
307 'https://alpha.sasonline.in/api/v2/checktwofa', json=twofa_body)
308 if response.status_code != 200:
--> 309 raise requests.HTTPError(response.text)
310 if 'error' in response.text:
311 raise requests.HTTPError(response.text)

HTTPError: {"errors":{"detail":"Internal server error"}}

I think it is still asking for old format of twofa password which is not part of latest config file.
How to avoid this error?

Expecting value: line 1 column 1 (char 0)

I get this error too often. It is during fetching data for any instrument. I could not reproduce it by step by step execution but it comes in the exception handling and sometimes they work just fine. Anybody faced the same issue? Not sure what could be the reason for this?

historical data error !!!!!!

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, 10, 10, 9, 15, 0), datetime.now(), interval=1,
is_index=True)

error:::::-----------------------------
Traceback (most recent call last):
File "e:!TRADING STUFF\ALPHA trade\sas.py", line 29, in
datetime(2022, 10, 10, 9, 15, 0), datetime.now(), interval=1,
TypeError: 'module' object is not callable

getting Error in place_order in alphatrade 1.0

I am getting following error respsonse while placing order.
Code:
print(
sas.place_order(transaction_type = TransactionType.Buy,
instrument = sas.get_instrument_by_symbol('NSE', 'INFY'),
quantity = 1,
order_type = OrderType.Market,
product_type = ProductType.Delivery,
price = 0.0,
trigger_price = 0.0,
stop_loss = None,
square_off = None,
trailing_sl = None,
is_amo = False)
)

Error:
HTTPError: {"data":{},"error_code":44000,"message":"order_side can't be blank","status":"error"}

how to give NFO Orders ?

print ("%%%%%%%%%%%%%%%%%%%%%%%%%%%%2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
print(
sas.place_order(transaction_type = TransactionType.Sell,
instrument = sas.get_instrument_by_symbol('NFO', 'BANKNIFTY2311241600PE'),
quantity = 1,
order_type = OrderType.Market,
product_type = ProductType.Delivery,
price = 0.0,
trigger_price = None,
stop_loss = None,
square_off = None,
trailing_sl = None,
is_amo = False)
)

The above code should have placed the order but instead its saying instrument not found. Am I doing it wrong or its flawed?

SAS Online API endpoints changed - receiving error - unable to trade

Since today morning I am continuously receiving the following error message when I try to place the order. The automated TOTP is generated through pyotp as we know. I am not sure why it is not working properly. Earlier this issue was coming up randomly and it would work after trying multiple times. However, now it doesn't work at all.

{"data":{},"error_code":49008,"message":"Invalid TOTP, please try again","status":"error"}

Intraday candle do not return the current candle.

get_intraday_candle function does not return the current open candle data as soon as the candle opens.

I tried working around with end_time, but still, data for the current open candle is coming 1 to 1.5 min late.

Any tricks you can point to me to get the current open candle OHLC data as soon as the candle opens.

Frequently receiving 'Request Unauthorised' error

Whenever I try to modify order status or try to square off any positions, I very often receive the error

{"status":"error","message":"Request Unauthorised","data":{}}

I am not sure whether this has something to do with token authorization or any other issues from the broker side. But I receive this very often in the web socket. Please let me know how I can resolve this issue.

An example scenario is, if LTP is greater than specific price, modify a pending order. When I try to do this, I see this error printed in log.

Thanks.

API not logging in

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): alpha.sasonline.in:443
DEBUG:urllib3.connectionpool:https://alpha.sasonline.in:443 "GET /api/v2/profile HTTP/1.1" 401 61
DEBUG:urllib3.connectionpool:https://alpha.sasonline.in:443 "POST /api/v2/login HTTP/1.1" 200 144
DEBUG:urllib3.connectionpool:https://alpha.sasonline.in:443 "POST /api/v2/checktwofa HTTP/1.1" 500 45
Traceback (most recent call last):
File "c:\Users\Ganpati\Desktop\SAS\config.py", line 12, in
sas = AlphaTrade(login_id=login_id, password=password, twofa=pin)
File "C:\Users\Ganpati\AppData\Local\Programs\Python\Python310\lib\site-packages\alphatrade\alphatrade.py", line 240, in init
self.__set_access_token()
File "C:\Users\Ganpati\AppData\Local\Programs\Python\Python310\lib\site-packages\alphatrade\alphatrade.py", line 309, in __set_access_token
raise requests.HTTPError(response.text)
requests.exceptions.HTTPError: {"errors":{"detail":"Internal server error"}}

Websocket not working

i am bit naive in websocket so reaching out to you.

i copy pasted your websocket code and tried executing it but it is not working. it just keep waiting and nothing gets printed. need help here. can you please post a working example.

In KiteConnect API we have one API ohlc, which can be used to get the LTP of any instrument and there is no subscription required there ( like we have websocket subscription). Is that achievable in this.

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

error in historical data of index!!!!!!!!!!!!!!!!!!

raise ConnectTimeout(e, request=request)
requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='ant.aliceblueonline.com', port=443): Max retries exceeded with url: /api/v1/charts/tdv?exchange=NSE_INDICES&token=26009&name=Nifty+Bank&candletype=1&starttime=1665373500&endtime=1665464462&type=all&data_duration=30 (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x00000221DAC344C0>, 'Connection to ant.aliceblueonline.com timed out. (connect timeout=None)'))

Delayed candles

I noticed that candles are delayed by a min or so. I was checking for 1 min candles and it was updating after 1 min or so. Not in real time. I understand that its from their side. Did you guys think on some workaround without using streaming?

Is there any get ltp sort of thing to get the last price without websocket ?

API hit limit/min for multiple account

Api hits allowed per account is 60+ hits/min. But when 2 accounts are used consecutively, the hit limit remains the same i.e. 60 hits/min but for both accounts combined, ideally, API hit should be exclusive of the account.
API can not be hit more than 60 times /min using 2 accounts exclusively.
If both accounts are run simultaneously,a error occurs after 30 hits of too many requests,

Can we play with IP addresses or headers to resolve this issue?

Error: __on_close_callback() takes from 1 to 2 positional arguments but 4 were give

Getting below issue very frequently after some time of running program.

ERROR:websocket:error from callback <bound method AlphaTrade.__on_close_callback of <alphatrade.alphatrade.AlphaTrade object at
0x0000025FC445FF70>>: __on_close_callback() takes from 1 to 2 positional arguments but 4 were given

Generally happens on calling following function:
sas.subscribe(optionType, LiveFeedType.COMPACT)

Trace logs are as follows:
ERROR:websocket:error from callback <bound method AlphaTrade.__on_close_callback of <alphatrade.alphatrade.AlphaTrade object at
0x0000025FC445FF70>>: __on_close_callback() takes from 1 to 2 positional arguments but 4 were given

Traceback (most recent call last):
File "d:\alokguptaxggn\python_sandbox\python_stories\python_stories\01-Development\algoTrade\63AlgoTrade-MIS-4-RSI-56.py", line 238, in
putBuyPrice = getOptionPrice(sas, NIFTY_PUT)
File "d:\alokguptaxggn\python_sandbox\python_stories\python_stories\01-Development\algoTrade\63AlgoTrade-MIS-4-RSI-56.py", line 20, in getOptionPrice
sas.subscribe(optionType, LiveFeedType.COMPACT)
File "C:\Users\alokg\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\alphatrade\alphatrade.py", line 857, in subscribe
return self.__ws_send(data)
File "C:\Users\alokg\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\alphatrade\alphatrade.py", line 460, in __ws_send
self.__websocket.send(*args, **kwargs)
ocal\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Pythonpy", line 203, in send
if not self.sock or self.sock.send(data, opcode) == 0:
File "C:\Users\alokg\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\websocket_core.py", line 283, in send
return self.send_frame(frame File "C:\Users\alokg\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\websocket_core.py", line 311, in send_frame
l = self._send(data)
File "C:\Users\alokg\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\websocket_core.py", line 525, in _send
return send(self.sock, data) File "C:\Users\alokg\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\websocket_socket.py", line 146, in send
raise WebSocketConnectionClosedException("socket is already closed.")
websocket._exceptions.WebSocketConnectionClosedException: socket is already closed.

Convert position from MIS to NRML.

HI There, how can I convert my position from Intraday to Delivery? Is there any method available to convert mis to nrml and vice-versa. If not, could you please add this feature?

Issue in place_order method

Not able to place order using below script

Steps to reproduce the behavior:
from datetime import datetime,date
sas.place_order(transaction_type = TransactionType.Sell,
instrument = sas.get_instrument_for_fno(symbol = 'BANKNIFTY', expiry_date=date(2021,7,22), is_fut = False, strike = 36500, is_call = True),
quantity = 25,
order_type = OrderType.Market,
product_type = ProductType.Delivery,
price = 0.0,
trigger_price = None,
stop_loss = None,
square_off = None,
trailing_sl = None,
is_amo = False)

Error:
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/alphatrade/alphatrade.py", line 590, in place_order
'product': prod_type,

UnboundLocalError: local variable 'prod_type' referenced before assignment

get_total_m2m()

The above mentioned function is not returning correct value please look into it.
I want the figure which is shown under PNL in Web App through API. Please look into it

Historical data of indices

Hi @algo2t

I am trying below code to get historical data for bank nifty but its returning empty data frame. Tried Nifty, India Vix but the same result. However same code is working for stocks and returning data. Also tried with is_index=True but no luck. Could you please help.

print(sas.get_historical_candles('NSE','Nifty Bank', datetime.datetime(2021, 1, 1, 9, 15, 0), datetime.datetime.now(), interval=1))

Result - Instrument(exchange='NSE', token=26009, symbol='Nifty Bank', name='Nifty Bank', expiry=None, lot_size=None)
Empty DataFrame
Columns: [open, high, low, close, volume]
Index: []

Issue with api since yesterday.

I am using this api to trigger orders from my algo since couple months till now everything is very smooth but since yesterday I get the below error frequently and it is random.
{"status":"error","message":"Request Unauthorised","data":{}}
It would be great if this can be fixed.

Basket order issue for FNO.... Invalid price type

Hi All,
I am not able to place basket order using "sas.place_basket_order(orders)" method. Orders are sent to exchanges but they are getting rejected with error "Invalid price type". When we check order details, "Order Type" is always blank?

sas_error
Attaching screenshot of order details.

Here is my sample code.

ins1 = sas.get_instrument_for_fno(symbol = "NIFTY", expiry_date=datetime.date(2021,6,24), is_fut=False, strike=16500, is_call= True)
ins2 = sas.get_instrument_for_fno(symbol = "NIFTY", expiry_date=datetime.date(2021,6,24), is_fut=False, strike=14500, is_call= False)
order1 = {  "instrument"        : ins1,
            "order_type"        : OrderType.Market,
            "quantity"          : 75,
            "transaction_type"  : TransactionType.Buy,
            "product_type"      : ProductType.Delivery}
order2 = {  "instrument"        : ins2,
            "order_type"        : OrderType.Market,
            "quantity"          : 75,
            "transaction_type"  : TransactionType.Buy,
            "product_type"      : ProductType.Delivery}
orders = [order1, order2]
print(sas.place_basket_order(orders))

Getting Error when placing order.

I am getting the below error message when trying to place order. Do anyone faced similar issue earlier and how to fix this issue.

{'status': 'error', 'message': ' is not supported in NFO segment.', 'data': {}}

Below is the script I used to place the order.

sas.place_order(transaction_type = 'BUY',
instrument = sas.get_instrument_for_fno(symbol='NIFTY',
expiry_date=datetime.date(int(2022),int(2),int(24)),
is_fut=False,strike=17400,is_call=False),
quantity = 50,
order_type = 'LIMIT',
product_type = 'D',
price = 420.0,
trigger_price = None,
stop_loss = None,
square_off = None,
trailing_sl = None,
is_amo = False)

@algo2t

metadata-generation-failed issue

Describe the bug
Running the command pip install alphatrade throws the following error "metadata-generation-failed issue". I tried with downloaded whl file as well. But it fails with same error message all the time.

To Reproduce
Steps to reproduce the behavior:

  1. Run the command pip install alphatrade or download the whl from release and run with pip command
  2. See error--->
Collecting protlib
  Using cached protlib-1.5.0.tar.gz (32 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [1 lines of output]
      error in protlib setup command: use_2to3 is invalid.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

Expected behavior
It should run and install alphatrade

Screenshots
image

Desktop (please complete the following information):

  • OS: MacOS
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Non-base32 digit found while logging in

I have put login_id, password, 16 digit Totp as mentioned in the docs. But I am getting Internal server error

Screenshot 2022-11-14 105437
Screenshot 2022-11-14 105851

Screenshot 2022-11-14 105736

Unable to run my algos because of this error. Someone for whom this is working could you please help me

Empty DataFrame Columns: [open, high, low, close, volume] Index: []

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, 10, 11, 9, 15, 0), datetime.now(), interval=15,
is_index=True)

print(df)

Empty DataFrame
Columns: [open, high, low, close, volume]
Index: []

How to Get Open Interest Data

Is it possible to get Open Interest live data, as Four types of feed data are available but none of this providing Open Interest, also is it possible to get Option Chain Data?

Not able to get historical candle data for index like nifty and bank nifty

I am trying to get historical and intraday candle data for nifty and bank nifty index but it is giving me error that symbol not found. It is working fine for stocks. Below is my code and error

sas.get_historical_candles('NSE', 'Nifty Bank', start_time, end_time, 5)

ERROR: Cannot find symbol NSE NIFTY BANK in master contract

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.