I had noticed couple of times funds got withdrawn due to Sebi policy. But they appear with "funds withdrawn" for sometime and they vanish.
why in "fund transaction details" ,"funds withdrawn" not visible in angel one website ?
Posts made by coolankurmahe
-
"funds withdrawn" not visible in angel one website
-
"funds withdrawn" not visible in angel one website
I had noticed couple of times funds got withdrawn due to Sebi policy. But they appear with "funds withdrawn" for sometime and they vanish.
why in "fund transaction details" ,"funds withdrawn" not visible in angel one website ? -
RE: Can we modify partially filled order using smart api?
@Moderator_3 As stated above, I was asking if the order is already partially filled, then we can still modify the limit price ? Can you please confirm ? if yes, please share the client code ?
I had come across "Yes, you can modify or cancel a limit order before execution. You can adjust the limit price or quantity unless it’s already been partially or fully executed."
in https://www.angelone.in/knowledge-center/online-share-trading/what-is-limit-order-and-how-it-is-used
which states we can't is it is partially filled. -
Can we modify partially filled order using smart api?
If I place limit order with quantity 100, then it gets partially fulfilled example 50 out of 100 quantity got filled. Then if i use modifyOrder API to modify the limit price or quantity of order, is it possible ?
Or I need to cancel this order and place another order with new left out quantity ? -
getMarginApi Api returns wrong margin for Nifty futures ? [Urgent]
getMarginApi returns following normally response for June Nifty Futures:
{'status': True, 'message': 'SUCCESS', 'errorcode': '', 'data': {'totalMarginRequired': 65482.09, 'marginComponents': {'netPremium': 182130.0, 'spanMargin': 400425.5, 'marginBenefit': 84922.0, 'deliveryMargin': 0.0, 'nonNFOMargin': 0.0, 'totOptionsPremium': 0.0}, 'marginBreakup': [{'exchange': 'NFO', 'productType': 'CARRYFORWARD', 'totalMarginRequired': 65482.09}], 'optionsBuy': {'totOptionsPremium': 0.0, 'optionDetails': []}}}So as can be seen 65482.09 is the margin for 1 lot (25 quantity).
Today at 10:45 AM when this Api gets called , my code had also placed order for Nifty Call option as well and when checking margin using getMarginApi got following response:
{'status': True, 'message': 'SUCCESS', 'errorcode': '', 'data': {'totalMarginRequired': 11554.58, 'marginComponents': {'netPremium': 182130.0, 'spanMargin': 0.0, 'marginBenefit': 53927.5, 'deliveryMargin': 0.0, 'nonNFOMargin': 0.0, 'totOptionsPremium': 0.0}, 'marginBreakup': [{'exchange': 'NFO', 'productType': 'CARRYFORWARD', 'totalMarginRequired': 11554.58}], 'optionsBuy': {'totOptionsPremium': 0.0, 'optionDetails': []}}}I had kept the capital for futures to be 1 Lakh
Since the margin using above Api came out to be 11554.58, I calculate the actual future quantity to be placed for order as below:
actualFutureQuantity = (int)(capital/oneLotMargin)*futureLostSize
which in this case is (int)(100000/11554.58)*25 = 8So 8 lots(200 quantity) order was placed for Nifty futures.
But the problem is I can see 4.3 lakhs have been deducted from my account rather than anything near to 1 lakh.Below is Nifty future order response:
orderResponse : {'status': True, 'message': 'SUCCESS', 'errorcode': '', 'data': {'variety': 'NORMAL', 'ordertype': 'MARKET', 'producttype': 'CARRYFORWARD', 'duration': 'DAY', 'price': 0.0, 'triggerprice': 0.0, 'quantity': '200', 'disclosedquantity': '0', 'squareoff': 0.0, 'stoploss': 0.0, 'trailingstoploss': 0.0, 'tradingsymbol': 'NIFTY27JUN24FUT', 'transactiontype': 'BUY', 'exchange': 'NFO', 'symboltoken': '35004', 'instrumenttype': 'FUTIDX', 'strikeprice': -1.0, 'optiontype': 'XX', 'expirydate': '27JUN2024', 'lotsize': '25', 'cancelsize': '0', 'averageprice': 23152.78, 'filledshares': '200', 'unfilledshares': '0', 'orderid': '240527000529143', 'text': '', 'status': 'complete', 'orderstatus': 'complete', 'updatetime': '27-May-2024 10:45:03', 'exchtime': '27-May-2024 10:45:03', 'exchorderupdatetime': '27-May-2024 10:45:03', 'fillid': '', 'filltime': '', 'parentorderid': '', 'ordertag': '', 'uniqueorderid': 'c5acc46f-9919-4d3c-bd55-34afdf75cb5c'}}Please let me know the problem here ? Also, how should the margin just for futures should be calculated ? Why there is difference in one response to another of getMarginApi - 11554.58 rather than 65482.09 for one lot(25 qty).
Also, if 11554.58 is the right margin, it didn't deduct 1 lakh but 4.3 lakh from my account.Please let me know as it urgent.
-
Do the current month nifty future data/chart provide historical data for expired future contracts as well
I can see the data for NIFTY30MAY24FUT symboltoken = 46930 (which is future contract for current month).
But it also shows in charts and data pulled by getCandleData API the data for previous months, past years though the future contract lasts for only 3 months.Does this mean current month future contract data shows historical data of expired future contracts for each month ?
example: currently NIFTY30MAY24FUT (future contract for May expiry Nifty) shows data for :
May - current month expiry
April- April month expired future data
March - March month expired future data
etc etc ?
Is the above assessment correct ?
If yes, does this also hold for stock futures ? -
Do the current month nifty future data/chart provide historical data for expired future contracts as well
I can see the data for NIFTY30MAY24FUT symboltoken = 46930 (which is future contract for current month).
But it also shows in charts and data pulled by getCandleData API the data for previous months, past years though the future contract lasts for only 3 months.Does this mean current month future contract data shows historical data of expired future contracts for each month ?
example: currently NIFTY30MAY24FUT (future contract for May expiry Nifty) shows data for :
May - current month expiry
April- April month expired future data
March - March month expired future data
etc etc ?If yes, does this also hold for stock futures ?
-
RE: Option Actual Buy Price is not the same(way more than) as returned averageprice from individual_order_details API
@Moderator_1
Hi, But in my case it is reverse , right.
Can you go through above post carefully ?
Average price that was returned was 170.7 as shown in response also.
The buy price was at 183 . It should had never happened because even a lot of next minutes candles at and after 12:01 PM on 15th May, 2024 for above mentioned option never crossed 174 ish.
So, I am not sure where this 183 came from which shows in my order history as buy price on Angel One UI. -
Option Actual Buy Price is not the same(way more than) as returned averageprice from individual_order_details API
@administrators
Please reply this to the earliest as this is related to in-consistency of order's price.
Please take it is urgency as I won't trust if the reasoning of this is not known.The order was placed yesterday (15th May, 2024) through my algo at 12:30:01 for OptionSymbol NIFTY23MAY2422250CE OptionToken 38748
Soon after order was successfully placed, I am fetching order details through individual_order_details API and it returned as following .orderResponse : {'status': True, 'message': 'SUCCESS', 'errorcode': '', 'data': {'variety': 'NORMAL', 'ordertype': 'MARKET', 'producttype': 'CARRYFORWARD', 'duration': 'DAY', 'price': 0.0, 'triggerprice': 0.0, 'quantity': '50', 'disclosedquantity': '0', 'squareoff': 0.0, 'stoploss': 0.0, 'trailingstoploss': 0.0, 'tradingsymbol': 'NIFTY23MAY2422250CE', 'transactiontype': 'BUY', 'exchange': 'NFO', 'symboltoken': '38748', 'instrumenttype': 'OPTIDX', 'strikeprice': 22250.0, 'optiontype': 'CE', 'expirydate': '23MAY2024', 'lotsize': '25', 'cancelsize': '0', 'averageprice': 170.7, 'filledshares': '50', 'unfilledshares': '0', 'orderid': '240515000931623', 'text': '', 'status': 'complete', 'orderstatus': 'complete', 'updatetime': '15-May-2024 12:30:01', 'exchtime': '15-May-2024 12:30:01', 'exchorderupdatetime': '15-May-2024 12:30:01', 'fillid': '', 'filltime': '', 'parentorderid': '', 'ordertag': '', 'uniqueorderid': 'd482ecee-05ef-47c2-afcc-0795978a6bf6'}}
The averageprice is 170.7 in above response and also I can see max 172 in the many next few seconds candle(you can check the candles on angel one UI).
Then, why Angel One UI shows 183 as buy price in my order history and even the loss is also calculated based on that ?
How can this data be so in-consistent when it doesn't match with returned response and candle data of Angel One UI.
Do the return response of individual_order_details API don't give correct averageprice for the order ?
How to make sure we get right buy price ? limit order rather than market order ?
or any other solution you have ? -
RE: logzero not working with smartapi-python==1.4.8 and latest smartapi-python sdk
@Moderator_3 @astrokabir : I figured out the bug at https://github.com/angel-one/smartapi-python/blob/main/SmartApi/smartConnect.py#L131. This bug was introduced in this commit
The loglevel should be logging.INFO rather than logging.ERROR.
It works fine on Linux after making just above correction.
But it still doesn't work on Mac.
@Moderator_3 : Can you get it replicated on Mac and see if it works ? -
logzero not working with smartapi-python==1.4.8 and latest smartapi-python sdk
I downloaded the latest smartapi-python code on github and updated smartapi-python==1.4.8 by pip3 install smartapi-python==1.4.8 and can see the same in pip3 list.
But I can see consistently that logzero logger isn't logging anymore.
If I revert to earlier versions like 1.4.5 and smartapi-python code of that time, it works.I figured it out that a bug was introduced by your team at commit
The loglevel should be logging.INFO rather than logging.ERROR at
https://github.com/angel-one/smartapi-python/blob/main/SmartApi/smartConnect.py#L131Please correct the same.
But this works on Linux but not on Mac. Can you replicate and figure out why ?
Earlier smart api python sdk and installed version 1.4.5 used to work on Mac as well. -
RE: OpenAPIScripMaster.json is down and shows null .Also at what rate it gets refreshed ?
@jaideep-siddula Yes It was. Thanks.
Can you please reply on the second ques.
I have seen generally tokens are not changing on daily basis.
I am mostly dealing with options. Nifty etc.
Wanted to know for much time I can cache the OpenAPIScripMaster.json in my local system ? example like a week ? -
OpenAPIScripMaster.json is down and shows null .Also at what rate it gets refreshed ?
Hi,
I wanted to let the team know that OpenAPIScripMaster.json is down and retuning null.
Also, wanted to know for much time I can cache the OpenAPIScripMaster.json in my local system ? I have seen generally tokens are not changing on daily basis.
I am mostly dealing with options. Nifty etc. -
Attempting to resubscribe/reconnect Websocket2
I have used the code mentioned in git repo https://github.com/angel-one/smartapi-python
I initially did get the ticks for 8 stocks/options for about a 1 min.
I launched my program 4-5 times since wanted to log and test ticks I received.
Then, started getting "Attempting to resubscribe/reconnect Websocket2" again and again.
everytime with no code change.
Is there a rate limit of the amount of tick data we can received in a day or so ?
I only subscribed 7-8 stock/options . But relaunched my program 8-10 times before receiving above error. -
RE: For 15min candle (close, open etc), is there any websocket(not streaming) but on 15 min interval
@Moderator_1 I think Market Data API(though websockets are good) but we will need to write quite some logic to refine the data into candles(15 mins, 5 mins).
Also, it might suffer inaccuracies if even few ticks are missed.Either of APIs suffer lag or downtime.
So, when I tried historical APIs to query , it gave results for current stock price with 1-2 seconds .
I would be happy to use historical APIs if there is no major disadvantage using them ?
Wanted to understand if historical APIs are down sometime during the working hours of stock market ?
Even if few seconds or 60 seconds or so delay in historical APIs to get current price of stock is fine with my algo strategy.
Can you throw light on above please ? -
For 15min candle (close, open etc), is there any websocket(not streaming) but on 15 min interval
I can see that I can use historical API to fetch data of current trading day and poll data every 15 min to get close, open etc.
Is there a websocket for the same rather than API(historical) ?
Also, how reliable is this historical API to fetch current stock price(on 5 min , 15 min candle).What is the downtime for these APIs ?
The smartAPI websocket for market data isn't based on 5 min , 15 min candle ?It is only streaming(every second). Am I correct ?
Is there a way to get current stock prices(5 min , 15 min candle) from websocket ? -
RE: How many years of historical data we get for Nifty and stocks
@Moderator_1 : For NSE equity I can query 15 min candle since 2016-10-03(3rd October, 2016) and not before that.
By intra-day you mean, 5 min , 15 min candle . correct ????
If yes, the limits are quite close to what you stated above (I tested on NIFTY and tata motors(equity).
By interday you mean, 1 Day candle since 1990-01-01 can queried from API?It is super-important for my algo trading strategy at 15min, 5 min candle for at least for last 10 years. Can you provide such API ?
-
RE: max length of historical data ?
@admin How many years data is provided through historical data like last 7,8 or 10 years for stocks as well indexes like NIFTY ?
-
How many years of historical data we get for Nifty and stocks
To test my strategy , data is really important to test how strong and reliable my strategy is.
I tested historical APIs for TATAMOTORS and NIFTY.
For NIFTY, it doesn't provide before 2015( means last 8 years) and TATAMOTORS before 2017(means last 6 years).
Can you please confirm this ?
Is there a way that I can get historical data for them for atleast last 10 years for NIFTY and popular stocks like TATAMOTORS ? -
RE: How do I get historical Index Data for NIFTY/SENSEX?
@Moderator_2 Hi Thanks for reply. It worked to fetch Nifty50 data.
Can you also write the token for Bank Nifty and other Nifties since it quite hard to find in file.
Also, please tell if we can get the historical data for expired options for Nifty.
example:If I have backtest Nifty50 along with its derivatives i.e Options for last 1 year, I will need historical Nifty Option data for last 1 year. Is it possible ?
If yes, how to get symbol tokens for expired contracts ?