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

[5paisa] incorrect transform for options data #197

Open
HareshV opened this issue Feb 19, 2025 · 3 comments
Open

[5paisa] incorrect transform for options data #197

HareshV opened this issue Feb 19, 2025 · 3 comments

Comments

@HareshV
Copy link

HareshV commented Feb 19, 2025

As part of the /positions API, 'transform_positions_data' function is dynamically imported and used to transform the data

Sample data from getPositions API
{'AvgCFQty': 6440, 'AvgRate':6440, 'BodQty': 30, 'BookedPL': 0, 'BuyAvgRate': 0, 'BuyQty': 0, 'BuyValue': 0, 'CFQty': 30, 'ConvertedQty': 0, 'Exch': 'N', 'ExchType': 'D', 'LTP': 6.4, 'LotSize': 30, 'MTOM': 0, 'Multiplier': 1, 'NetQty': 30, 'OrderFor': 'D', 'PreviousClose': 10.45, 'ScripCode': 37478, 'ScripName': 'BANKNIFTY 27 FEB 2025 PE 45400.00', 'SellAvgRate': 0, 'SellQty': 0, 'SellValue': 0

After map_position_data
{'AvgCFQty':6440, 'AvgRate': 6440, 'BodQty': 30, 'BookedPL': 0, 'BuyAvgRate': 0, 'BuyQty': 0, 'BuyValue': 0, 'CFQty': 30, 'ConvertedQty': 0, 'Exch': 'NFO', 'ExchType': 'D', 'LTP': 6.4, 'LotSize': 30, 'MTOM': 0, 'Multiplier': 1, 'NetQty': 30, 'OrderFor': 'NRML', 'PreviousClose': 10.45, 'ScripCode': 37478, 'ScripName': 'BANKNIFTY27FEB2545400PE', 'SellAvgRate': 0, 'SellQty': 0, 'SellValue': 0}

After transform_positions_data
{'symbol': 'BANKNIFTY27FEB2545400PE', 'exchange': 'NFO', 'product': 'NRML', 'quantity': 30, 'average_price': 0}

The average_price is set to 0 which shows incorrect values in the Positions tab.

When does this issue occur?

  1. Not for all records. Within same session, same user, a few positions have 'average_price' set to the right value. In my account with 10 positions, 4 positions showed the correct average price and the remaining 6 others showed '0'
  2. LTP is always shown as 'N/A' and P/L is always shown as '0'
@marketcalls
Copy link
Owner

May i know which broker?
We last month integerated Data API. Currently LTP is always shown as 'N/A' and P/L is always shown as '0' because those are place holders which we will try to fix it on priority as now we have Data API in place

@HareshV
Copy link
Author

HareshV commented Feb 19, 2025

The broker is 5paisa

@marketcalls
Copy link
Owner

Let me check

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