finance_dev 0.9.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- finance_dev/__init__.py +18 -0
- finance_dev/_hooks/__init__.py +7 -0
- finance_dev/_hooks/clientcredentials.py +319 -0
- finance_dev/_hooks/oauth2scopes.py +50 -0
- finance_dev/_hooks/registration.py +13 -0
- finance_dev/_hooks/sdkhooks.py +82 -0
- finance_dev/_hooks/types.py +125 -0
- finance_dev/_version.py +16 -0
- finance_dev/accounts.py +797 -0
- finance_dev/alternativedata.py +4830 -0
- finance_dev/analytics.py +3757 -0
- finance_dev/basesdk.py +393 -0
- finance_dev/calendar.py +1523 -0
- finance_dev/chart.py +1881 -0
- finance_dev/company.py +1105 -0
- finance_dev/corporateactions.py +1795 -0
- finance_dev/economy.py +1153 -0
- finance_dev/errors/__init__.py +94 -0
- finance_dev/errors/apierror.py +41 -0
- finance_dev/errors/authenticationerrorenvelope.py +43 -0
- finance_dev/errors/badrequest.py +34 -0
- finance_dev/errors/errorenvelope.py +42 -0
- finance_dev/errors/errorresponse.py +45 -0
- finance_dev/errors/financedevapierror.py +31 -0
- finance_dev/errors/forbidden.py +34 -0
- finance_dev/errors/internalservererror.py +35 -0
- finance_dev/errors/no_response_error.py +18 -0
- finance_dev/errors/notfound.py +34 -0
- finance_dev/errors/orderhistorybadrequest.py +35 -0
- finance_dev/errors/predorderserrorenvelope.py +42 -0
- finance_dev/errors/responsevalidationerror.py +28 -0
- finance_dev/errors/unauthorized.py +34 -0
- finance_dev/estimates.py +1906 -0
- finance_dev/etf.py +1108 -0
- finance_dev/filings.py +586 -0
- finance_dev/financials.py +4079 -0
- finance_dev/history.py +477 -0
- finance_dev/httpclient.py +126 -0
- finance_dev/indices.py +2308 -0
- finance_dev/logos.py +692 -0
- finance_dev/market.py +1825 -0
- finance_dev/markets.py +952 -0
- finance_dev/models/__init__.py +4568 -0
- finance_dev/models/accountbalancev2.py +340 -0
- finance_dev/models/accountitem.py +78 -0
- finance_dev/models/accountposition.py +147 -0
- finance_dev/models/aggregatetechnicalindicatorsresponse.py +192 -0
- finance_dev/models/analystinsightitem.py +161 -0
- finance_dev/models/analystinsightsresponse.py +39 -0
- finance_dev/models/apperror.py +123 -0
- finance_dev/models/authenticationerrordetail.py +58 -0
- finance_dev/models/bankbranchesresponse.py +96 -0
- finance_dev/models/basicfinancials.py +243 -0
- finance_dev/models/bullbearanalysisresponse.py +150 -0
- finance_dev/models/cancelorderop.py +40 -0
- finance_dev/models/cancelordrequest_union.py +287 -0
- finance_dev/models/cancelordresponse.py +115 -0
- finance_dev/models/cashflowstatement.py +290 -0
- finance_dev/models/cashflowstatementsresponse.py +61 -0
- finance_dev/models/chartbars.py +111 -0
- finance_dev/models/chartconfig.py +81 -0
- finance_dev/models/chartresolution.py +46 -0
- finance_dev/models/companyesgresponse.py +408 -0
- finance_dev/models/companyexecutive.py +70 -0
- finance_dev/models/companyexecutiveresponse.py +39 -0
- finance_dev/models/companypeersresponse.py +38 -0
- finance_dev/models/companypresentationresponse.py +96 -0
- finance_dev/models/companyprofile.py +255 -0
- finance_dev/models/conferencecallsresponse.py +169 -0
- finance_dev/models/congressionaltradingresponse.py +138 -0
- finance_dev/models/covid19uscasesresponse.py +79 -0
- finance_dev/models/createconfigwatchlistop.py +40 -0
- finance_dev/models/createwatchlistrequest.py +43 -0
- finance_dev/models/dailymarketsummaryresponse.py +73 -0
- finance_dev/models/deleteconfigwatchlistbyidop.py +53 -0
- finance_dev/models/dividenditem.py +125 -0
- finance_dev/models/dividendsresponse.py +61 -0
- finance_dev/models/earningrelease.py +291 -0
- finance_dev/models/earningscallliveresponse.py +103 -0
- finance_dev/models/earningsqualityscoreresponse.py +140 -0
- finance_dev/models/earningssurprisesresponse.py +125 -0
- finance_dev/models/ebitdaestimatesresponse.py +176 -0
- finance_dev/models/ebitestimatesresponse.py +176 -0
- finance_dev/models/economicscalendarevent.py +160 -0
- finance_dev/models/economicsindicator.py +87 -0
- finance_dev/models/epsestimatesresponse.py +176 -0
- finance_dev/models/equitydetailsdto.py +569 -0
- finance_dev/models/errorcode.py +48 -0
- finance_dev/models/etblistresponse.py +43 -0
- finance_dev/models/etbsearchrequest.py +21 -0
- finance_dev/models/etbsearchresponse.py +43 -0
- finance_dev/models/etfcountryallocationresponse.py +113 -0
- finance_dev/models/etfholdingsresponse.py +163 -0
- finance_dev/models/etfprofileresponse.py +234 -0
- finance_dev/models/etfsectorallocationresponse.py +113 -0
- finance_dev/models/exchangecode.py +90 -0
- finance_dev/models/fdaadvisorycommitteecalendarresponse.py +88 -0
- finance_dev/models/filingsimilarityrecord.py +115 -0
- finance_dev/models/filingssimilarityindexdatawrapper.py +52 -0
- finance_dev/models/filingssimilarityindexresponse.py +42 -0
- finance_dev/models/financialratiosresponse.py +252 -0
- finance_dev/models/financialsreporteddatawrapper.py +49 -0
- finance_dev/models/financialsreportedresponse.py +42 -0
- finance_dev/models/financialsrevenuebreakdowndatawrapper.py +49 -0
- finance_dev/models/financialsrevenuebreakdownresponse.py +42 -0
- finance_dev/models/financialsstatementsdatawrapper.py +44 -0
- finance_dev/models/financialsstatementsresponse.py +42 -0
- finance_dev/models/financialstatement.py +171 -0
- finance_dev/models/financialstatementtype.py +14 -0
- finance_dev/models/getaccountbalanceop.py +53 -0
- finance_dev/models/getaccountpositionsop.py +53 -0
- finance_dev/models/getaccountsresponse.py +22 -0
- finance_dev/models/getaggregatetechnicalindicatorsop.py +94 -0
- finance_dev/models/getanalystinsightsop.py +164 -0
- finance_dev/models/getbankbranchesop.py +53 -0
- finance_dev/models/getbaseeventop.py +87 -0
- finance_dev/models/getbullbearanalysisop.py +91 -0
- finance_dev/models/getcashflowstatementsop.py +564 -0
- finance_dev/models/getchartconfigop.py +40 -0
- finance_dev/models/getcharthistoryop.py +122 -0
- finance_dev/models/getcharttimeop.py +39 -0
- finance_dev/models/getcompanyesgop.py +53 -0
- finance_dev/models/getcompanyexecutivesop.py +56 -0
- finance_dev/models/getcompanymetricsop.py +68 -0
- finance_dev/models/getcompanypeersop.py +53 -0
- finance_dev/models/getcompanypresentationop.py +56 -0
- finance_dev/models/getcompanyprofileop.py +86 -0
- finance_dev/models/getconferencecallsop.py +111 -0
- finance_dev/models/getconfigwatchlistbyidop.py +53 -0
- finance_dev/models/getconfigwatchlistsop.py +40 -0
- finance_dev/models/getcongressionaltradingop.py +73 -0
- finance_dev/models/getcovid19uscasesop.py +43 -0
- finance_dev/models/getdailymarketsummaryop.py +92 -0
- finance_dev/models/getdividendsop.py +294 -0
- finance_dev/models/getearningscalendarop.py +87 -0
- finance_dev/models/getearningscallliveop.py +91 -0
- finance_dev/models/getearningsqualityscoreop.py +81 -0
- finance_dev/models/getearningssurprisesop.py +80 -0
- finance_dev/models/getebitdaestimatesop.py +91 -0
- finance_dev/models/getebitestimatesop.py +88 -0
- finance_dev/models/geteconomicscalendarop.py +92 -0
- finance_dev/models/geteconomicscalendarresponse.py +56 -0
- finance_dev/models/getepsestimatesop.py +88 -0
- finance_dev/models/getequitydetailsop.py +56 -0
- finance_dev/models/getequitydetailsresponse.py +45 -0
- finance_dev/models/getetblistop.py +40 -0
- finance_dev/models/getetfcountryallocationop.py +80 -0
- finance_dev/models/getetfholdingsop.py +96 -0
- finance_dev/models/getetfprofileop.py +77 -0
- finance_dev/models/getetfsectorallocationop.py +80 -0
- finance_dev/models/geteventcontractsop.py +87 -0
- finance_dev/models/getfdaadvisorycommitteecalendarop.py +47 -0
- finance_dev/models/getfilingssimilarityindexop.py +102 -0
- finance_dev/models/getfinancialratiosop.py +612 -0
- finance_dev/models/getfinancialstatementsop.py +117 -0
- finance_dev/models/getfundownershipop.py +77 -0
- finance_dev/models/gethistoricaldataop.py +61 -0
- finance_dev/models/gethistoricalesgop.py +53 -0
- finance_dev/models/gethistorybatchop.py +74 -0
- finance_dev/models/gethistoryop.py +123 -0
- finance_dev/models/getincomestatementsop.py +564 -0
- finance_dev/models/getindexbarop.py +140 -0
- finance_dev/models/getindexbarsop.py +149 -0
- finance_dev/models/getindexchartbarsop.py +178 -0
- finance_dev/models/getindexrealtimevaluesop.py +94 -0
- finance_dev/models/getinflationexpectationsop.py +157 -0
- finance_dev/models/getinflationop.py +154 -0
- finance_dev/models/getinsidertransactionsop.py +90 -0
- finance_dev/models/getinstitutionalownershipop.py +99 -0
- finance_dev/models/getinstitutionalportfolioop.py +75 -0
- finance_dev/models/getinvestmentthemeop.py +68 -0
- finance_dev/models/getipocalendarop.py +63 -0
- finance_dev/models/getlobbyingop.py +70 -0
- finance_dev/models/getmarketbreadthop.py +40 -0
- finance_dev/models/getmarketholidaysop.py +65 -0
- finance_dev/models/getmarketstatusop.py +65 -0
- finance_dev/models/getmergersandacquisitionsop.py +113 -0
- finance_dev/models/getnetinflowop.py +40 -0
- finance_dev/models/getnewsbyidop.py +73 -0
- finance_dev/models/getnewsop.py +98 -0
- finance_dev/models/getnewssentimentop.py +53 -0
- finance_dev/models/getoptionchainsnapshotop.py +244 -0
- finance_dev/models/getoptioncontractsnapshotop.py +69 -0
- finance_dev/models/getoptiondetailsop.py +56 -0
- finance_dev/models/getoptiondetailsresponse.py +45 -0
- finance_dev/models/getoptionlasttradeop.py +56 -0
- finance_dev/models/getoptionopencloseop.py +66 -0
- finance_dev/models/getoptionpreviousdayop.py +56 -0
- finance_dev/models/getoptionquotesop.py +177 -0
- finance_dev/models/getoptionsactivityop.py +111 -0
- finance_dev/models/getoptionsetfstopvolumeop.py +70 -0
- finance_dev/models/getoptionsstockstopgainersop.py +70 -0
- finance_dev/models/getoptionsstockstopvolumeop.py +70 -0
- finance_dev/models/getoptionsunusualactivityop.py +100 -0
- finance_dev/models/getoptiontradesop.py +177 -0
- finance_dev/models/getordersv2response.py +66 -0
- finance_dev/models/getownershipdataop.py +77 -0
- finance_dev/models/getpositionsresponse.py +39 -0
- finance_dev/models/getpredictionorderop.py +88 -0
- finance_dev/models/getpricetargetop.py +53 -0
- finance_dev/models/getquotesop.py +53 -0
- finance_dev/models/getratingsop.py +164 -0
- finance_dev/models/getratingsresponse.py +39 -0
- finance_dev/models/getreportedfinancialsop.py +127 -0
- finance_dev/models/getrevenuebreakdownop.py +85 -0
- finance_dev/models/getrevenueestimatesop.py +91 -0
- finance_dev/models/getsecfilingsop.py +113 -0
- finance_dev/models/getsectortickersop.py +124 -0
- finance_dev/models/getsectorwisechangeop.py +84 -0
- finance_dev/models/getshortinterestop.py +334 -0
- finance_dev/models/getshortvolumeop.py +333 -0
- finance_dev/models/getsocialsentimentop.py +90 -0
- finance_dev/models/getspinoffsop.py +112 -0
- finance_dev/models/getstockaggregatesop.py +174 -0
- finance_dev/models/getstocklastquoteop.py +56 -0
- finance_dev/models/getstocklasttradeop.py +56 -0
- finance_dev/models/getstockopencloseop.py +90 -0
- finance_dev/models/getstockpreviousdayop.py +80 -0
- finance_dev/models/getstockquotesop.py +177 -0
- finance_dev/models/getstocksnapshotsop.py +82 -0
- finance_dev/models/getstocksplitsop.py +243 -0
- finance_dev/models/getstocktradesop.py +177 -0
- finance_dev/models/getsupplychainop.py +53 -0
- finance_dev/models/getsupportresistancelevelsop.py +90 -0
- finance_dev/models/getsymbolinfoop.py +53 -0
- finance_dev/models/gettechnicalindicatorop.py +172 -0
- finance_dev/models/gettechnicalpatternsop.py +88 -0
- finance_dev/models/gettenderoffersop.py +112 -0
- finance_dev/models/gettickhistoryop.py +104 -0
- finance_dev/models/gettopgainersop.py +78 -0
- finance_dev/models/gettoplosersop.py +78 -0
- finance_dev/models/gettopmostactiveop.py +78 -0
- finance_dev/models/gettranscriptop.py +53 -0
- finance_dev/models/gettreasuryyieldsop.py +157 -0
- finance_dev/models/getunifiedsnapshotop.py +223 -0
- finance_dev/models/getupgradesdowngradesop.py +91 -0
- finance_dev/models/getusaspendingop.py +70 -0
- finance_dev/models/getuseraccountsop.py +40 -0
- finance_dev/models/getusptopatentsop.py +70 -0
- finance_dev/models/getvisaapplicationsop.py +73 -0
- finance_dev/models/historicalesgresponse.py +439 -0
- finance_dev/models/httpmetadata.py +24 -0
- finance_dev/models/incomestatement.py +296 -0
- finance_dev/models/incomestatementsresponse.py +61 -0
- finance_dev/models/indexbarresponse.py +194 -0
- finance_dev/models/indexbarsresponse.py +123 -0
- finance_dev/models/indexchartbarsresponse.py +213 -0
- finance_dev/models/indexgroupsresponse.py +78 -0
- finance_dev/models/indexlistresponse.py +95 -0
- finance_dev/models/indexsearchresponse.py +93 -0
- finance_dev/models/indicesbygroupresponse.py +93 -0
- finance_dev/models/indicesidentifiertype.py +28 -0
- finance_dev/models/indicesrealtimeindexinfo.py +67 -0
- finance_dev/models/indicesrealtimeindexvalue.py +157 -0
- finance_dev/models/indicesrealtimevaluesitem.py +80 -0
- finance_dev/models/indicesrealtimevaluesresponse.py +42 -0
- finance_dev/models/inflationexpectationsresponse.py +140 -0
- finance_dev/models/inflationresponse.py +132 -0
- finance_dev/models/insidertransaction.py +97 -0
- finance_dev/models/insidertransactionsresponse.py +39 -0
- finance_dev/models/institutionalholding.py +77 -0
- finance_dev/models/institutionalownershipresponse.py +39 -0
- finance_dev/models/institutionalportfolioresponse.py +39 -0
- finance_dev/models/investmentthemeid.py +35 -0
- finance_dev/models/investmentthemeresponse.py +80 -0
- finance_dev/models/ipocalendarresponse.py +39 -0
- finance_dev/models/ipoitem.py +93 -0
- finance_dev/models/listactiveordersop.py +87 -0
- finance_dev/models/listcategoriesop.py +79 -0
- finance_dev/models/listindexgroupsop.py +40 -0
- finance_dev/models/listindicesbygroupop.py +58 -0
- finance_dev/models/listindicesop.py +91 -0
- finance_dev/models/listoptioncontractsop.py +66 -0
- finance_dev/models/listoptionexpirydatesop.py +56 -0
- finance_dev/models/listorderhistoryop.py +139 -0
- finance_dev/models/listpredictionordersop.py +134 -0
- finance_dev/models/listtranscriptsop.py +53 -0
- finance_dev/models/lobbyingresponse.py +166 -0
- finance_dev/models/logosearchresponse.py +152 -0
- finance_dev/models/logosyncresponse.py +277 -0
- finance_dev/models/marketbreadth.py +97 -0
- finance_dev/models/marketbreadthresponse.py +44 -0
- finance_dev/models/marketholiday.py +56 -0
- finance_dev/models/marketholidayresponse.py +39 -0
- finance_dev/models/marketstatus.py +67 -0
- finance_dev/models/mergersandacquisitionsresponse.py +186 -0
- finance_dev/models/metricseriespoint.py +43 -0
- finance_dev/models/netinflow.py +81 -0
- finance_dev/models/netinflowresponse.py +44 -0
- finance_dev/models/newsitem.py +102 -0
- finance_dev/models/newslistresponse.py +128 -0
- finance_dev/models/newssentimentresponse.py +176 -0
- finance_dev/models/newstypeenum.py +16 -0
- finance_dev/models/optionchainsnapshotresponse.py +64 -0
- finance_dev/models/optioncontractsnapshotresponse.py +64 -0
- finance_dev/models/optioncontractsnapshotrow.py +164 -0
- finance_dev/models/optioncontractsresponse.py +131 -0
- finance_dev/models/optiondetailsdto.py +72 -0
- finance_dev/models/optionexpirydatesresponse.py +53 -0
- finance_dev/models/optionlasttraderesponse.py +169 -0
- finance_dev/models/optionopencloseresponse.py +97 -0
- finance_dev/models/optionpreviousdayresponse.py +89 -0
- finance_dev/models/optionquotesresponse.py +138 -0
- finance_dev/models/optionsactivityresponse.py +265 -0
- finance_dev/models/optionsnapshotcontractdetails.py +85 -0
- finance_dev/models/optionsnapshotdaybar.py +107 -0
- finance_dev/models/optionsnapshotgreeks.py +67 -0
- finance_dev/models/optionsnapshotlastquote.py +116 -0
- finance_dev/models/optionsnapshotlasttrade.py +102 -0
- finance_dev/models/optionsnapshotunderlying.py +86 -0
- finance_dev/models/optionsscreeneritem.py +151 -0
- finance_dev/models/optionsunusualactivityresponse.py +62 -0
- finance_dev/models/optionsunusualactivitytrade.py +103 -0
- finance_dev/models/optiontradesresponse.py +132 -0
- finance_dev/models/orderrequesttimeinforceenum.py +29 -0
- finance_dev/models/ordersideenum.py +20 -0
- finance_dev/models/ordertypeenum.py +20 -0
- finance_dev/models/ordleg.py +162 -0
- finance_dev/models/ordresponse.py +202 -0
- finance_dev/models/ownershipdataresponse.py +39 -0
- finance_dev/models/ownershiprecord.py +74 -0
- finance_dev/models/placeorderop.py +40 -0
- finance_dev/models/placeordrequest_union.py +335 -0
- finance_dev/models/placepredictionorderop.py +114 -0
- finance_dev/models/predmdbaseevent.py +62 -0
- finance_dev/models/predmdbaseeventhit.py +53 -0
- finance_dev/models/predmdbaseeventsearchresult.py +46 -0
- finance_dev/models/predmdbaseeventwithevents.py +32 -0
- finance_dev/models/predmdbatchhistoryrequest.py +16 -0
- finance_dev/models/predmdbatchhistoryresponse.py +16 -0
- finance_dev/models/predmdcategory.py +48 -0
- finance_dev/models/predmdcontract.py +177 -0
- finance_dev/models/predmdcontracthit.py +157 -0
- finance_dev/models/predmdcontractsearchresult.py +46 -0
- finance_dev/models/predmdevent.py +136 -0
- finance_dev/models/predmdeventhit.py +73 -0
- finance_dev/models/predmdeventsearchresult.py +46 -0
- finance_dev/models/predmdeventwithcontracts.py +22 -0
- finance_dev/models/predmdhistoryrequest.py +59 -0
- finance_dev/models/predmdhistoryresponse.py +53 -0
- finance_dev/models/predmdtick.py +53 -0
- finance_dev/models/predordersapperror.py +78 -0
- finance_dev/models/predordersorder.py +267 -0
- finance_dev/models/predordersorderdetail.py +26 -0
- finance_dev/models/predordersorderpage.py +45 -0
- finance_dev/models/predordersorderreport.py +88 -0
- finance_dev/models/predordersplaceorderrequest.py +159 -0
- finance_dev/models/previeworderop.py +40 -0
- finance_dev/models/previeworderresponse.py +127 -0
- finance_dev/models/pricetargetresponse.py +89 -0
- finance_dev/models/quotedata.py +49 -0
- finance_dev/models/quotesresponse.py +62 -0
- finance_dev/models/quotevalues.py +114 -0
- finance_dev/models/rating.py +193 -0
- finance_dev/models/ratingsaccuracy.py +242 -0
- finance_dev/models/replaceconfigwatchlistsop.py +40 -0
- finance_dev/models/replaceorderop.py +40 -0
- finance_dev/models/replaceordrequest_union.py +367 -0
- finance_dev/models/replaceordresponse.py +144 -0
- finance_dev/models/reportedbsitem.py +53 -0
- finance_dev/models/reportedfiling.py +110 -0
- finance_dev/models/reportedreport.py +39 -0
- finance_dev/models/reportingfrequency.py +16 -0
- finance_dev/models/revenuebreakdownaxis.py +52 -0
- finance_dev/models/revenuebreakdowndatapoint.py +58 -0
- finance_dev/models/revenuebreakdownentry.py +51 -0
- finance_dev/models/revenuebreakdowninner.py +75 -0
- finance_dev/models/revenueestimatesresponse.py +176 -0
- finance_dev/models/screenclause.py +70 -0
- finance_dev/models/screengroup.py +75 -0
- finance_dev/models/searchetbsymbolsop.py +40 -0
- finance_dev/models/searchindicesop.py +55 -0
- finance_dev/models/searchlogosop.py +158 -0
- finance_dev/models/searchmarketsymbolsop.py +80 -0
- finance_dev/models/searchop.py +232 -0
- finance_dev/models/searchsymbolitem.py +76 -0
- finance_dev/models/searchsymbolresponseitem.py +71 -0
- finance_dev/models/searchsymbolsop.py +77 -0
- finance_dev/models/secfiling.py +91 -0
- finance_dev/models/secfilingsresponse.py +39 -0
- finance_dev/models/sectoravgchange.py +50 -0
- finance_dev/models/security.py +59 -0
- finance_dev/models/securitytypeenum.py +16 -0
- finance_dev/models/shortinterestresponse.py +126 -0
- finance_dev/models/shortvolumeresponse.py +198 -0
- finance_dev/models/socialsentimentresponse.py +124 -0
- finance_dev/models/sortorderenum.py +13 -0
- finance_dev/models/spinoffsresponse.py +136 -0
- finance_dev/models/stockaggregatesresponse.py +92 -0
- finance_dev/models/stocklastquoteresponse.py +175 -0
- finance_dev/models/stocklasttraderesponse.py +169 -0
- finance_dev/models/stockohlcbar.py +85 -0
- finance_dev/models/stockopencloseresponse.py +109 -0
- finance_dev/models/stockpreviousdayresponse.py +86 -0
- finance_dev/models/stockquotesresponse.py +170 -0
- finance_dev/models/stockscreenerop.py +144 -0
- finance_dev/models/stockscreenerrequest.py +131 -0
- finance_dev/models/stockscreenerresponse.py +197 -0
- finance_dev/models/stocksnapshotsresponse.py +454 -0
- finance_dev/models/stocksplitsresponse.py +144 -0
- finance_dev/models/stocktradesresponse.py +164 -0
- finance_dev/models/supplychainresponse.py +158 -0
- finance_dev/models/supportresistancelevelsresponse.py +68 -0
- finance_dev/models/symboldetails.py +119 -0
- finance_dev/models/symbolerror.py +43 -0
- finance_dev/models/symbolinfo.py +183 -0
- finance_dev/models/synclogosop.py +146 -0
- finance_dev/models/technicalindicatorresponse.py +43 -0
- finance_dev/models/technicalindicatortype.py +21 -0
- finance_dev/models/technicalpatternsresponse.py +249 -0
- finance_dev/models/tenderofferidentifiertype.py +26 -0
- finance_dev/models/tenderoffersresponse.py +548 -0
- finance_dev/models/tickchartbars.py +104 -0
- finance_dev/models/tickresolution.py +20 -0
- finance_dev/models/timeinforceenum.py +26 -0
- finance_dev/models/tradeorderlegv2.py +164 -0
- finance_dev/models/tradeorderv2.py +434 -0
- finance_dev/models/transcriptresponse.py +162 -0
- finance_dev/models/transcriptsresponse.py +89 -0
- finance_dev/models/treasuryyieldsresponse.py +160 -0
- finance_dev/models/unifiedsnapshotresponse.py +308 -0
- finance_dev/models/updateconfigwatchlistbyidop.py +65 -0
- finance_dev/models/updatewatchlistrequest_union.py +134 -0
- finance_dev/models/upgradesdowngradesresponse.py +98 -0
- finance_dev/models/usaspendingresponse.py +222 -0
- finance_dev/models/usptopatentsresponse.py +134 -0
- finance_dev/models/visaapplicationsresponse.py +228 -0
- finance_dev/models/watchlist.py +68 -0
- finance_dev/models/watchlistrequest.py +43 -0
- finance_dev/models/watchlistresponse.py +44 -0
- finance_dev/news_sdk.py +829 -0
- finance_dev/options.py +3443 -0
- finance_dev/orders.py +1907 -0
- finance_dev/ownership.py +1386 -0
- finance_dev/predictions.py +29 -0
- finance_dev/predictions_orders.py +852 -0
- finance_dev/py.typed +1 -0
- finance_dev/sdk.py +347 -0
- finance_dev/sdkconfiguration.py +50 -0
- finance_dev/signals.py +338 -0
- finance_dev/stocks.py +3131 -0
- finance_dev/technicalanalysis_sdk.py +1137 -0
- finance_dev/types/__init__.py +25 -0
- finance_dev/types/base64fileinput.py +44 -0
- finance_dev/types/basemodel.py +78 -0
- finance_dev/utils/__init__.py +181 -0
- finance_dev/utils/annotations.py +80 -0
- finance_dev/utils/datetimes.py +42 -0
- finance_dev/utils/dynamic_imports.py +55 -0
- finance_dev/utils/enums.py +135 -0
- finance_dev/utils/eventstreaming.py +327 -0
- finance_dev/utils/forms.py +240 -0
- finance_dev/utils/headers.py +137 -0
- finance_dev/utils/logger.py +23 -0
- finance_dev/utils/metadata.py +120 -0
- finance_dev/utils/queryparams.py +218 -0
- finance_dev/utils/requestbodies.py +68 -0
- finance_dev/utils/retries.py +373 -0
- finance_dev/utils/security.py +199 -0
- finance_dev/utils/serializers.py +327 -0
- finance_dev/utils/unmarshal_json_response.py +39 -0
- finance_dev/utils/url.py +155 -0
- finance_dev/utils/values.py +143 -0
- finance_dev/watchlist_sdk.py +1583 -0
- finance_dev/websocket/__init__.py +57 -0
- finance_dev/websocket/account.py +5 -0
- finance_dev/websocket/auth.py +124 -0
- finance_dev/websocket/chart.py +5 -0
- finance_dev/websocket/codec.py +66 -0
- finance_dev/websocket/config.py +52 -0
- finance_dev/websocket/errors.py +54 -0
- finance_dev/websocket/market.py +5 -0
- finance_dev/websocket/models/__init__.py +52 -0
- finance_dev/websocket/models/account.py +60 -0
- finance_dev/websocket/models/chart.py +44 -0
- finance_dev/websocket/models/common.py +85 -0
- finance_dev/websocket/models/market.py +113 -0
- finance_dev/websocket/resources.py +327 -0
- finance_dev/websocket/sdk.py +13 -0
- finance_dev/websocket/transport/async_connection.py +493 -0
- finance_dev/websocket/transport/base.py +78 -0
- finance_dev/websocket/transport/sync_connection.py +470 -0
- finance_dev-0.9.0.dist-info/METADATA +913 -0
- finance_dev-0.9.0.dist-info/RECORD +486 -0
- finance_dev-0.9.0.dist-info/WHEEL +5 -0
- finance_dev-0.9.0.dist-info/top_level.txt +1 -0
finance_dev/chart.py
ADDED
|
@@ -0,0 +1,1881 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
# @generated-id: c83a8a116c53
|
|
3
|
+
|
|
4
|
+
from .basesdk import BaseSDK
|
|
5
|
+
from finance_dev import errors, models, utils
|
|
6
|
+
from finance_dev._hooks import HookContext
|
|
7
|
+
from finance_dev.types import OptionalNullable, UNSET
|
|
8
|
+
from finance_dev.utils.unmarshal_json_response import unmarshal_json_response
|
|
9
|
+
from typing import Any, List, Mapping, Optional
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class Chart(BaseSDK):
|
|
13
|
+
def get_chart_config(
|
|
14
|
+
self,
|
|
15
|
+
*,
|
|
16
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
17
|
+
server_url: Optional[str] = None,
|
|
18
|
+
timeout_ms: Optional[int] = None,
|
|
19
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
20
|
+
) -> models.GetChartConfigResponse:
|
|
21
|
+
r"""Get Chart Configuration
|
|
22
|
+
|
|
23
|
+
Returns the chart configuration including supported resolutions and charting capabilities. The response includes tick-based resolutions with a `T` suffix, minute-based resolutions, and daily, weekly, and monthly multipliers used by charting clients. It also indicates whether intraday, daily, weekly, and monthly data are available, plus search and time endpoint support.
|
|
24
|
+
|
|
25
|
+
If set, this operation will use `client_id` from the global security.
|
|
26
|
+
|
|
27
|
+
:param retries: Override the default retry configuration for this method
|
|
28
|
+
:param server_url: Override the default server URL for this method
|
|
29
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
30
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
31
|
+
"""
|
|
32
|
+
base_url = None
|
|
33
|
+
url_variables = None
|
|
34
|
+
if timeout_ms is None:
|
|
35
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
36
|
+
|
|
37
|
+
if timeout_ms is None:
|
|
38
|
+
timeout_ms = 30000
|
|
39
|
+
|
|
40
|
+
if server_url is not None:
|
|
41
|
+
base_url = server_url
|
|
42
|
+
else:
|
|
43
|
+
base_url = self._get_url(base_url, url_variables)
|
|
44
|
+
req = self._build_request(
|
|
45
|
+
method="GET",
|
|
46
|
+
path="/v1/chart/config",
|
|
47
|
+
base_url=base_url,
|
|
48
|
+
url_variables=url_variables,
|
|
49
|
+
request=None,
|
|
50
|
+
request_body_required=False,
|
|
51
|
+
request_has_path_params=False,
|
|
52
|
+
request_has_query_params=True,
|
|
53
|
+
user_agent_header="user-agent",
|
|
54
|
+
accept_header_value="application/json",
|
|
55
|
+
http_headers=http_headers,
|
|
56
|
+
security=self.sdk_configuration.security,
|
|
57
|
+
allow_empty_value=None,
|
|
58
|
+
allowed_fields=["client_id"],
|
|
59
|
+
timeout_ms=timeout_ms,
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
if retries == UNSET:
|
|
63
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
64
|
+
retries = self.sdk_configuration.retry_config
|
|
65
|
+
else:
|
|
66
|
+
retries = utils.RetryConfig(
|
|
67
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
retry_config = None
|
|
71
|
+
if isinstance(retries, utils.RetryConfig):
|
|
72
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
73
|
+
|
|
74
|
+
http_res = self.do_request(
|
|
75
|
+
hook_ctx=HookContext(
|
|
76
|
+
config=self.sdk_configuration,
|
|
77
|
+
base_url=base_url or "",
|
|
78
|
+
operation_id="getChartConfig",
|
|
79
|
+
oauth2_scopes=["market:information"],
|
|
80
|
+
security_source=self.sdk_configuration.security,
|
|
81
|
+
tags=["Chart"],
|
|
82
|
+
extensions=None,
|
|
83
|
+
),
|
|
84
|
+
request=req,
|
|
85
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
86
|
+
retry_config=retry_config,
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
response_data: Any = None
|
|
90
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
91
|
+
return models.GetChartConfigResponse(
|
|
92
|
+
chart_config=unmarshal_json_response(
|
|
93
|
+
Optional[models.ChartConfig], http_res
|
|
94
|
+
),
|
|
95
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
96
|
+
)
|
|
97
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
98
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
99
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
100
|
+
request=req, response=http_res
|
|
101
|
+
)
|
|
102
|
+
raise errors.BadRequest(response_data, http_res)
|
|
103
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
104
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
105
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
106
|
+
request=req, response=http_res
|
|
107
|
+
)
|
|
108
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
109
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
110
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
111
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
112
|
+
request=req, response=http_res
|
|
113
|
+
)
|
|
114
|
+
raise errors.Forbidden(response_data, http_res)
|
|
115
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
116
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
117
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
118
|
+
request=req, response=http_res
|
|
119
|
+
)
|
|
120
|
+
raise errors.NotFound(response_data, http_res)
|
|
121
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
122
|
+
response_data = unmarshal_json_response(
|
|
123
|
+
errors.InternalServerErrorUnion, http_res
|
|
124
|
+
)
|
|
125
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
126
|
+
request=req, response=http_res
|
|
127
|
+
)
|
|
128
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
129
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
130
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
131
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
132
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
133
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
134
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
135
|
+
|
|
136
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
137
|
+
|
|
138
|
+
async def get_chart_config_async(
|
|
139
|
+
self,
|
|
140
|
+
*,
|
|
141
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
142
|
+
server_url: Optional[str] = None,
|
|
143
|
+
timeout_ms: Optional[int] = None,
|
|
144
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
145
|
+
) -> models.GetChartConfigResponse:
|
|
146
|
+
r"""Get Chart Configuration
|
|
147
|
+
|
|
148
|
+
Returns the chart configuration including supported resolutions and charting capabilities. The response includes tick-based resolutions with a `T` suffix, minute-based resolutions, and daily, weekly, and monthly multipliers used by charting clients. It also indicates whether intraday, daily, weekly, and monthly data are available, plus search and time endpoint support.
|
|
149
|
+
|
|
150
|
+
If set, this operation will use `client_id` from the global security.
|
|
151
|
+
|
|
152
|
+
:param retries: Override the default retry configuration for this method
|
|
153
|
+
:param server_url: Override the default server URL for this method
|
|
154
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
155
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
156
|
+
"""
|
|
157
|
+
base_url = None
|
|
158
|
+
url_variables = None
|
|
159
|
+
if timeout_ms is None:
|
|
160
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
161
|
+
|
|
162
|
+
if timeout_ms is None:
|
|
163
|
+
timeout_ms = 30000
|
|
164
|
+
|
|
165
|
+
if server_url is not None:
|
|
166
|
+
base_url = server_url
|
|
167
|
+
else:
|
|
168
|
+
base_url = self._get_url(base_url, url_variables)
|
|
169
|
+
req = self._build_request_async(
|
|
170
|
+
method="GET",
|
|
171
|
+
path="/v1/chart/config",
|
|
172
|
+
base_url=base_url,
|
|
173
|
+
url_variables=url_variables,
|
|
174
|
+
request=None,
|
|
175
|
+
request_body_required=False,
|
|
176
|
+
request_has_path_params=False,
|
|
177
|
+
request_has_query_params=True,
|
|
178
|
+
user_agent_header="user-agent",
|
|
179
|
+
accept_header_value="application/json",
|
|
180
|
+
http_headers=http_headers,
|
|
181
|
+
security=self.sdk_configuration.security,
|
|
182
|
+
allow_empty_value=None,
|
|
183
|
+
allowed_fields=["client_id"],
|
|
184
|
+
timeout_ms=timeout_ms,
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
if retries == UNSET:
|
|
188
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
189
|
+
retries = self.sdk_configuration.retry_config
|
|
190
|
+
else:
|
|
191
|
+
retries = utils.RetryConfig(
|
|
192
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
193
|
+
)
|
|
194
|
+
|
|
195
|
+
retry_config = None
|
|
196
|
+
if isinstance(retries, utils.RetryConfig):
|
|
197
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
198
|
+
|
|
199
|
+
http_res = await self.do_request_async(
|
|
200
|
+
hook_ctx=HookContext(
|
|
201
|
+
config=self.sdk_configuration,
|
|
202
|
+
base_url=base_url or "",
|
|
203
|
+
operation_id="getChartConfig",
|
|
204
|
+
oauth2_scopes=["market:information"],
|
|
205
|
+
security_source=self.sdk_configuration.security,
|
|
206
|
+
tags=["Chart"],
|
|
207
|
+
extensions=None,
|
|
208
|
+
),
|
|
209
|
+
request=req,
|
|
210
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
211
|
+
retry_config=retry_config,
|
|
212
|
+
)
|
|
213
|
+
|
|
214
|
+
response_data: Any = None
|
|
215
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
216
|
+
return models.GetChartConfigResponse(
|
|
217
|
+
chart_config=unmarshal_json_response(
|
|
218
|
+
Optional[models.ChartConfig], http_res
|
|
219
|
+
),
|
|
220
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
221
|
+
)
|
|
222
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
223
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
224
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
225
|
+
request=req, response=http_res
|
|
226
|
+
)
|
|
227
|
+
raise errors.BadRequest(response_data, http_res)
|
|
228
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
229
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
230
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
231
|
+
request=req, response=http_res
|
|
232
|
+
)
|
|
233
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
234
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
235
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
236
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
237
|
+
request=req, response=http_res
|
|
238
|
+
)
|
|
239
|
+
raise errors.Forbidden(response_data, http_res)
|
|
240
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
241
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
242
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
243
|
+
request=req, response=http_res
|
|
244
|
+
)
|
|
245
|
+
raise errors.NotFound(response_data, http_res)
|
|
246
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
247
|
+
response_data = unmarshal_json_response(
|
|
248
|
+
errors.InternalServerErrorUnion, http_res
|
|
249
|
+
)
|
|
250
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
251
|
+
request=req, response=http_res
|
|
252
|
+
)
|
|
253
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
254
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
255
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
256
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
257
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
258
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
259
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
260
|
+
|
|
261
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
262
|
+
|
|
263
|
+
def get_chart_history(
|
|
264
|
+
self,
|
|
265
|
+
*,
|
|
266
|
+
symbol: str,
|
|
267
|
+
resolution: models.ChartResolution,
|
|
268
|
+
from_: int,
|
|
269
|
+
to: int,
|
|
270
|
+
first_data_request: Optional[str] = None,
|
|
271
|
+
include_extended: Optional[bool] = False,
|
|
272
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
273
|
+
server_url: Optional[str] = None,
|
|
274
|
+
timeout_ms: Optional[int] = None,
|
|
275
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
276
|
+
) -> models.GetChartHistoryResponse:
|
|
277
|
+
r"""Get Historical Chart Data
|
|
278
|
+
|
|
279
|
+
Retrieves historical price bars (OHLCV - Open, High, Low, Close, Volume) for a specific symbol within a date range. This endpoint supports various time resolutions from seconds to months. The data is returned in arrays format optimized for charting libraries, with timestamps in Unix format (seconds).
|
|
280
|
+
|
|
281
|
+
If set, this operation will use `client_id` from the global security.
|
|
282
|
+
|
|
283
|
+
:param symbol: Symbol to fetch bars for. Use the exact symbol returned by symbol search, such as `AAPL` for equities or the selected chart symbol for futures/options.
|
|
284
|
+
:param resolution: Candle size. Use minute values such as `1`, `5`, or `60` for intraday charts, `D` or `1D` for daily charts, `W` or `1W` for weekly charts, and `M`, `1M`, `3M`, `6M`, or `12M` for monthly views.
|
|
285
|
+
:param from_: Start of the chart window as a Unix timestamp. Send seconds; millisecond timestamps are accepted and converted automatically. Negative timestamps are clamped to the Unix epoch.
|
|
286
|
+
:param to: End of the chart window as a Unix timestamp. Must be greater than `from`. Send seconds; millisecond timestamps are accepted and converted automatically. A range entirely before the Unix epoch returns no_data.
|
|
287
|
+
:param first_data_request: TradingView compatibility flag. Omit or send a non-zero value for the first chart request; send `0` for follow-up history requests.
|
|
288
|
+
:param include_extended: Set to `true` when the chart should include eligible pre-market and after-hours bars. Leave `false` for regular session charts.
|
|
289
|
+
:param retries: Override the default retry configuration for this method
|
|
290
|
+
:param server_url: Override the default server URL for this method
|
|
291
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
292
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
293
|
+
"""
|
|
294
|
+
base_url = None
|
|
295
|
+
url_variables = None
|
|
296
|
+
if timeout_ms is None:
|
|
297
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
298
|
+
|
|
299
|
+
if timeout_ms is None:
|
|
300
|
+
timeout_ms = 30000
|
|
301
|
+
|
|
302
|
+
if server_url is not None:
|
|
303
|
+
base_url = server_url
|
|
304
|
+
else:
|
|
305
|
+
base_url = self._get_url(base_url, url_variables)
|
|
306
|
+
|
|
307
|
+
request = models.GetChartHistoryRequest(
|
|
308
|
+
symbol=symbol,
|
|
309
|
+
resolution=resolution,
|
|
310
|
+
from_=from_,
|
|
311
|
+
to=to,
|
|
312
|
+
first_data_request=first_data_request,
|
|
313
|
+
include_extended=include_extended,
|
|
314
|
+
)
|
|
315
|
+
|
|
316
|
+
req = self._build_request(
|
|
317
|
+
method="GET",
|
|
318
|
+
path="/v1/chart/history",
|
|
319
|
+
base_url=base_url,
|
|
320
|
+
url_variables=url_variables,
|
|
321
|
+
request=request,
|
|
322
|
+
request_body_required=False,
|
|
323
|
+
request_has_path_params=False,
|
|
324
|
+
request_has_query_params=True,
|
|
325
|
+
user_agent_header="user-agent",
|
|
326
|
+
accept_header_value="application/json",
|
|
327
|
+
http_headers=http_headers,
|
|
328
|
+
security=self.sdk_configuration.security,
|
|
329
|
+
allow_empty_value=None,
|
|
330
|
+
allowed_fields=["client_id"],
|
|
331
|
+
timeout_ms=timeout_ms,
|
|
332
|
+
)
|
|
333
|
+
|
|
334
|
+
if retries == UNSET:
|
|
335
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
336
|
+
retries = self.sdk_configuration.retry_config
|
|
337
|
+
else:
|
|
338
|
+
retries = utils.RetryConfig(
|
|
339
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
340
|
+
)
|
|
341
|
+
|
|
342
|
+
retry_config = None
|
|
343
|
+
if isinstance(retries, utils.RetryConfig):
|
|
344
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
345
|
+
|
|
346
|
+
http_res = self.do_request(
|
|
347
|
+
hook_ctx=HookContext(
|
|
348
|
+
config=self.sdk_configuration,
|
|
349
|
+
base_url=base_url or "",
|
|
350
|
+
operation_id="getChartHistory",
|
|
351
|
+
oauth2_scopes=["market:information"],
|
|
352
|
+
security_source=self.sdk_configuration.security,
|
|
353
|
+
tags=["Chart"],
|
|
354
|
+
extensions=None,
|
|
355
|
+
),
|
|
356
|
+
request=req,
|
|
357
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
358
|
+
retry_config=retry_config,
|
|
359
|
+
)
|
|
360
|
+
|
|
361
|
+
response_data: Any = None
|
|
362
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
363
|
+
return models.GetChartHistoryResponse(
|
|
364
|
+
chart_bars=unmarshal_json_response(
|
|
365
|
+
Optional[models.ChartBars], http_res
|
|
366
|
+
),
|
|
367
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
368
|
+
)
|
|
369
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
370
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
371
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
372
|
+
request=req, response=http_res
|
|
373
|
+
)
|
|
374
|
+
raise errors.BadRequest(response_data, http_res)
|
|
375
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
376
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
377
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
378
|
+
request=req, response=http_res
|
|
379
|
+
)
|
|
380
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
381
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
382
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
383
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
384
|
+
request=req, response=http_res
|
|
385
|
+
)
|
|
386
|
+
raise errors.Forbidden(response_data, http_res)
|
|
387
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
388
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
389
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
390
|
+
request=req, response=http_res
|
|
391
|
+
)
|
|
392
|
+
raise errors.NotFound(response_data, http_res)
|
|
393
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
394
|
+
response_data = unmarshal_json_response(
|
|
395
|
+
errors.InternalServerErrorUnion, http_res
|
|
396
|
+
)
|
|
397
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
398
|
+
request=req, response=http_res
|
|
399
|
+
)
|
|
400
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
401
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
402
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
403
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
404
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
405
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
406
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
407
|
+
|
|
408
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
409
|
+
|
|
410
|
+
async def get_chart_history_async(
|
|
411
|
+
self,
|
|
412
|
+
*,
|
|
413
|
+
symbol: str,
|
|
414
|
+
resolution: models.ChartResolution,
|
|
415
|
+
from_: int,
|
|
416
|
+
to: int,
|
|
417
|
+
first_data_request: Optional[str] = None,
|
|
418
|
+
include_extended: Optional[bool] = False,
|
|
419
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
420
|
+
server_url: Optional[str] = None,
|
|
421
|
+
timeout_ms: Optional[int] = None,
|
|
422
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
423
|
+
) -> models.GetChartHistoryResponse:
|
|
424
|
+
r"""Get Historical Chart Data
|
|
425
|
+
|
|
426
|
+
Retrieves historical price bars (OHLCV - Open, High, Low, Close, Volume) for a specific symbol within a date range. This endpoint supports various time resolutions from seconds to months. The data is returned in arrays format optimized for charting libraries, with timestamps in Unix format (seconds).
|
|
427
|
+
|
|
428
|
+
If set, this operation will use `client_id` from the global security.
|
|
429
|
+
|
|
430
|
+
:param symbol: Symbol to fetch bars for. Use the exact symbol returned by symbol search, such as `AAPL` for equities or the selected chart symbol for futures/options.
|
|
431
|
+
:param resolution: Candle size. Use minute values such as `1`, `5`, or `60` for intraday charts, `D` or `1D` for daily charts, `W` or `1W` for weekly charts, and `M`, `1M`, `3M`, `6M`, or `12M` for monthly views.
|
|
432
|
+
:param from_: Start of the chart window as a Unix timestamp. Send seconds; millisecond timestamps are accepted and converted automatically. Negative timestamps are clamped to the Unix epoch.
|
|
433
|
+
:param to: End of the chart window as a Unix timestamp. Must be greater than `from`. Send seconds; millisecond timestamps are accepted and converted automatically. A range entirely before the Unix epoch returns no_data.
|
|
434
|
+
:param first_data_request: TradingView compatibility flag. Omit or send a non-zero value for the first chart request; send `0` for follow-up history requests.
|
|
435
|
+
:param include_extended: Set to `true` when the chart should include eligible pre-market and after-hours bars. Leave `false` for regular session charts.
|
|
436
|
+
:param retries: Override the default retry configuration for this method
|
|
437
|
+
:param server_url: Override the default server URL for this method
|
|
438
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
439
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
440
|
+
"""
|
|
441
|
+
base_url = None
|
|
442
|
+
url_variables = None
|
|
443
|
+
if timeout_ms is None:
|
|
444
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
445
|
+
|
|
446
|
+
if timeout_ms is None:
|
|
447
|
+
timeout_ms = 30000
|
|
448
|
+
|
|
449
|
+
if server_url is not None:
|
|
450
|
+
base_url = server_url
|
|
451
|
+
else:
|
|
452
|
+
base_url = self._get_url(base_url, url_variables)
|
|
453
|
+
|
|
454
|
+
request = models.GetChartHistoryRequest(
|
|
455
|
+
symbol=symbol,
|
|
456
|
+
resolution=resolution,
|
|
457
|
+
from_=from_,
|
|
458
|
+
to=to,
|
|
459
|
+
first_data_request=first_data_request,
|
|
460
|
+
include_extended=include_extended,
|
|
461
|
+
)
|
|
462
|
+
|
|
463
|
+
req = self._build_request_async(
|
|
464
|
+
method="GET",
|
|
465
|
+
path="/v1/chart/history",
|
|
466
|
+
base_url=base_url,
|
|
467
|
+
url_variables=url_variables,
|
|
468
|
+
request=request,
|
|
469
|
+
request_body_required=False,
|
|
470
|
+
request_has_path_params=False,
|
|
471
|
+
request_has_query_params=True,
|
|
472
|
+
user_agent_header="user-agent",
|
|
473
|
+
accept_header_value="application/json",
|
|
474
|
+
http_headers=http_headers,
|
|
475
|
+
security=self.sdk_configuration.security,
|
|
476
|
+
allow_empty_value=None,
|
|
477
|
+
allowed_fields=["client_id"],
|
|
478
|
+
timeout_ms=timeout_ms,
|
|
479
|
+
)
|
|
480
|
+
|
|
481
|
+
if retries == UNSET:
|
|
482
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
483
|
+
retries = self.sdk_configuration.retry_config
|
|
484
|
+
else:
|
|
485
|
+
retries = utils.RetryConfig(
|
|
486
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
487
|
+
)
|
|
488
|
+
|
|
489
|
+
retry_config = None
|
|
490
|
+
if isinstance(retries, utils.RetryConfig):
|
|
491
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
492
|
+
|
|
493
|
+
http_res = await self.do_request_async(
|
|
494
|
+
hook_ctx=HookContext(
|
|
495
|
+
config=self.sdk_configuration,
|
|
496
|
+
base_url=base_url or "",
|
|
497
|
+
operation_id="getChartHistory",
|
|
498
|
+
oauth2_scopes=["market:information"],
|
|
499
|
+
security_source=self.sdk_configuration.security,
|
|
500
|
+
tags=["Chart"],
|
|
501
|
+
extensions=None,
|
|
502
|
+
),
|
|
503
|
+
request=req,
|
|
504
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
505
|
+
retry_config=retry_config,
|
|
506
|
+
)
|
|
507
|
+
|
|
508
|
+
response_data: Any = None
|
|
509
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
510
|
+
return models.GetChartHistoryResponse(
|
|
511
|
+
chart_bars=unmarshal_json_response(
|
|
512
|
+
Optional[models.ChartBars], http_res
|
|
513
|
+
),
|
|
514
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
515
|
+
)
|
|
516
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
517
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
518
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
519
|
+
request=req, response=http_res
|
|
520
|
+
)
|
|
521
|
+
raise errors.BadRequest(response_data, http_res)
|
|
522
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
523
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
524
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
525
|
+
request=req, response=http_res
|
|
526
|
+
)
|
|
527
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
528
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
529
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
530
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
531
|
+
request=req, response=http_res
|
|
532
|
+
)
|
|
533
|
+
raise errors.Forbidden(response_data, http_res)
|
|
534
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
535
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
536
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
537
|
+
request=req, response=http_res
|
|
538
|
+
)
|
|
539
|
+
raise errors.NotFound(response_data, http_res)
|
|
540
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
541
|
+
response_data = unmarshal_json_response(
|
|
542
|
+
errors.InternalServerErrorUnion, http_res
|
|
543
|
+
)
|
|
544
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
545
|
+
request=req, response=http_res
|
|
546
|
+
)
|
|
547
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
548
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
549
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
550
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
551
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
552
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
553
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
554
|
+
|
|
555
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
556
|
+
|
|
557
|
+
def get_quotes(
|
|
558
|
+
self,
|
|
559
|
+
*,
|
|
560
|
+
symbols: str,
|
|
561
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
562
|
+
server_url: Optional[str] = None,
|
|
563
|
+
timeout_ms: Optional[int] = None,
|
|
564
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
565
|
+
) -> models.GetQuotesResponse:
|
|
566
|
+
r"""Get Real-Time Quotes
|
|
567
|
+
|
|
568
|
+
Retrieves quote data for one or multiple symbols. Returns current market data including last price, bid/ask prices, volume, high/low prices, change, and percent change. This endpoint supports bulk requests by providing comma-separated symbols, making it efficient for fetching quotes for multiple instruments simultaneously.
|
|
569
|
+
|
|
570
|
+
If set, this operation will use `client_id` from the global security.
|
|
571
|
+
|
|
572
|
+
:param symbols: Comma-separated symbols to quote, such as `AAPL,MSFT`. Use one symbol for a quote tile or multiple symbols for watchlists and dashboards.
|
|
573
|
+
:param retries: Override the default retry configuration for this method
|
|
574
|
+
:param server_url: Override the default server URL for this method
|
|
575
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
576
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
577
|
+
"""
|
|
578
|
+
base_url = None
|
|
579
|
+
url_variables = None
|
|
580
|
+
if timeout_ms is None:
|
|
581
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
582
|
+
|
|
583
|
+
if timeout_ms is None:
|
|
584
|
+
timeout_ms = 30000
|
|
585
|
+
|
|
586
|
+
if server_url is not None:
|
|
587
|
+
base_url = server_url
|
|
588
|
+
else:
|
|
589
|
+
base_url = self._get_url(base_url, url_variables)
|
|
590
|
+
|
|
591
|
+
request = models.GetQuotesRequest(
|
|
592
|
+
symbols=symbols,
|
|
593
|
+
)
|
|
594
|
+
|
|
595
|
+
req = self._build_request(
|
|
596
|
+
method="GET",
|
|
597
|
+
path="/v1/chart/quotes",
|
|
598
|
+
base_url=base_url,
|
|
599
|
+
url_variables=url_variables,
|
|
600
|
+
request=request,
|
|
601
|
+
request_body_required=False,
|
|
602
|
+
request_has_path_params=False,
|
|
603
|
+
request_has_query_params=True,
|
|
604
|
+
user_agent_header="user-agent",
|
|
605
|
+
accept_header_value="application/json",
|
|
606
|
+
http_headers=http_headers,
|
|
607
|
+
security=self.sdk_configuration.security,
|
|
608
|
+
allow_empty_value=None,
|
|
609
|
+
allowed_fields=["client_id"],
|
|
610
|
+
timeout_ms=timeout_ms,
|
|
611
|
+
)
|
|
612
|
+
|
|
613
|
+
if retries == UNSET:
|
|
614
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
615
|
+
retries = self.sdk_configuration.retry_config
|
|
616
|
+
else:
|
|
617
|
+
retries = utils.RetryConfig(
|
|
618
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
619
|
+
)
|
|
620
|
+
|
|
621
|
+
retry_config = None
|
|
622
|
+
if isinstance(retries, utils.RetryConfig):
|
|
623
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
624
|
+
|
|
625
|
+
http_res = self.do_request(
|
|
626
|
+
hook_ctx=HookContext(
|
|
627
|
+
config=self.sdk_configuration,
|
|
628
|
+
base_url=base_url or "",
|
|
629
|
+
operation_id="getQuotes",
|
|
630
|
+
oauth2_scopes=["market:information"],
|
|
631
|
+
security_source=self.sdk_configuration.security,
|
|
632
|
+
tags=["Chart"],
|
|
633
|
+
extensions=None,
|
|
634
|
+
),
|
|
635
|
+
request=req,
|
|
636
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
637
|
+
retry_config=retry_config,
|
|
638
|
+
)
|
|
639
|
+
|
|
640
|
+
response_data: Any = None
|
|
641
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
642
|
+
return models.GetQuotesResponse(
|
|
643
|
+
quotes_response=unmarshal_json_response(
|
|
644
|
+
Optional[models.QuotesResponse], http_res
|
|
645
|
+
),
|
|
646
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
647
|
+
)
|
|
648
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
649
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
650
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
651
|
+
request=req, response=http_res
|
|
652
|
+
)
|
|
653
|
+
raise errors.BadRequest(response_data, http_res)
|
|
654
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
655
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
656
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
657
|
+
request=req, response=http_res
|
|
658
|
+
)
|
|
659
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
660
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
661
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
662
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
663
|
+
request=req, response=http_res
|
|
664
|
+
)
|
|
665
|
+
raise errors.Forbidden(response_data, http_res)
|
|
666
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
667
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
668
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
669
|
+
request=req, response=http_res
|
|
670
|
+
)
|
|
671
|
+
raise errors.NotFound(response_data, http_res)
|
|
672
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
673
|
+
response_data = unmarshal_json_response(
|
|
674
|
+
errors.InternalServerErrorUnion, http_res
|
|
675
|
+
)
|
|
676
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
677
|
+
request=req, response=http_res
|
|
678
|
+
)
|
|
679
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
680
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
681
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
682
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
683
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
684
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
685
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
686
|
+
|
|
687
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
688
|
+
|
|
689
|
+
async def get_quotes_async(
|
|
690
|
+
self,
|
|
691
|
+
*,
|
|
692
|
+
symbols: str,
|
|
693
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
694
|
+
server_url: Optional[str] = None,
|
|
695
|
+
timeout_ms: Optional[int] = None,
|
|
696
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
697
|
+
) -> models.GetQuotesResponse:
|
|
698
|
+
r"""Get Real-Time Quotes
|
|
699
|
+
|
|
700
|
+
Retrieves quote data for one or multiple symbols. Returns current market data including last price, bid/ask prices, volume, high/low prices, change, and percent change. This endpoint supports bulk requests by providing comma-separated symbols, making it efficient for fetching quotes for multiple instruments simultaneously.
|
|
701
|
+
|
|
702
|
+
If set, this operation will use `client_id` from the global security.
|
|
703
|
+
|
|
704
|
+
:param symbols: Comma-separated symbols to quote, such as `AAPL,MSFT`. Use one symbol for a quote tile or multiple symbols for watchlists and dashboards.
|
|
705
|
+
:param retries: Override the default retry configuration for this method
|
|
706
|
+
:param server_url: Override the default server URL for this method
|
|
707
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
708
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
709
|
+
"""
|
|
710
|
+
base_url = None
|
|
711
|
+
url_variables = None
|
|
712
|
+
if timeout_ms is None:
|
|
713
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
714
|
+
|
|
715
|
+
if timeout_ms is None:
|
|
716
|
+
timeout_ms = 30000
|
|
717
|
+
|
|
718
|
+
if server_url is not None:
|
|
719
|
+
base_url = server_url
|
|
720
|
+
else:
|
|
721
|
+
base_url = self._get_url(base_url, url_variables)
|
|
722
|
+
|
|
723
|
+
request = models.GetQuotesRequest(
|
|
724
|
+
symbols=symbols,
|
|
725
|
+
)
|
|
726
|
+
|
|
727
|
+
req = self._build_request_async(
|
|
728
|
+
method="GET",
|
|
729
|
+
path="/v1/chart/quotes",
|
|
730
|
+
base_url=base_url,
|
|
731
|
+
url_variables=url_variables,
|
|
732
|
+
request=request,
|
|
733
|
+
request_body_required=False,
|
|
734
|
+
request_has_path_params=False,
|
|
735
|
+
request_has_query_params=True,
|
|
736
|
+
user_agent_header="user-agent",
|
|
737
|
+
accept_header_value="application/json",
|
|
738
|
+
http_headers=http_headers,
|
|
739
|
+
security=self.sdk_configuration.security,
|
|
740
|
+
allow_empty_value=None,
|
|
741
|
+
allowed_fields=["client_id"],
|
|
742
|
+
timeout_ms=timeout_ms,
|
|
743
|
+
)
|
|
744
|
+
|
|
745
|
+
if retries == UNSET:
|
|
746
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
747
|
+
retries = self.sdk_configuration.retry_config
|
|
748
|
+
else:
|
|
749
|
+
retries = utils.RetryConfig(
|
|
750
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
751
|
+
)
|
|
752
|
+
|
|
753
|
+
retry_config = None
|
|
754
|
+
if isinstance(retries, utils.RetryConfig):
|
|
755
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
756
|
+
|
|
757
|
+
http_res = await self.do_request_async(
|
|
758
|
+
hook_ctx=HookContext(
|
|
759
|
+
config=self.sdk_configuration,
|
|
760
|
+
base_url=base_url or "",
|
|
761
|
+
operation_id="getQuotes",
|
|
762
|
+
oauth2_scopes=["market:information"],
|
|
763
|
+
security_source=self.sdk_configuration.security,
|
|
764
|
+
tags=["Chart"],
|
|
765
|
+
extensions=None,
|
|
766
|
+
),
|
|
767
|
+
request=req,
|
|
768
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
769
|
+
retry_config=retry_config,
|
|
770
|
+
)
|
|
771
|
+
|
|
772
|
+
response_data: Any = None
|
|
773
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
774
|
+
return models.GetQuotesResponse(
|
|
775
|
+
quotes_response=unmarshal_json_response(
|
|
776
|
+
Optional[models.QuotesResponse], http_res
|
|
777
|
+
),
|
|
778
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
779
|
+
)
|
|
780
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
781
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
782
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
783
|
+
request=req, response=http_res
|
|
784
|
+
)
|
|
785
|
+
raise errors.BadRequest(response_data, http_res)
|
|
786
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
787
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
788
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
789
|
+
request=req, response=http_res
|
|
790
|
+
)
|
|
791
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
792
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
793
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
794
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
795
|
+
request=req, response=http_res
|
|
796
|
+
)
|
|
797
|
+
raise errors.Forbidden(response_data, http_res)
|
|
798
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
799
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
800
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
801
|
+
request=req, response=http_res
|
|
802
|
+
)
|
|
803
|
+
raise errors.NotFound(response_data, http_res)
|
|
804
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
805
|
+
response_data = unmarshal_json_response(
|
|
806
|
+
errors.InternalServerErrorUnion, http_res
|
|
807
|
+
)
|
|
808
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
809
|
+
request=req, response=http_res
|
|
810
|
+
)
|
|
811
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
812
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
813
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
814
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
815
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
816
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
817
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
818
|
+
|
|
819
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
820
|
+
|
|
821
|
+
def search_symbols(
|
|
822
|
+
self,
|
|
823
|
+
*,
|
|
824
|
+
query: str,
|
|
825
|
+
limit: Optional[int] = 20,
|
|
826
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
827
|
+
server_url: Optional[str] = None,
|
|
828
|
+
timeout_ms: Optional[int] = None,
|
|
829
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
830
|
+
) -> models.SearchSymbolsResponse:
|
|
831
|
+
r"""Search Symbols
|
|
832
|
+
|
|
833
|
+
Searches for trading symbols (stocks, indices, options, futures) based on a query string. Returns a list of matching symbols with symbol, ticker, description, exchange, and type. Supports equities, options (prefix query with '.'), and futures (prefix with '/'). Useful for symbol search autocomplete in charting UIs.
|
|
834
|
+
|
|
835
|
+
If set, this operation will use `client_id` from the global security.
|
|
836
|
+
|
|
837
|
+
:param query: Text to search. Use plain text for stocks and indices, `.` prefix for options such as `.AAPL`, and `/` prefix for futures such as `/ES`.
|
|
838
|
+
:param limit: Maximum number of results to return. Use smaller values for autocomplete and larger values for search result pages. Default is 20; maximum is 100.
|
|
839
|
+
:param retries: Override the default retry configuration for this method
|
|
840
|
+
:param server_url: Override the default server URL for this method
|
|
841
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
842
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
843
|
+
"""
|
|
844
|
+
base_url = None
|
|
845
|
+
url_variables = None
|
|
846
|
+
if timeout_ms is None:
|
|
847
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
848
|
+
|
|
849
|
+
if timeout_ms is None:
|
|
850
|
+
timeout_ms = 30000
|
|
851
|
+
|
|
852
|
+
if server_url is not None:
|
|
853
|
+
base_url = server_url
|
|
854
|
+
else:
|
|
855
|
+
base_url = self._get_url(base_url, url_variables)
|
|
856
|
+
|
|
857
|
+
request = models.SearchSymbolsRequest(
|
|
858
|
+
query=query,
|
|
859
|
+
limit=limit,
|
|
860
|
+
)
|
|
861
|
+
|
|
862
|
+
req = self._build_request(
|
|
863
|
+
method="GET",
|
|
864
|
+
path="/v1/chart/search",
|
|
865
|
+
base_url=base_url,
|
|
866
|
+
url_variables=url_variables,
|
|
867
|
+
request=request,
|
|
868
|
+
request_body_required=False,
|
|
869
|
+
request_has_path_params=False,
|
|
870
|
+
request_has_query_params=True,
|
|
871
|
+
user_agent_header="user-agent",
|
|
872
|
+
accept_header_value="application/json",
|
|
873
|
+
http_headers=http_headers,
|
|
874
|
+
security=self.sdk_configuration.security,
|
|
875
|
+
allow_empty_value=None,
|
|
876
|
+
allowed_fields=["client_id"],
|
|
877
|
+
timeout_ms=timeout_ms,
|
|
878
|
+
)
|
|
879
|
+
|
|
880
|
+
if retries == UNSET:
|
|
881
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
882
|
+
retries = self.sdk_configuration.retry_config
|
|
883
|
+
else:
|
|
884
|
+
retries = utils.RetryConfig(
|
|
885
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
886
|
+
)
|
|
887
|
+
|
|
888
|
+
retry_config = None
|
|
889
|
+
if isinstance(retries, utils.RetryConfig):
|
|
890
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
891
|
+
|
|
892
|
+
http_res = self.do_request(
|
|
893
|
+
hook_ctx=HookContext(
|
|
894
|
+
config=self.sdk_configuration,
|
|
895
|
+
base_url=base_url or "",
|
|
896
|
+
operation_id="searchSymbols",
|
|
897
|
+
oauth2_scopes=["market:information"],
|
|
898
|
+
security_source=self.sdk_configuration.security,
|
|
899
|
+
tags=["Chart"],
|
|
900
|
+
extensions=None,
|
|
901
|
+
),
|
|
902
|
+
request=req,
|
|
903
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
904
|
+
retry_config=retry_config,
|
|
905
|
+
)
|
|
906
|
+
|
|
907
|
+
response_data: Any = None
|
|
908
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
909
|
+
return models.SearchSymbolsResponse(
|
|
910
|
+
search_symbol_items=unmarshal_json_response(
|
|
911
|
+
Optional[List[models.SearchSymbolItem]], http_res
|
|
912
|
+
),
|
|
913
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
914
|
+
)
|
|
915
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
916
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
917
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
918
|
+
request=req, response=http_res
|
|
919
|
+
)
|
|
920
|
+
raise errors.BadRequest(response_data, http_res)
|
|
921
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
922
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
923
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
924
|
+
request=req, response=http_res
|
|
925
|
+
)
|
|
926
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
927
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
928
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
929
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
930
|
+
request=req, response=http_res
|
|
931
|
+
)
|
|
932
|
+
raise errors.Forbidden(response_data, http_res)
|
|
933
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
934
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
935
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
936
|
+
request=req, response=http_res
|
|
937
|
+
)
|
|
938
|
+
raise errors.NotFound(response_data, http_res)
|
|
939
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
940
|
+
response_data = unmarshal_json_response(
|
|
941
|
+
errors.InternalServerErrorUnion, http_res
|
|
942
|
+
)
|
|
943
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
944
|
+
request=req, response=http_res
|
|
945
|
+
)
|
|
946
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
947
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
948
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
949
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
950
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
951
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
952
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
953
|
+
|
|
954
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
955
|
+
|
|
956
|
+
async def search_symbols_async(
|
|
957
|
+
self,
|
|
958
|
+
*,
|
|
959
|
+
query: str,
|
|
960
|
+
limit: Optional[int] = 20,
|
|
961
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
962
|
+
server_url: Optional[str] = None,
|
|
963
|
+
timeout_ms: Optional[int] = None,
|
|
964
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
965
|
+
) -> models.SearchSymbolsResponse:
|
|
966
|
+
r"""Search Symbols
|
|
967
|
+
|
|
968
|
+
Searches for trading symbols (stocks, indices, options, futures) based on a query string. Returns a list of matching symbols with symbol, ticker, description, exchange, and type. Supports equities, options (prefix query with '.'), and futures (prefix with '/'). Useful for symbol search autocomplete in charting UIs.
|
|
969
|
+
|
|
970
|
+
If set, this operation will use `client_id` from the global security.
|
|
971
|
+
|
|
972
|
+
:param query: Text to search. Use plain text for stocks and indices, `.` prefix for options such as `.AAPL`, and `/` prefix for futures such as `/ES`.
|
|
973
|
+
:param limit: Maximum number of results to return. Use smaller values for autocomplete and larger values for search result pages. Default is 20; maximum is 100.
|
|
974
|
+
:param retries: Override the default retry configuration for this method
|
|
975
|
+
:param server_url: Override the default server URL for this method
|
|
976
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
977
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
978
|
+
"""
|
|
979
|
+
base_url = None
|
|
980
|
+
url_variables = None
|
|
981
|
+
if timeout_ms is None:
|
|
982
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
983
|
+
|
|
984
|
+
if timeout_ms is None:
|
|
985
|
+
timeout_ms = 30000
|
|
986
|
+
|
|
987
|
+
if server_url is not None:
|
|
988
|
+
base_url = server_url
|
|
989
|
+
else:
|
|
990
|
+
base_url = self._get_url(base_url, url_variables)
|
|
991
|
+
|
|
992
|
+
request = models.SearchSymbolsRequest(
|
|
993
|
+
query=query,
|
|
994
|
+
limit=limit,
|
|
995
|
+
)
|
|
996
|
+
|
|
997
|
+
req = self._build_request_async(
|
|
998
|
+
method="GET",
|
|
999
|
+
path="/v1/chart/search",
|
|
1000
|
+
base_url=base_url,
|
|
1001
|
+
url_variables=url_variables,
|
|
1002
|
+
request=request,
|
|
1003
|
+
request_body_required=False,
|
|
1004
|
+
request_has_path_params=False,
|
|
1005
|
+
request_has_query_params=True,
|
|
1006
|
+
user_agent_header="user-agent",
|
|
1007
|
+
accept_header_value="application/json",
|
|
1008
|
+
http_headers=http_headers,
|
|
1009
|
+
security=self.sdk_configuration.security,
|
|
1010
|
+
allow_empty_value=None,
|
|
1011
|
+
allowed_fields=["client_id"],
|
|
1012
|
+
timeout_ms=timeout_ms,
|
|
1013
|
+
)
|
|
1014
|
+
|
|
1015
|
+
if retries == UNSET:
|
|
1016
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1017
|
+
retries = self.sdk_configuration.retry_config
|
|
1018
|
+
else:
|
|
1019
|
+
retries = utils.RetryConfig(
|
|
1020
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
1021
|
+
)
|
|
1022
|
+
|
|
1023
|
+
retry_config = None
|
|
1024
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1025
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1026
|
+
|
|
1027
|
+
http_res = await self.do_request_async(
|
|
1028
|
+
hook_ctx=HookContext(
|
|
1029
|
+
config=self.sdk_configuration,
|
|
1030
|
+
base_url=base_url or "",
|
|
1031
|
+
operation_id="searchSymbols",
|
|
1032
|
+
oauth2_scopes=["market:information"],
|
|
1033
|
+
security_source=self.sdk_configuration.security,
|
|
1034
|
+
tags=["Chart"],
|
|
1035
|
+
extensions=None,
|
|
1036
|
+
),
|
|
1037
|
+
request=req,
|
|
1038
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
1039
|
+
retry_config=retry_config,
|
|
1040
|
+
)
|
|
1041
|
+
|
|
1042
|
+
response_data: Any = None
|
|
1043
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1044
|
+
return models.SearchSymbolsResponse(
|
|
1045
|
+
search_symbol_items=unmarshal_json_response(
|
|
1046
|
+
Optional[List[models.SearchSymbolItem]], http_res
|
|
1047
|
+
),
|
|
1048
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
1049
|
+
)
|
|
1050
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1051
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
1052
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1053
|
+
request=req, response=http_res
|
|
1054
|
+
)
|
|
1055
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1056
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1057
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
1058
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1059
|
+
request=req, response=http_res
|
|
1060
|
+
)
|
|
1061
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1062
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1063
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1064
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1065
|
+
request=req, response=http_res
|
|
1066
|
+
)
|
|
1067
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1068
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1069
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1070
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1071
|
+
request=req, response=http_res
|
|
1072
|
+
)
|
|
1073
|
+
raise errors.NotFound(response_data, http_res)
|
|
1074
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1075
|
+
response_data = unmarshal_json_response(
|
|
1076
|
+
errors.InternalServerErrorUnion, http_res
|
|
1077
|
+
)
|
|
1078
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1079
|
+
request=req, response=http_res
|
|
1080
|
+
)
|
|
1081
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1082
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1083
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1084
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1085
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1086
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1087
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1088
|
+
|
|
1089
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1090
|
+
|
|
1091
|
+
def get_symbol_info(
|
|
1092
|
+
self,
|
|
1093
|
+
*,
|
|
1094
|
+
symbol: str,
|
|
1095
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1096
|
+
server_url: Optional[str] = None,
|
|
1097
|
+
timeout_ms: Optional[int] = None,
|
|
1098
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1099
|
+
) -> models.GetSymbolInfoResponse:
|
|
1100
|
+
r"""Get Symbol Information
|
|
1101
|
+
|
|
1102
|
+
Retrieves detailed symbol information for charting: exchange, timezone, session, supported resolutions, price scale, format. Required for TradingView-style chart setup. For **futures**, symbol must start with '/' (e.g., /ES, /NQ).
|
|
1103
|
+
|
|
1104
|
+
If set, this operation will use `client_id` from the global security.
|
|
1105
|
+
|
|
1106
|
+
:param symbol: Symbol to resolve for charting. Use equities like `AAPL` or futures with a leading slash such as `/ES`. Prefer values returned by chart search.
|
|
1107
|
+
:param retries: Override the default retry configuration for this method
|
|
1108
|
+
:param server_url: Override the default server URL for this method
|
|
1109
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1110
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1111
|
+
"""
|
|
1112
|
+
base_url = None
|
|
1113
|
+
url_variables = None
|
|
1114
|
+
if timeout_ms is None:
|
|
1115
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1116
|
+
|
|
1117
|
+
if timeout_ms is None:
|
|
1118
|
+
timeout_ms = 30000
|
|
1119
|
+
|
|
1120
|
+
if server_url is not None:
|
|
1121
|
+
base_url = server_url
|
|
1122
|
+
else:
|
|
1123
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1124
|
+
|
|
1125
|
+
request = models.GetSymbolInfoRequest(
|
|
1126
|
+
symbol=symbol,
|
|
1127
|
+
)
|
|
1128
|
+
|
|
1129
|
+
req = self._build_request(
|
|
1130
|
+
method="GET",
|
|
1131
|
+
path="/v1/chart/symbols",
|
|
1132
|
+
base_url=base_url,
|
|
1133
|
+
url_variables=url_variables,
|
|
1134
|
+
request=request,
|
|
1135
|
+
request_body_required=False,
|
|
1136
|
+
request_has_path_params=False,
|
|
1137
|
+
request_has_query_params=True,
|
|
1138
|
+
user_agent_header="user-agent",
|
|
1139
|
+
accept_header_value="application/json",
|
|
1140
|
+
http_headers=http_headers,
|
|
1141
|
+
security=self.sdk_configuration.security,
|
|
1142
|
+
allow_empty_value=None,
|
|
1143
|
+
allowed_fields=["client_id"],
|
|
1144
|
+
timeout_ms=timeout_ms,
|
|
1145
|
+
)
|
|
1146
|
+
|
|
1147
|
+
if retries == UNSET:
|
|
1148
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1149
|
+
retries = self.sdk_configuration.retry_config
|
|
1150
|
+
else:
|
|
1151
|
+
retries = utils.RetryConfig(
|
|
1152
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
1153
|
+
)
|
|
1154
|
+
|
|
1155
|
+
retry_config = None
|
|
1156
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1157
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1158
|
+
|
|
1159
|
+
http_res = self.do_request(
|
|
1160
|
+
hook_ctx=HookContext(
|
|
1161
|
+
config=self.sdk_configuration,
|
|
1162
|
+
base_url=base_url or "",
|
|
1163
|
+
operation_id="getSymbolInfo",
|
|
1164
|
+
oauth2_scopes=["market:information"],
|
|
1165
|
+
security_source=self.sdk_configuration.security,
|
|
1166
|
+
tags=["Chart"],
|
|
1167
|
+
extensions=None,
|
|
1168
|
+
),
|
|
1169
|
+
request=req,
|
|
1170
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
1171
|
+
retry_config=retry_config,
|
|
1172
|
+
)
|
|
1173
|
+
|
|
1174
|
+
response_data: Any = None
|
|
1175
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1176
|
+
return models.GetSymbolInfoResponse(
|
|
1177
|
+
symbol_info=unmarshal_json_response(
|
|
1178
|
+
Optional[models.SymbolInfo], http_res
|
|
1179
|
+
),
|
|
1180
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
1181
|
+
)
|
|
1182
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1183
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
1184
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1185
|
+
request=req, response=http_res
|
|
1186
|
+
)
|
|
1187
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1188
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1189
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
1190
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1191
|
+
request=req, response=http_res
|
|
1192
|
+
)
|
|
1193
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1194
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1195
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1196
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1197
|
+
request=req, response=http_res
|
|
1198
|
+
)
|
|
1199
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1200
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1201
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1202
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1203
|
+
request=req, response=http_res
|
|
1204
|
+
)
|
|
1205
|
+
raise errors.NotFound(response_data, http_res)
|
|
1206
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1207
|
+
response_data = unmarshal_json_response(
|
|
1208
|
+
errors.InternalServerErrorUnion, http_res
|
|
1209
|
+
)
|
|
1210
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1211
|
+
request=req, response=http_res
|
|
1212
|
+
)
|
|
1213
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1214
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1215
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1216
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1217
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1218
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1219
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1220
|
+
|
|
1221
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1222
|
+
|
|
1223
|
+
async def get_symbol_info_async(
|
|
1224
|
+
self,
|
|
1225
|
+
*,
|
|
1226
|
+
symbol: str,
|
|
1227
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1228
|
+
server_url: Optional[str] = None,
|
|
1229
|
+
timeout_ms: Optional[int] = None,
|
|
1230
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1231
|
+
) -> models.GetSymbolInfoResponse:
|
|
1232
|
+
r"""Get Symbol Information
|
|
1233
|
+
|
|
1234
|
+
Retrieves detailed symbol information for charting: exchange, timezone, session, supported resolutions, price scale, format. Required for TradingView-style chart setup. For **futures**, symbol must start with '/' (e.g., /ES, /NQ).
|
|
1235
|
+
|
|
1236
|
+
If set, this operation will use `client_id` from the global security.
|
|
1237
|
+
|
|
1238
|
+
:param symbol: Symbol to resolve for charting. Use equities like `AAPL` or futures with a leading slash such as `/ES`. Prefer values returned by chart search.
|
|
1239
|
+
:param retries: Override the default retry configuration for this method
|
|
1240
|
+
:param server_url: Override the default server URL for this method
|
|
1241
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1242
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1243
|
+
"""
|
|
1244
|
+
base_url = None
|
|
1245
|
+
url_variables = None
|
|
1246
|
+
if timeout_ms is None:
|
|
1247
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1248
|
+
|
|
1249
|
+
if timeout_ms is None:
|
|
1250
|
+
timeout_ms = 30000
|
|
1251
|
+
|
|
1252
|
+
if server_url is not None:
|
|
1253
|
+
base_url = server_url
|
|
1254
|
+
else:
|
|
1255
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1256
|
+
|
|
1257
|
+
request = models.GetSymbolInfoRequest(
|
|
1258
|
+
symbol=symbol,
|
|
1259
|
+
)
|
|
1260
|
+
|
|
1261
|
+
req = self._build_request_async(
|
|
1262
|
+
method="GET",
|
|
1263
|
+
path="/v1/chart/symbols",
|
|
1264
|
+
base_url=base_url,
|
|
1265
|
+
url_variables=url_variables,
|
|
1266
|
+
request=request,
|
|
1267
|
+
request_body_required=False,
|
|
1268
|
+
request_has_path_params=False,
|
|
1269
|
+
request_has_query_params=True,
|
|
1270
|
+
user_agent_header="user-agent",
|
|
1271
|
+
accept_header_value="application/json",
|
|
1272
|
+
http_headers=http_headers,
|
|
1273
|
+
security=self.sdk_configuration.security,
|
|
1274
|
+
allow_empty_value=None,
|
|
1275
|
+
allowed_fields=["client_id"],
|
|
1276
|
+
timeout_ms=timeout_ms,
|
|
1277
|
+
)
|
|
1278
|
+
|
|
1279
|
+
if retries == UNSET:
|
|
1280
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1281
|
+
retries = self.sdk_configuration.retry_config
|
|
1282
|
+
else:
|
|
1283
|
+
retries = utils.RetryConfig(
|
|
1284
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
1285
|
+
)
|
|
1286
|
+
|
|
1287
|
+
retry_config = None
|
|
1288
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1289
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1290
|
+
|
|
1291
|
+
http_res = await self.do_request_async(
|
|
1292
|
+
hook_ctx=HookContext(
|
|
1293
|
+
config=self.sdk_configuration,
|
|
1294
|
+
base_url=base_url or "",
|
|
1295
|
+
operation_id="getSymbolInfo",
|
|
1296
|
+
oauth2_scopes=["market:information"],
|
|
1297
|
+
security_source=self.sdk_configuration.security,
|
|
1298
|
+
tags=["Chart"],
|
|
1299
|
+
extensions=None,
|
|
1300
|
+
),
|
|
1301
|
+
request=req,
|
|
1302
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
1303
|
+
retry_config=retry_config,
|
|
1304
|
+
)
|
|
1305
|
+
|
|
1306
|
+
response_data: Any = None
|
|
1307
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1308
|
+
return models.GetSymbolInfoResponse(
|
|
1309
|
+
symbol_info=unmarshal_json_response(
|
|
1310
|
+
Optional[models.SymbolInfo], http_res
|
|
1311
|
+
),
|
|
1312
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
1313
|
+
)
|
|
1314
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1315
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
1316
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1317
|
+
request=req, response=http_res
|
|
1318
|
+
)
|
|
1319
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1320
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1321
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
1322
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1323
|
+
request=req, response=http_res
|
|
1324
|
+
)
|
|
1325
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1326
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1327
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1328
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1329
|
+
request=req, response=http_res
|
|
1330
|
+
)
|
|
1331
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1332
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1333
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1334
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1335
|
+
request=req, response=http_res
|
|
1336
|
+
)
|
|
1337
|
+
raise errors.NotFound(response_data, http_res)
|
|
1338
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1339
|
+
response_data = unmarshal_json_response(
|
|
1340
|
+
errors.InternalServerErrorUnion, http_res
|
|
1341
|
+
)
|
|
1342
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1343
|
+
request=req, response=http_res
|
|
1344
|
+
)
|
|
1345
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1346
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1347
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1348
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1349
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1350
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1351
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1352
|
+
|
|
1353
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1354
|
+
|
|
1355
|
+
def get_tick_history(
|
|
1356
|
+
self,
|
|
1357
|
+
*,
|
|
1358
|
+
symbol: str,
|
|
1359
|
+
resolution: models.TickResolution,
|
|
1360
|
+
countback: Optional[int] = 300,
|
|
1361
|
+
cursor: Optional[str] = None,
|
|
1362
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1363
|
+
server_url: Optional[str] = None,
|
|
1364
|
+
timeout_ms: Optional[int] = None,
|
|
1365
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1366
|
+
) -> models.GetTickHistoryResponse:
|
|
1367
|
+
r"""Get Tick-Based Chart Data
|
|
1368
|
+
|
|
1369
|
+
Retrieves tick-based chart bars for a specific symbol. Unlike time-based candles (which close every fixed number of minutes, hours, or days), a tick bar closes every time a fixed number of trades has occurred — for example, a `100T` bar closes after every 100 trades, whether that takes two seconds in a busy market or two minutes in a quiet one. This makes tick charts useful for visualizing market *activity* rather than the *passage of time*, which many traders use to spot momentum and unusual volume. Tick resolutions cannot be derived from time-based bars, so they are served from this dedicated endpoint rather than `/v1/chart/history`. Bar timestamps are returned in Unix milliseconds and are always strictly increasing, even for very actively traded symbols. Because tick bars are built from live trade activity rather than fixed calendar periods, older bars are loaded using the `cursor` pagination token instead of a date range — see the `cursor` and `nextTo` fields below.
|
|
1370
|
+
|
|
1371
|
+
If set, this operation will use `client_id` from the global security.
|
|
1372
|
+
|
|
1373
|
+
:param symbol: Symbol to fetch tick bars for. Use the exact symbol returned by symbol search, such as `AAPL` for equities.
|
|
1374
|
+
:param resolution: Tick bar size: the number of trades that make up one bar.
|
|
1375
|
+
:param countback: How many bars to return, counting back from the most recent bar (or from `cursor`, if provided). Defaults to 300 when omitted. The maximum depends on `resolution`: each call is bounded by a fixed per-request trade budget, so low-count ticks (e.g. `1T`) can return up to 5000 bars, while high-count ticks (e.g. `1000T`) may cap out around 50. Requests above the resolution's maximum are silently reduced to it — this is normal, not an error. Use the `cursor` field to keep loading further back until you have as much history as you need.
|
|
1376
|
+
:param cursor: Pagination token for loading OLDER bars, used when a user scrolls a chart backward in time. Omit this parameter for the initial chart load, which returns the most recent bars. To load the page before that, pass the `nextTo` value from the previous response as `cursor`. Treat this value as opaque — always pass it back exactly as received; do not attempt to construct, decode, or modify it.
|
|
1377
|
+
:param retries: Override the default retry configuration for this method
|
|
1378
|
+
:param server_url: Override the default server URL for this method
|
|
1379
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1380
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1381
|
+
"""
|
|
1382
|
+
base_url = None
|
|
1383
|
+
url_variables = None
|
|
1384
|
+
if timeout_ms is None:
|
|
1385
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1386
|
+
|
|
1387
|
+
if timeout_ms is None:
|
|
1388
|
+
timeout_ms = 30000
|
|
1389
|
+
|
|
1390
|
+
if server_url is not None:
|
|
1391
|
+
base_url = server_url
|
|
1392
|
+
else:
|
|
1393
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1394
|
+
|
|
1395
|
+
request = models.GetTickHistoryRequest(
|
|
1396
|
+
symbol=symbol,
|
|
1397
|
+
resolution=resolution,
|
|
1398
|
+
countback=countback,
|
|
1399
|
+
cursor=cursor,
|
|
1400
|
+
)
|
|
1401
|
+
|
|
1402
|
+
req = self._build_request(
|
|
1403
|
+
method="GET",
|
|
1404
|
+
path="/v1/chart/tick-history",
|
|
1405
|
+
base_url=base_url,
|
|
1406
|
+
url_variables=url_variables,
|
|
1407
|
+
request=request,
|
|
1408
|
+
request_body_required=False,
|
|
1409
|
+
request_has_path_params=False,
|
|
1410
|
+
request_has_query_params=True,
|
|
1411
|
+
user_agent_header="user-agent",
|
|
1412
|
+
accept_header_value="application/json",
|
|
1413
|
+
http_headers=http_headers,
|
|
1414
|
+
security=self.sdk_configuration.security,
|
|
1415
|
+
allow_empty_value=None,
|
|
1416
|
+
allowed_fields=["client_id"],
|
|
1417
|
+
timeout_ms=timeout_ms,
|
|
1418
|
+
)
|
|
1419
|
+
|
|
1420
|
+
if retries == UNSET:
|
|
1421
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1422
|
+
retries = self.sdk_configuration.retry_config
|
|
1423
|
+
else:
|
|
1424
|
+
retries = utils.RetryConfig(
|
|
1425
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
1426
|
+
)
|
|
1427
|
+
|
|
1428
|
+
retry_config = None
|
|
1429
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1430
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1431
|
+
|
|
1432
|
+
http_res = self.do_request(
|
|
1433
|
+
hook_ctx=HookContext(
|
|
1434
|
+
config=self.sdk_configuration,
|
|
1435
|
+
base_url=base_url or "",
|
|
1436
|
+
operation_id="getTickHistory",
|
|
1437
|
+
oauth2_scopes=["market:information"],
|
|
1438
|
+
security_source=self.sdk_configuration.security,
|
|
1439
|
+
tags=["Chart"],
|
|
1440
|
+
extensions=None,
|
|
1441
|
+
),
|
|
1442
|
+
request=req,
|
|
1443
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
1444
|
+
retry_config=retry_config,
|
|
1445
|
+
)
|
|
1446
|
+
|
|
1447
|
+
response_data: Any = None
|
|
1448
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1449
|
+
return models.GetTickHistoryResponse(
|
|
1450
|
+
tick_chart_bars=unmarshal_json_response(
|
|
1451
|
+
Optional[models.TickChartBars], http_res
|
|
1452
|
+
),
|
|
1453
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
1454
|
+
)
|
|
1455
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1456
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
1457
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1458
|
+
request=req, response=http_res
|
|
1459
|
+
)
|
|
1460
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1461
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1462
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
1463
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1464
|
+
request=req, response=http_res
|
|
1465
|
+
)
|
|
1466
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1467
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1468
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1469
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1470
|
+
request=req, response=http_res
|
|
1471
|
+
)
|
|
1472
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1473
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1474
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1475
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1476
|
+
request=req, response=http_res
|
|
1477
|
+
)
|
|
1478
|
+
raise errors.NotFound(response_data, http_res)
|
|
1479
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1480
|
+
response_data = unmarshal_json_response(
|
|
1481
|
+
errors.InternalServerErrorUnion, http_res
|
|
1482
|
+
)
|
|
1483
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1484
|
+
request=req, response=http_res
|
|
1485
|
+
)
|
|
1486
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1487
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1488
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1489
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1490
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1491
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1492
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1493
|
+
|
|
1494
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1495
|
+
|
|
1496
|
+
async def get_tick_history_async(
|
|
1497
|
+
self,
|
|
1498
|
+
*,
|
|
1499
|
+
symbol: str,
|
|
1500
|
+
resolution: models.TickResolution,
|
|
1501
|
+
countback: Optional[int] = 300,
|
|
1502
|
+
cursor: Optional[str] = None,
|
|
1503
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1504
|
+
server_url: Optional[str] = None,
|
|
1505
|
+
timeout_ms: Optional[int] = None,
|
|
1506
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1507
|
+
) -> models.GetTickHistoryResponse:
|
|
1508
|
+
r"""Get Tick-Based Chart Data
|
|
1509
|
+
|
|
1510
|
+
Retrieves tick-based chart bars for a specific symbol. Unlike time-based candles (which close every fixed number of minutes, hours, or days), a tick bar closes every time a fixed number of trades has occurred — for example, a `100T` bar closes after every 100 trades, whether that takes two seconds in a busy market or two minutes in a quiet one. This makes tick charts useful for visualizing market *activity* rather than the *passage of time*, which many traders use to spot momentum and unusual volume. Tick resolutions cannot be derived from time-based bars, so they are served from this dedicated endpoint rather than `/v1/chart/history`. Bar timestamps are returned in Unix milliseconds and are always strictly increasing, even for very actively traded symbols. Because tick bars are built from live trade activity rather than fixed calendar periods, older bars are loaded using the `cursor` pagination token instead of a date range — see the `cursor` and `nextTo` fields below.
|
|
1511
|
+
|
|
1512
|
+
If set, this operation will use `client_id` from the global security.
|
|
1513
|
+
|
|
1514
|
+
:param symbol: Symbol to fetch tick bars for. Use the exact symbol returned by symbol search, such as `AAPL` for equities.
|
|
1515
|
+
:param resolution: Tick bar size: the number of trades that make up one bar.
|
|
1516
|
+
:param countback: How many bars to return, counting back from the most recent bar (or from `cursor`, if provided). Defaults to 300 when omitted. The maximum depends on `resolution`: each call is bounded by a fixed per-request trade budget, so low-count ticks (e.g. `1T`) can return up to 5000 bars, while high-count ticks (e.g. `1000T`) may cap out around 50. Requests above the resolution's maximum are silently reduced to it — this is normal, not an error. Use the `cursor` field to keep loading further back until you have as much history as you need.
|
|
1517
|
+
:param cursor: Pagination token for loading OLDER bars, used when a user scrolls a chart backward in time. Omit this parameter for the initial chart load, which returns the most recent bars. To load the page before that, pass the `nextTo` value from the previous response as `cursor`. Treat this value as opaque — always pass it back exactly as received; do not attempt to construct, decode, or modify it.
|
|
1518
|
+
:param retries: Override the default retry configuration for this method
|
|
1519
|
+
:param server_url: Override the default server URL for this method
|
|
1520
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1521
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1522
|
+
"""
|
|
1523
|
+
base_url = None
|
|
1524
|
+
url_variables = None
|
|
1525
|
+
if timeout_ms is None:
|
|
1526
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1527
|
+
|
|
1528
|
+
if timeout_ms is None:
|
|
1529
|
+
timeout_ms = 30000
|
|
1530
|
+
|
|
1531
|
+
if server_url is not None:
|
|
1532
|
+
base_url = server_url
|
|
1533
|
+
else:
|
|
1534
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1535
|
+
|
|
1536
|
+
request = models.GetTickHistoryRequest(
|
|
1537
|
+
symbol=symbol,
|
|
1538
|
+
resolution=resolution,
|
|
1539
|
+
countback=countback,
|
|
1540
|
+
cursor=cursor,
|
|
1541
|
+
)
|
|
1542
|
+
|
|
1543
|
+
req = self._build_request_async(
|
|
1544
|
+
method="GET",
|
|
1545
|
+
path="/v1/chart/tick-history",
|
|
1546
|
+
base_url=base_url,
|
|
1547
|
+
url_variables=url_variables,
|
|
1548
|
+
request=request,
|
|
1549
|
+
request_body_required=False,
|
|
1550
|
+
request_has_path_params=False,
|
|
1551
|
+
request_has_query_params=True,
|
|
1552
|
+
user_agent_header="user-agent",
|
|
1553
|
+
accept_header_value="application/json",
|
|
1554
|
+
http_headers=http_headers,
|
|
1555
|
+
security=self.sdk_configuration.security,
|
|
1556
|
+
allow_empty_value=None,
|
|
1557
|
+
allowed_fields=["client_id"],
|
|
1558
|
+
timeout_ms=timeout_ms,
|
|
1559
|
+
)
|
|
1560
|
+
|
|
1561
|
+
if retries == UNSET:
|
|
1562
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1563
|
+
retries = self.sdk_configuration.retry_config
|
|
1564
|
+
else:
|
|
1565
|
+
retries = utils.RetryConfig(
|
|
1566
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
1567
|
+
)
|
|
1568
|
+
|
|
1569
|
+
retry_config = None
|
|
1570
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1571
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1572
|
+
|
|
1573
|
+
http_res = await self.do_request_async(
|
|
1574
|
+
hook_ctx=HookContext(
|
|
1575
|
+
config=self.sdk_configuration,
|
|
1576
|
+
base_url=base_url or "",
|
|
1577
|
+
operation_id="getTickHistory",
|
|
1578
|
+
oauth2_scopes=["market:information"],
|
|
1579
|
+
security_source=self.sdk_configuration.security,
|
|
1580
|
+
tags=["Chart"],
|
|
1581
|
+
extensions=None,
|
|
1582
|
+
),
|
|
1583
|
+
request=req,
|
|
1584
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
1585
|
+
retry_config=retry_config,
|
|
1586
|
+
)
|
|
1587
|
+
|
|
1588
|
+
response_data: Any = None
|
|
1589
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1590
|
+
return models.GetTickHistoryResponse(
|
|
1591
|
+
tick_chart_bars=unmarshal_json_response(
|
|
1592
|
+
Optional[models.TickChartBars], http_res
|
|
1593
|
+
),
|
|
1594
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
1595
|
+
)
|
|
1596
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1597
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
1598
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1599
|
+
request=req, response=http_res
|
|
1600
|
+
)
|
|
1601
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1602
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1603
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
1604
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1605
|
+
request=req, response=http_res
|
|
1606
|
+
)
|
|
1607
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1608
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1609
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1610
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1611
|
+
request=req, response=http_res
|
|
1612
|
+
)
|
|
1613
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1614
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1615
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1616
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1617
|
+
request=req, response=http_res
|
|
1618
|
+
)
|
|
1619
|
+
raise errors.NotFound(response_data, http_res)
|
|
1620
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1621
|
+
response_data = unmarshal_json_response(
|
|
1622
|
+
errors.InternalServerErrorUnion, http_res
|
|
1623
|
+
)
|
|
1624
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1625
|
+
request=req, response=http_res
|
|
1626
|
+
)
|
|
1627
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1628
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1629
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1630
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1631
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1632
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1633
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1634
|
+
|
|
1635
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1636
|
+
|
|
1637
|
+
def get_chart_time(
|
|
1638
|
+
self,
|
|
1639
|
+
*,
|
|
1640
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1641
|
+
server_url: Optional[str] = None,
|
|
1642
|
+
timeout_ms: Optional[int] = None,
|
|
1643
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1644
|
+
) -> models.GetChartTimeResponse:
|
|
1645
|
+
r"""Get Server Time
|
|
1646
|
+
|
|
1647
|
+
Returns the current server time as a Unix timestamp in **seconds**. Response is plain text containing only the timestamp number (e.g., 1704067200). Useful for synchronizing client time with the server for charting.
|
|
1648
|
+
|
|
1649
|
+
If set, this operation will use `client_id` from the global security.
|
|
1650
|
+
|
|
1651
|
+
:param retries: Override the default retry configuration for this method
|
|
1652
|
+
:param server_url: Override the default server URL for this method
|
|
1653
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1654
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1655
|
+
"""
|
|
1656
|
+
base_url = None
|
|
1657
|
+
url_variables = None
|
|
1658
|
+
if timeout_ms is None:
|
|
1659
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1660
|
+
|
|
1661
|
+
if timeout_ms is None:
|
|
1662
|
+
timeout_ms = 30000
|
|
1663
|
+
|
|
1664
|
+
if server_url is not None:
|
|
1665
|
+
base_url = server_url
|
|
1666
|
+
else:
|
|
1667
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1668
|
+
req = self._build_request(
|
|
1669
|
+
method="GET",
|
|
1670
|
+
path="/v1/chart/time",
|
|
1671
|
+
base_url=base_url,
|
|
1672
|
+
url_variables=url_variables,
|
|
1673
|
+
request=None,
|
|
1674
|
+
request_body_required=False,
|
|
1675
|
+
request_has_path_params=False,
|
|
1676
|
+
request_has_query_params=True,
|
|
1677
|
+
user_agent_header="user-agent",
|
|
1678
|
+
accept_header_value="text/plain",
|
|
1679
|
+
http_headers=http_headers,
|
|
1680
|
+
security=self.sdk_configuration.security,
|
|
1681
|
+
allow_empty_value=None,
|
|
1682
|
+
allowed_fields=["client_id"],
|
|
1683
|
+
timeout_ms=timeout_ms,
|
|
1684
|
+
)
|
|
1685
|
+
|
|
1686
|
+
if retries == UNSET:
|
|
1687
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1688
|
+
retries = self.sdk_configuration.retry_config
|
|
1689
|
+
else:
|
|
1690
|
+
retries = utils.RetryConfig(
|
|
1691
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
1692
|
+
)
|
|
1693
|
+
|
|
1694
|
+
retry_config = None
|
|
1695
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1696
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1697
|
+
|
|
1698
|
+
http_res = self.do_request(
|
|
1699
|
+
hook_ctx=HookContext(
|
|
1700
|
+
config=self.sdk_configuration,
|
|
1701
|
+
base_url=base_url or "",
|
|
1702
|
+
operation_id="getChartTime",
|
|
1703
|
+
oauth2_scopes=["market:information"],
|
|
1704
|
+
security_source=self.sdk_configuration.security,
|
|
1705
|
+
tags=["Chart"],
|
|
1706
|
+
extensions=None,
|
|
1707
|
+
),
|
|
1708
|
+
request=req,
|
|
1709
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
1710
|
+
retry_config=retry_config,
|
|
1711
|
+
)
|
|
1712
|
+
|
|
1713
|
+
response_data: Any = None
|
|
1714
|
+
if utils.match_response(http_res, "200", "text/plain"):
|
|
1715
|
+
return models.GetChartTimeResponse(
|
|
1716
|
+
res=http_res.text,
|
|
1717
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
1718
|
+
)
|
|
1719
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1720
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
1721
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1722
|
+
request=req, response=http_res
|
|
1723
|
+
)
|
|
1724
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1725
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1726
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
1727
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1728
|
+
request=req, response=http_res
|
|
1729
|
+
)
|
|
1730
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1731
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1732
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1733
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1734
|
+
request=req, response=http_res
|
|
1735
|
+
)
|
|
1736
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1737
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1738
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1739
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1740
|
+
request=req, response=http_res
|
|
1741
|
+
)
|
|
1742
|
+
raise errors.NotFound(response_data, http_res)
|
|
1743
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1744
|
+
response_data = unmarshal_json_response(
|
|
1745
|
+
errors.InternalServerErrorUnion, http_res
|
|
1746
|
+
)
|
|
1747
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1748
|
+
request=req, response=http_res
|
|
1749
|
+
)
|
|
1750
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1751
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1752
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1753
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1754
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1755
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1756
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1757
|
+
|
|
1758
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1759
|
+
|
|
1760
|
+
async def get_chart_time_async(
|
|
1761
|
+
self,
|
|
1762
|
+
*,
|
|
1763
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1764
|
+
server_url: Optional[str] = None,
|
|
1765
|
+
timeout_ms: Optional[int] = None,
|
|
1766
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1767
|
+
) -> models.GetChartTimeResponse:
|
|
1768
|
+
r"""Get Server Time
|
|
1769
|
+
|
|
1770
|
+
Returns the current server time as a Unix timestamp in **seconds**. Response is plain text containing only the timestamp number (e.g., 1704067200). Useful for synchronizing client time with the server for charting.
|
|
1771
|
+
|
|
1772
|
+
If set, this operation will use `client_id` from the global security.
|
|
1773
|
+
|
|
1774
|
+
:param retries: Override the default retry configuration for this method
|
|
1775
|
+
:param server_url: Override the default server URL for this method
|
|
1776
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1777
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1778
|
+
"""
|
|
1779
|
+
base_url = None
|
|
1780
|
+
url_variables = None
|
|
1781
|
+
if timeout_ms is None:
|
|
1782
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1783
|
+
|
|
1784
|
+
if timeout_ms is None:
|
|
1785
|
+
timeout_ms = 30000
|
|
1786
|
+
|
|
1787
|
+
if server_url is not None:
|
|
1788
|
+
base_url = server_url
|
|
1789
|
+
else:
|
|
1790
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1791
|
+
req = self._build_request_async(
|
|
1792
|
+
method="GET",
|
|
1793
|
+
path="/v1/chart/time",
|
|
1794
|
+
base_url=base_url,
|
|
1795
|
+
url_variables=url_variables,
|
|
1796
|
+
request=None,
|
|
1797
|
+
request_body_required=False,
|
|
1798
|
+
request_has_path_params=False,
|
|
1799
|
+
request_has_query_params=True,
|
|
1800
|
+
user_agent_header="user-agent",
|
|
1801
|
+
accept_header_value="text/plain",
|
|
1802
|
+
http_headers=http_headers,
|
|
1803
|
+
security=self.sdk_configuration.security,
|
|
1804
|
+
allow_empty_value=None,
|
|
1805
|
+
allowed_fields=["client_id"],
|
|
1806
|
+
timeout_ms=timeout_ms,
|
|
1807
|
+
)
|
|
1808
|
+
|
|
1809
|
+
if retries == UNSET:
|
|
1810
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1811
|
+
retries = self.sdk_configuration.retry_config
|
|
1812
|
+
else:
|
|
1813
|
+
retries = utils.RetryConfig(
|
|
1814
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
1815
|
+
)
|
|
1816
|
+
|
|
1817
|
+
retry_config = None
|
|
1818
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1819
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1820
|
+
|
|
1821
|
+
http_res = await self.do_request_async(
|
|
1822
|
+
hook_ctx=HookContext(
|
|
1823
|
+
config=self.sdk_configuration,
|
|
1824
|
+
base_url=base_url or "",
|
|
1825
|
+
operation_id="getChartTime",
|
|
1826
|
+
oauth2_scopes=["market:information"],
|
|
1827
|
+
security_source=self.sdk_configuration.security,
|
|
1828
|
+
tags=["Chart"],
|
|
1829
|
+
extensions=None,
|
|
1830
|
+
),
|
|
1831
|
+
request=req,
|
|
1832
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
1833
|
+
retry_config=retry_config,
|
|
1834
|
+
)
|
|
1835
|
+
|
|
1836
|
+
response_data: Any = None
|
|
1837
|
+
if utils.match_response(http_res, "200", "text/plain"):
|
|
1838
|
+
return models.GetChartTimeResponse(
|
|
1839
|
+
res=http_res.text,
|
|
1840
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
1841
|
+
)
|
|
1842
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1843
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
1844
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1845
|
+
request=req, response=http_res
|
|
1846
|
+
)
|
|
1847
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1848
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1849
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
1850
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1851
|
+
request=req, response=http_res
|
|
1852
|
+
)
|
|
1853
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1854
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1855
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1856
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1857
|
+
request=req, response=http_res
|
|
1858
|
+
)
|
|
1859
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1860
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1861
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1862
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1863
|
+
request=req, response=http_res
|
|
1864
|
+
)
|
|
1865
|
+
raise errors.NotFound(response_data, http_res)
|
|
1866
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1867
|
+
response_data = unmarshal_json_response(
|
|
1868
|
+
errors.InternalServerErrorUnion, http_res
|
|
1869
|
+
)
|
|
1870
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1871
|
+
request=req, response=http_res
|
|
1872
|
+
)
|
|
1873
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1874
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1875
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1876
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1877
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1878
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1879
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1880
|
+
|
|
1881
|
+
raise errors.APIError("Unexpected response received", http_res)
|