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

Major Bug: self.payload not being reset #285

Open
cannot-find-username opened this issue Mar 17, 2024 · 0 comments
Open

Major Bug: self.payload not being reset #285

cannot-find-username opened this issue Mar 17, 2024 · 0 comments

Comments

@cannot-find-username
Copy link

self.payload is not being reset after each request. If I send out multiple requests - for eg. order placement followed by market feed followed by basket creation, the last operation's payload will have all the previous operation's fields (if they are not overwritten). This is dangerous! I don't know how this API has been working for so much time.

client.Order_margin(Exch="N", ExchType="C", ScripCode="1660", PlaceModifyCancel="P", TransactionType="B", 
                    AtMarket="Y", LimitRate=0, Volume=10, OldTradedQty=0, ProductType="D", CoverPositions="N")

a=[{"Exchange":"N","ExchangeType":"C","Symbol":"ITC"}, {"Exchange":"N","ExchangeType":"C","Symbol":"SBIN"}]
client.fetch_market_depth_by_symbol(a)

client.create_basket("abcd")

client.payload

'body': {
'Exch': 'N',
'ExchType': 'C',
'ScripCode': '1660',
'PlaceModifyCancel': 'P',
'TransactionType': 'B',
'AtMarket': 'Y',
'LimitRate': 0,
'Volume': 10,
'OldTradedQty': 0,
'ProductType': 'D',
'CoverPositions': 'N',
'Count': '1',
'Data': [{'Exchange': 'N', 'ExchangeType': 'C', 'Symbol': 'ITC'},
{'Exchange': 'N', 'ExchangeType': 'C', 'Symbol': 'SBIN'}],
'BasketName': 'abcd'}}

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

1 participant