Kotak-Neo / kotak-neo-api

96 stars 80 forks source link

Expiry format should be in YYYYMMDD, and not YYMM #102

Open soumyajyotibiswas opened 7 months ago

soumyajyotibiswas commented 7 months ago

Summary

The expiry format provided for search_scrip needs to be in YYYYMMDD and not YYYYMM.

Steps to reproduce

>>> client.search_scrip(exchange_segment = "nse_fo", symbol = "NIFTY",  expiry = "202312", option_type = "CE", strike_price = "20100")

{'Error': DateParseError('month must be in 1..12: 202312, at position 0'), 'message': 'Exchange Segment is not available'}
>>>

Correct format

>>> client.search_scrip(exchange_segment = "nse_fo", symbol = "NIFTY",  expiry = "20231207", option_type = "CE", strike_price = "20100")
[{'pSymbol': '43148', 'pGroup': 'XX', 'pExchSeg': 'nse_fo', 'pInstType': 'OPTIDX', 'pSymbolName': 'NIFTY', 'pTrdSymbol': 'NIFTY23D0720100CE', 'pOptionType': 'ce', 'pScripRefKey': 'NIFTY23D0720100CE', 'pISIN': None, 'pAssetCode': 26000.0, 'pSubGroup': None, 'pCombinedSymbol': None, 'pDesc': None, 'pAmcCode': None, 'pContractId': None, 'dTickSize': 5, 'lLotSize': 50, 'lExpiryDate': 1386426600, 'lMultiplier': -1, 'lPrecision': 2, 'dStrikePrice;': 2010000.0, 'pExchange': 'NSE', 'pInstName': 'OPTIDX', 'pExpiryDate': '07Dec2023', 'pIssueDate': 1383436800.0, 'pMaturityDate': 1386426600.0, 'pListingDate': 1383436800.0, 'pNoDelStartDate': 0.0, 'pNoDelEndDate': 0.0, 'pBookClsStartDate': 0.0, 'pBookClsEndDate': 0.0, 'pRecordDate': 0.0, 'pCreditRating': '            ', 'pReAdminDate': 0.0, 'pExpulsionDate': 0.0, 'pLocalUpdateTime': 1385918389.0, 'pDeliveryUnits': None, 'pPriceUnits': None, 'pLastTradingDate': None, 'pTenderPeridEndDate': None, 'pTenderPeridStartDate': None, 'pSellVarMargin': None, 'pBuyVarMargin': None, 'pInstrumentInfo': None, 'pRemarksText': None, 'pSegment': 'FO', 'pNav': None, 'pNavDate': None, 'pMfAmt': None, 'pSipSecurity': None, 'pFaceValue': None, 'pTrdUnits': None, 'pExerciseStartDate': 1386374400.0, 'pExerciseEndDate': 1386426600.0, 'pElmMargin': None, 'pVarMargin': None, 'pTotProposedLimitValue': None, 'pScripBasePrice': 25455, 'pSettlementType': 'Cash', 'pCurrectionTime': None, 'iPermittedToTrade': 0, 'iBoardLotQty': 1, 'iMaxOrderSize': 1801, 'iLotSize': 50, 'dOpenInterest': 1016150.0, 'dHighPriceRange': 62140.0, 'dLowPriceRange': 5.0, 'dPriceNum': 1, 'dGenDen': 1, 'dGenNum': 1, 'dPriceQuatation': 0, 'dIssuerate': 0, 'dPriceDen': 1, 'dWarningQty': 0, 'dIssueCapital': 1000000000000.0, 'dExposureMargin': 2.0, 'dMinRedemptionQty': 0, 'lFreezeQty': 1801}]
>>>

https://github.com/Kotak-Neo/kotak-neo-api/blob/5360eb7019b5a90aee53fd8c09d93e6130e79efb/neo_api_client/neo_api.py#L517