How do I track my positions Live? And exit based on that from Fyers API V2. Please Help!
@Fyers team There is no use of returning stale data from Positions API. Why are we not providing the realtime data on APIs ?
How are Algos supposed to take decision based on stale data?
Hi
We have an order socket which can be subscribed to get live order status change through a websocket
Positions live socket is in the works
But it will take some time
That’s great to know that it in works.
But how can Orders websocket help to solve this ?
I believe Fyers is getting very slow on technological enhancements these days.
You can see how DhanHQ is coming up with things very faster. These are very mandatory enhancements and should be prioritized.
- Positions API gives updated data every 30 seconds only ! (Totally useless)
- No Margins API
- Webhook Callbacks are NOT working.
- Support team is not able to understand anything. Just request to wait and we will call back.
@Fyers team @Tejas Khoday
Also even if the websockets is not available currently. Why can’t the API endpoint provide the realtime data ? @Fyers team
hitting the positions api does give the real time data
No Ajay, thats not True. It will get live data only after 10/15 seconds. I am using the API since last 3 month. You can double check.
import time
while(1):
p = fyers.positions()
print(p['overall'])
time.sleep(1)
Output:
ERR: logEntryFunc: positions : [Errno 30] Read-only file system: ‘/2022-12-27.txt’ {‘count_total’: 9, ‘count_open’: 2, ‘pl_total’: -81972.25, ‘pl_realized’: -110748.25, ‘pl_unrealized’: 28776.0}
ERR: logEntryFunc: positions : [Errno 30] Read-only file system: ‘/2022-12-27.txt’ {‘count_total’: 9, ‘count_open’: 2, ‘pl_total’: -81972.25, ‘pl_realized’: -110748.25, ‘pl_unrealized’: 28776.0}
ERR: logEntryFunc: positions : [Errno 30] Read-only file system: ‘/2022-12-27.txt’ {‘count_total’: 9, ‘count_open’: 2, ‘pl_total’: -81972.25, ‘pl_realized’: -110748.25, ‘pl_unrealized’: 28776.0}
ERR: logEntryFunc: positions : [Errno 30] Read-only file system: ‘/2022-12-27.txt’ {‘count_total’: 9, ‘count_open’: 2, ‘pl_total’: -81972.25, ‘pl_realized’: -110748.25, ‘pl_unrealized’: 28776.0}
ERR: logEntryFunc: positions : [Errno 30] Read-only file system: ‘/2022-12-27.txt’ {‘count_total’: 9, ‘count_open’: 2, ‘pl_total’: -81972.25, ‘pl_realized’: -110748.25, ‘pl_unrealized’: 28776.0}
ERR: logEntryFunc: positions : [Errno 30] Read-only file system: ‘/2022-12-27.txt’ {‘count_total’: 9, ‘count_open’: 2, ‘pl_total’: -81972.25, ‘pl_realized’: -110748.25, ‘pl_unrealized’: 28776.0}
ERR: logEntryFunc: positions : [Errno 30] Read-only file system: ‘/2022-12-27.txt’ {‘count_total’: 9, ‘count_open’: 2, ‘pl_total’: -81972.25, ‘pl_realized’: -110748.25, ‘pl_unrealized’: 28776.0}
ERR: logEntryFunc: positions : [Errno 30] Read-only file system: ‘/2022-12-27.txt’ {‘count_total’: 9, ‘count_open’: 2, ‘pl_total’: -81972.25, ‘pl_realized’: -110748.25, ‘pl_unrealized’: 28776.0}
ERR: logEntryFunc: positions : [Errno 30] Read-only file system: ‘/2022-12-27.txt’ {‘count_total’: 9, ‘count_open’: 2, ‘pl_total’: -81972.25, ‘pl_realized’: -110748.25, ‘pl_unrealized’: 28776.0}
ERR: logEntryFunc: positions : [Errno 30] Read-only file system: ‘/2022-12-27.txt’ {‘count_total’: 9, ‘count_open’: 2, ‘pl_total’: -81972.25, ‘pl_realized’: -110748.25, ‘pl_unrealized’: 28776.0}
ERR: logEntryFunc: positions : [Errno 30] Read-only file system: ‘/2022-12-27.txt’ {‘count_total’: 9, ‘count_open’: 2, ‘pl_total’: -81972.25, ‘pl_realized’: -110748.25, ‘pl_unrealized’: 28776.0}
ERR: logEntryFunc: positions : [Errno 30] Read-only file system: ‘/2022-12-27.txt’ {‘count_total’: 9, ‘count_open’: 2, ‘pl_total’: -81972.25, ‘pl_realized’: -110748.25, ‘pl_unrealized’: 28776.0}
ERR: logEntryFunc: positions : [Errno 30] Read-only file system: ‘/2022-12-27.txt’ {‘count_total’: 9, ‘count_open’: 2, ‘pl_total’: -81972.25, ‘pl_realized’: -110748.25, ‘pl_unrealized’: 28776.0}
ERR: logEntryFunc: positions : [Errno 30] Read-only file system: ‘/2022-12-27.txt’ {‘count_total’: 9, ‘count_open’: 2, ‘pl_total’: -81972.25, ‘pl_realized’: -110748.25, ‘pl_unrealized’: 28776.0}
ERR: logEntryFunc: positions : [Errno 30] Read-only file system: ‘/2022-12-27.txt’ {‘count_total’: 9, ‘count_open’: 2, ‘pl_total’: -82824.75, ‘pl_realized’: -110748.25, ‘pl_unrealized’: 27923.5}
ERR: logEntryFunc: positions : [Errno 30] Read-only file system: ‘/2022-12-27.txt’ {‘count_total’: 9, ‘count_open’: 2, ‘pl_total’: -82824.75, ‘pl_realized’: -110748.25, ‘pl_unrealized’: 27923.5}
ERR: logEntryFunc: positions : [Errno 30] Read-only file system: ‘/2022-12-27.txt’ {‘count_total’: 9, ‘count_open’: 2, ‘pl_total’: -82824.75, ‘pl_realized’: -110748.25, ‘pl_unrealized’: 27923.5}
You can see how I am getting the same Output of many seconds. This example is about the ‘overall’ section inside the position. Same is happenning for Positions aswell.
FYI - I was having a highly liquid postion of BankNifty which changes the PNL every second.