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
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
# @generated-id: 1d9d2ac6199a
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
from enum import Enum
|
|
6
|
+
from finance_dev import utils
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class TimeInForceEnum(str, Enum, metaclass=utils.OpenEnumMeta):
|
|
10
|
+
r"""How long the order should stay alive before automatically cancelling. Pick one:
|
|
11
|
+
- `DAY` — Active until the end of today's regular trading session, then cancelled if not filled. The default choice for most orders.
|
|
12
|
+
- `GTC` — Good 'Til Cancelled. Stays open across multiple trading days until you cancel it (the broker may cap at 60–90 days).
|
|
13
|
+
- `IOC` — Immediate Or Cancel. Fill whatever you can right now; cancel the rest immediately. Useful when you want partial fills but no resting order.
|
|
14
|
+
- `FOK` — Fill Or Kill. Fill the entire order immediately, or cancel it entirely. No partial fills allowed.
|
|
15
|
+
- `EXTENDED_HOURS` — Active during pre-market and after-hours trading sessions in addition to regular hours.
|
|
16
|
+
- `AT_THE_OPENING` — Execute at the official market open price; if it can't fill at open, it's cancelled.
|
|
17
|
+
- `AT_THE_CLOSE` — Execute at the official market close price; if it can't fill at close, it's cancelled.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
DAY = "DAY"
|
|
21
|
+
GTC = "GTC"
|
|
22
|
+
IOC = "IOC"
|
|
23
|
+
FOK = "FOK"
|
|
24
|
+
EXTENDED_HOURS = "EXTENDED_HOURS"
|
|
25
|
+
AT_THE_OPENING = "AT_THE_OPENING"
|
|
26
|
+
AT_THE_CLOSE = "AT_THE_CLOSE"
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
# @generated-id: 5db968256931
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
from enum import Enum
|
|
6
|
+
from finance_dev import models, utils
|
|
7
|
+
from finance_dev.types import BaseModel, UNSET_SENTINEL
|
|
8
|
+
import pydantic
|
|
9
|
+
from pydantic import field_serializer, model_serializer
|
|
10
|
+
from typing import Optional
|
|
11
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class TradeOrderLegV2PositionEffect(str, Enum, metaclass=utils.OpenEnumMeta):
|
|
15
|
+
r"""Whether this leg opens a new position or closes an existing one:
|
|
16
|
+
- `OPEN` — opens a new position (or increases an existing one).
|
|
17
|
+
- `CLOSE` — closes an existing position (or reduces it).
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
OPEN = "OPEN"
|
|
21
|
+
CLOSE = "CLOSE"
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class TradeOrderLegV2PutCall(str, Enum, metaclass=utils.OpenEnumMeta):
|
|
25
|
+
r"""Option contract type. CALL gives the right to buy; PUT gives the right to sell."""
|
|
26
|
+
|
|
27
|
+
CALL = "CALL"
|
|
28
|
+
PUT = "PUT"
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class TradeOrderLegV2SecurityType(str, Enum, metaclass=utils.OpenEnumMeta):
|
|
32
|
+
r"""Instrument type for this leg. EQUITY is stock or ETF; OPTION is an options contract."""
|
|
33
|
+
|
|
34
|
+
EQUITY = "EQUITY"
|
|
35
|
+
OPTION = "OPTION"
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class TradeOrderLegV2Side(str, Enum, metaclass=utils.OpenEnumMeta):
|
|
39
|
+
r"""Direction for this leg. BUY purchases the instrument; SELL sells it."""
|
|
40
|
+
|
|
41
|
+
BUY = "BUY"
|
|
42
|
+
SELL = "SELL"
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class TradeOrderLegV2TypedDict(TypedDict):
|
|
46
|
+
r"""Option leg on a v2 order (`order.Leg`). Multi-leg orders carry per-leg `avgPrice`; order-level `avgPrice` is zero when `legs` is non-empty."""
|
|
47
|
+
|
|
48
|
+
maturity: str
|
|
49
|
+
r"""Option expiration date in YYYY-MM-DD format. Present for option legs."""
|
|
50
|
+
position_effect: TradeOrderLegV2PositionEffect
|
|
51
|
+
r"""Whether this leg opens a new position or closes an existing one:
|
|
52
|
+
- `OPEN` — opens a new position (or increases an existing one).
|
|
53
|
+
- `CLOSE` — closes an existing position (or reduces it).
|
|
54
|
+
"""
|
|
55
|
+
put_call: TradeOrderLegV2PutCall
|
|
56
|
+
r"""Option contract type. CALL gives the right to buy; PUT gives the right to sell."""
|
|
57
|
+
ratio_qty: str
|
|
58
|
+
r"""Quantity ratio for this leg, returned as a decimal string. Use it to display strategy structure."""
|
|
59
|
+
security_type: TradeOrderLegV2SecurityType
|
|
60
|
+
r"""Instrument type for this leg. EQUITY is stock or ETF; OPTION is an options contract."""
|
|
61
|
+
side: TradeOrderLegV2Side
|
|
62
|
+
r"""Direction for this leg. BUY purchases the instrument; SELL sells it."""
|
|
63
|
+
strike_price: str
|
|
64
|
+
r"""Option strike price as a decimal string. Present for option legs."""
|
|
65
|
+
symbol: str
|
|
66
|
+
r"""Symbol for this leg. For options, use the exact contract symbol from search or the order response."""
|
|
67
|
+
avg_price: NotRequired[str]
|
|
68
|
+
r"""Average fill price for this leg (decimal string)"""
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
class TradeOrderLegV2(BaseModel):
|
|
72
|
+
r"""Option leg on a v2 order (`order.Leg`). Multi-leg orders carry per-leg `avgPrice`; order-level `avgPrice` is zero when `legs` is non-empty."""
|
|
73
|
+
|
|
74
|
+
maturity: str
|
|
75
|
+
r"""Option expiration date in YYYY-MM-DD format. Present for option legs."""
|
|
76
|
+
|
|
77
|
+
position_effect: Annotated[
|
|
78
|
+
TradeOrderLegV2PositionEffect, pydantic.Field(alias="positionEffect")
|
|
79
|
+
]
|
|
80
|
+
r"""Whether this leg opens a new position or closes an existing one:
|
|
81
|
+
- `OPEN` — opens a new position (or increases an existing one).
|
|
82
|
+
- `CLOSE` — closes an existing position (or reduces it).
|
|
83
|
+
"""
|
|
84
|
+
|
|
85
|
+
put_call: Annotated[TradeOrderLegV2PutCall, pydantic.Field(alias="putCall")]
|
|
86
|
+
r"""Option contract type. CALL gives the right to buy; PUT gives the right to sell."""
|
|
87
|
+
|
|
88
|
+
ratio_qty: Annotated[str, pydantic.Field(alias="ratioQty")]
|
|
89
|
+
r"""Quantity ratio for this leg, returned as a decimal string. Use it to display strategy structure."""
|
|
90
|
+
|
|
91
|
+
security_type: Annotated[
|
|
92
|
+
TradeOrderLegV2SecurityType, pydantic.Field(alias="securityType")
|
|
93
|
+
]
|
|
94
|
+
r"""Instrument type for this leg. EQUITY is stock or ETF; OPTION is an options contract."""
|
|
95
|
+
|
|
96
|
+
side: TradeOrderLegV2Side
|
|
97
|
+
r"""Direction for this leg. BUY purchases the instrument; SELL sells it."""
|
|
98
|
+
|
|
99
|
+
strike_price: Annotated[str, pydantic.Field(alias="strikePrice")]
|
|
100
|
+
r"""Option strike price as a decimal string. Present for option legs."""
|
|
101
|
+
|
|
102
|
+
symbol: str
|
|
103
|
+
r"""Symbol for this leg. For options, use the exact contract symbol from search or the order response."""
|
|
104
|
+
|
|
105
|
+
avg_price: Annotated[Optional[str], pydantic.Field(alias="avgPrice")] = None
|
|
106
|
+
r"""Average fill price for this leg (decimal string)"""
|
|
107
|
+
|
|
108
|
+
@field_serializer("position_effect")
|
|
109
|
+
def serialize_position_effect(self, value):
|
|
110
|
+
if isinstance(value, str):
|
|
111
|
+
try:
|
|
112
|
+
return models.TradeOrderLegV2PositionEffect(value)
|
|
113
|
+
except ValueError:
|
|
114
|
+
return value
|
|
115
|
+
return value
|
|
116
|
+
|
|
117
|
+
@field_serializer("put_call")
|
|
118
|
+
def serialize_put_call(self, value):
|
|
119
|
+
if isinstance(value, str):
|
|
120
|
+
try:
|
|
121
|
+
return models.TradeOrderLegV2PutCall(value)
|
|
122
|
+
except ValueError:
|
|
123
|
+
return value
|
|
124
|
+
return value
|
|
125
|
+
|
|
126
|
+
@field_serializer("security_type")
|
|
127
|
+
def serialize_security_type(self, value):
|
|
128
|
+
if isinstance(value, str):
|
|
129
|
+
try:
|
|
130
|
+
return models.TradeOrderLegV2SecurityType(value)
|
|
131
|
+
except ValueError:
|
|
132
|
+
return value
|
|
133
|
+
return value
|
|
134
|
+
|
|
135
|
+
@field_serializer("side")
|
|
136
|
+
def serialize_side(self, value):
|
|
137
|
+
if isinstance(value, str):
|
|
138
|
+
try:
|
|
139
|
+
return models.TradeOrderLegV2Side(value)
|
|
140
|
+
except ValueError:
|
|
141
|
+
return value
|
|
142
|
+
return value
|
|
143
|
+
|
|
144
|
+
@model_serializer(mode="wrap")
|
|
145
|
+
def serialize_model(self, handler):
|
|
146
|
+
optional_fields = set(["avgPrice"])
|
|
147
|
+
serialized = handler(self)
|
|
148
|
+
m = {}
|
|
149
|
+
|
|
150
|
+
for n, f in type(self).model_fields.items():
|
|
151
|
+
k = f.alias or n
|
|
152
|
+
val = serialized.get(k, serialized.get(n))
|
|
153
|
+
|
|
154
|
+
if val != UNSET_SENTINEL:
|
|
155
|
+
if val is not None or k not in optional_fields:
|
|
156
|
+
m[k] = val
|
|
157
|
+
|
|
158
|
+
return m
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
try:
|
|
162
|
+
TradeOrderLegV2.model_rebuild()
|
|
163
|
+
except NameError:
|
|
164
|
+
pass
|
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
# @generated-id: 908d50cc612f
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
from .ordersideenum import OrderSideEnum
|
|
6
|
+
from .ordertypeenum import OrderTypeEnum
|
|
7
|
+
from .timeinforceenum import TimeInForceEnum
|
|
8
|
+
from .tradeorderlegv2 import TradeOrderLegV2, TradeOrderLegV2TypedDict
|
|
9
|
+
from datetime import datetime
|
|
10
|
+
from enum import Enum
|
|
11
|
+
from finance_dev import models, utils
|
|
12
|
+
from finance_dev.types import BaseModel, UNSET_SENTINEL
|
|
13
|
+
import pydantic
|
|
14
|
+
from pydantic import field_serializer, model_serializer
|
|
15
|
+
from typing import List, Optional
|
|
16
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class Category(str, Enum, metaclass=utils.OpenEnumMeta):
|
|
20
|
+
r"""What kind of trade this order represents.
|
|
21
|
+
- `EQUITY` — Plain stock or ETF order.
|
|
22
|
+
- `SINGLE_LEG` — One option contract (call or put).
|
|
23
|
+
- `MULTI_LEG` — Two-to-four-leg option strategy (spread, condor, straddle, etc.). See the `legs` array.
|
|
24
|
+
|
|
25
|
+
Omitted when the order has not been classified.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
SINGLE_LEG = "SINGLE_LEG"
|
|
29
|
+
MULTI_LEG = "MULTI_LEG"
|
|
30
|
+
EQUITY = "EQUITY"
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class ExDestination(str, Enum, metaclass=utils.OpenEnumMeta):
|
|
34
|
+
r"""Where the order was routed for execution. Useful for support diagnostics and advanced routing displays.
|
|
35
|
+
- `MNGD` — Managed routing (Aries chooses the best venue automatically).
|
|
36
|
+
- `MNGDFTE` — Managed routing with fill-then-end (extended) handling.
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
MNGD = "MNGD"
|
|
40
|
+
MNGDFTE = "MNGDFTE"
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class OrdStatus(str, Enum, metaclass=utils.OpenEnumMeta):
|
|
44
|
+
r"""Current state of the order. Possible values:
|
|
45
|
+
- `PENDING_NEW` — Submitted, waiting for exchange acknowledgement.
|
|
46
|
+
- `NEW` — Accepted by the exchange and live in the order book; no fills yet.
|
|
47
|
+
- `PARTIALLY_FILLED` — Some of the quantity has executed; the rest is still working. See `cumQty` and `leavesQty`.
|
|
48
|
+
- `FILLED` — Fully executed. Order is complete.
|
|
49
|
+
- `PENDING_CANCEL` — Cancel request submitted; waiting for exchange confirmation.
|
|
50
|
+
- `CANCELED` — Order was cancelled and will not execute further.
|
|
51
|
+
- `PENDING_REPLACE` — Replace/modify request submitted; waiting for exchange confirmation.
|
|
52
|
+
- `REPLACED` — Order was successfully replaced/modified.
|
|
53
|
+
- `REJECTED` — Order was refused (bad parameters, insufficient buying power, halted symbol, etc.). Check `ordRejReason` and `text`.
|
|
54
|
+
- `EXPIRED` — Order reached its time-in-force limit without filling (e.g. a `DAY` order that didn't fill before close).
|
|
55
|
+
- `DONE_FOR_DAY` — Order is no longer active for today's session but may resume on the next trading day (rare).
|
|
56
|
+
- `STOPPED` — Trading was stopped on this order by an exchange action.
|
|
57
|
+
- `SUSPENDED` — Order is temporarily suspended by the broker or exchange.
|
|
58
|
+
- `CALCULATED` — End-of-day calculated status from FIX (rarely surfaced).
|
|
59
|
+
- `ACCEPTED_FOR_BID` — Acknowledged for a bid (auction workflows).
|
|
60
|
+
- `SUPERSEDED` — Replaced by a newer record; excluded from history responses server-side.
|
|
61
|
+
|
|
62
|
+
Omitted when the broker has not yet reported a status.
|
|
63
|
+
"""
|
|
64
|
+
|
|
65
|
+
NEW = "NEW"
|
|
66
|
+
PARTIALLY_FILLED = "PARTIALLY_FILLED"
|
|
67
|
+
FILLED = "FILLED"
|
|
68
|
+
DONE_FOR_DAY = "DONE_FOR_DAY"
|
|
69
|
+
CANCELED = "CANCELED"
|
|
70
|
+
REPLACED = "REPLACED"
|
|
71
|
+
PENDING_CANCEL = "PENDING_CANCEL"
|
|
72
|
+
STOPPED = "STOPPED"
|
|
73
|
+
REJECTED = "REJECTED"
|
|
74
|
+
SUSPENDED = "SUSPENDED"
|
|
75
|
+
PENDING_NEW = "PENDING_NEW"
|
|
76
|
+
CALCULATED = "CALCULATED"
|
|
77
|
+
EXPIRED = "EXPIRED"
|
|
78
|
+
ACCEPTED_FOR_BID = "ACCEPTED_FOR_BID"
|
|
79
|
+
PENDING_REPLACE = "PENDING_REPLACE"
|
|
80
|
+
SUPERSEDED = "SUPERSEDED"
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
class TradeOrderV2SecurityType(str, Enum, metaclass=utils.OpenEnumMeta):
|
|
84
|
+
r"""Instrument type for the order. EQUITY is stock or ETF; OPTION is an options contract."""
|
|
85
|
+
|
|
86
|
+
EQUITY = "EQUITY"
|
|
87
|
+
OPTION = "OPTION"
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
class TradeOrderV2TypedDict(TypedDict):
|
|
91
|
+
r"""Standard v2 order shape returned by the trading endpoints. Identical across **GET /v2/accounts/{id}/orders** (cache and DB), **GET /v2/accounts/{id}/orders/history**, and WebSocket `accUpdates` — merge live updates with REST by `clOrdId` without field remapping. Numeric quantities and prices are decimal strings. Fields marked optional in Go (`omitempty`) may be absent when empty; core quantity, price, and timestamp fields are always present on each order object."""
|
|
92
|
+
|
|
93
|
+
account_id: NotRequired[str]
|
|
94
|
+
r"""Account that owns this order."""
|
|
95
|
+
avg_price: NotRequired[str]
|
|
96
|
+
r"""Average fill price at the order level. For multi-leg orders this may be zero; use each leg's `avgPrice` instead."""
|
|
97
|
+
category: NotRequired[Category]
|
|
98
|
+
r"""What kind of trade this order represents.
|
|
99
|
+
- `EQUITY` — Plain stock or ETF order.
|
|
100
|
+
- `SINGLE_LEG` — One option contract (call or put).
|
|
101
|
+
- `MULTI_LEG` — Two-to-four-leg option strategy (spread, condor, straddle, etc.). See the `legs` array.
|
|
102
|
+
|
|
103
|
+
Omitted when the order has not been classified.
|
|
104
|
+
"""
|
|
105
|
+
cl_ord_id: NotRequired[str]
|
|
106
|
+
r"""Client order ID — unique per account, used as the merge key with WebSocket order snapshots."""
|
|
107
|
+
client_id: NotRequired[str]
|
|
108
|
+
r"""OAuth client / application identifier that submitted the order. Always serialized; may be empty."""
|
|
109
|
+
created_at: NotRequired[datetime]
|
|
110
|
+
r"""Time the order record was created. Use this for timeline and sorting displays."""
|
|
111
|
+
cum_qty: NotRequired[str]
|
|
112
|
+
r"""Total quantity already filled, returned as a decimal string."""
|
|
113
|
+
currency: NotRequired[str]
|
|
114
|
+
r"""Currency for prices and amounts on this order, usually USD for U.S. securities."""
|
|
115
|
+
ex_destination: NotRequired[ExDestination]
|
|
116
|
+
r"""Where the order was routed for execution. Useful for support diagnostics and advanced routing displays.
|
|
117
|
+
- `MNGD` — Managed routing (Aries chooses the best venue automatically).
|
|
118
|
+
- `MNGDFTE` — Managed routing with fill-then-end (extended) handling.
|
|
119
|
+
"""
|
|
120
|
+
leaves_qty: NotRequired[str]
|
|
121
|
+
r"""Quantity still open and waiting to fill, returned as a decimal string."""
|
|
122
|
+
legs: NotRequired[List[TradeOrderLegV2TypedDict]]
|
|
123
|
+
r"""Per-leg details for option spreads or other multi-leg orders. Empty or omitted for normal single-symbol orders."""
|
|
124
|
+
ord_id: NotRequired[str]
|
|
125
|
+
r"""Broker order ID. Always serialized; may be an empty string for cancel-rejects or before the broker accepts the order."""
|
|
126
|
+
ord_rej_reason: NotRequired[str]
|
|
127
|
+
r"""Broker rejection reason code or text. Use this with `text` to explain why an order was rejected."""
|
|
128
|
+
ord_status: NotRequired[OrdStatus]
|
|
129
|
+
r"""Current state of the order. Possible values:
|
|
130
|
+
- `PENDING_NEW` — Submitted, waiting for exchange acknowledgement.
|
|
131
|
+
- `NEW` — Accepted by the exchange and live in the order book; no fills yet.
|
|
132
|
+
- `PARTIALLY_FILLED` — Some of the quantity has executed; the rest is still working. See `cumQty` and `leavesQty`.
|
|
133
|
+
- `FILLED` — Fully executed. Order is complete.
|
|
134
|
+
- `PENDING_CANCEL` — Cancel request submitted; waiting for exchange confirmation.
|
|
135
|
+
- `CANCELED` — Order was cancelled and will not execute further.
|
|
136
|
+
- `PENDING_REPLACE` — Replace/modify request submitted; waiting for exchange confirmation.
|
|
137
|
+
- `REPLACED` — Order was successfully replaced/modified.
|
|
138
|
+
- `REJECTED` — Order was refused (bad parameters, insufficient buying power, halted symbol, etc.). Check `ordRejReason` and `text`.
|
|
139
|
+
- `EXPIRED` — Order reached its time-in-force limit without filling (e.g. a `DAY` order that didn't fill before close).
|
|
140
|
+
- `DONE_FOR_DAY` — Order is no longer active for today's session but may resume on the next trading day (rare).
|
|
141
|
+
- `STOPPED` — Trading was stopped on this order by an exchange action.
|
|
142
|
+
- `SUSPENDED` — Order is temporarily suspended by the broker or exchange.
|
|
143
|
+
- `CALCULATED` — End-of-day calculated status from FIX (rarely surfaced).
|
|
144
|
+
- `ACCEPTED_FOR_BID` — Acknowledged for a bid (auction workflows).
|
|
145
|
+
- `SUPERSEDED` — Replaced by a newer record; excluded from history responses server-side.
|
|
146
|
+
|
|
147
|
+
Omitted when the broker has not yet reported a status.
|
|
148
|
+
"""
|
|
149
|
+
orig_cl_ord_id: NotRequired[str]
|
|
150
|
+
r"""Original client order ID for replace/cancel chains. Omitted when not part of a chain."""
|
|
151
|
+
price: NotRequired[str]
|
|
152
|
+
r"""Limit or reference price as a decimal string. Required for limit-style orders and empty or zero for pure market orders."""
|
|
153
|
+
qty: NotRequired[str]
|
|
154
|
+
r"""Original order size as a decimal string. Use this with filled and remaining quantities to show execution progress."""
|
|
155
|
+
security_type: NotRequired[TradeOrderV2SecurityType]
|
|
156
|
+
r"""Instrument type for the order. EQUITY is stock or ETF; OPTION is an options contract."""
|
|
157
|
+
side: NotRequired[OrderSideEnum]
|
|
158
|
+
r"""Which direction to trade in. Pick one:
|
|
159
|
+
- `BUY` — buying shares or contracts (opens a long position or closes an existing short).
|
|
160
|
+
- `SELL` — selling shares or contracts you already hold (closes a long position).
|
|
161
|
+
- `SELL_SHORT` — selling shares you do not own (opens a short position). Subject to short-sale regulations.
|
|
162
|
+
- `BUY_TO_COVER` — buying shares to close an open short position.
|
|
163
|
+
"""
|
|
164
|
+
stop_price: NotRequired[str]
|
|
165
|
+
r"""Stop trigger price as a decimal string. Required for stop-style orders and empty or zero when not used."""
|
|
166
|
+
symbol: NotRequired[str]
|
|
167
|
+
r"""Primary symbol traded by the order."""
|
|
168
|
+
text: NotRequired[str]
|
|
169
|
+
r"""Broker or platform message about the order. Show this when status is rejected or when the user needs extra context."""
|
|
170
|
+
time_in_force: NotRequired[TimeInForceEnum]
|
|
171
|
+
r"""How long the order should stay alive before automatically cancelling. Pick one:
|
|
172
|
+
- `DAY` — Active until the end of today's regular trading session, then cancelled if not filled. The default choice for most orders.
|
|
173
|
+
- `GTC` — Good 'Til Cancelled. Stays open across multiple trading days until you cancel it (the broker may cap at 60–90 days).
|
|
174
|
+
- `IOC` — Immediate Or Cancel. Fill whatever you can right now; cancel the rest immediately. Useful when you want partial fills but no resting order.
|
|
175
|
+
- `FOK` — Fill Or Kill. Fill the entire order immediately, or cancel it entirely. No partial fills allowed.
|
|
176
|
+
- `EXTENDED_HOURS` — Active during pre-market and after-hours trading sessions in addition to regular hours.
|
|
177
|
+
- `AT_THE_OPENING` — Execute at the official market open price; if it can't fill at open, it's cancelled.
|
|
178
|
+
- `AT_THE_CLOSE` — Execute at the official market close price; if it can't fill at close, it's cancelled.
|
|
179
|
+
"""
|
|
180
|
+
type: NotRequired[OrderTypeEnum]
|
|
181
|
+
r"""How the order is priced. Pick one:
|
|
182
|
+
- `MARKET` — Execute immediately at the best available price. Fast and guaranteed to fill, but no price guarantee — the actual fill price can move during execution.
|
|
183
|
+
- `LIMIT` — Execute only at the limit `price` or better (lower for buys, higher for sells). Gives you price control, no execution guarantee. Requires the `price` field.
|
|
184
|
+
- `STOP` — Sits inactive until the market hits `stopPrice`, then converts to a market order. Common for stop-loss exits. Requires the `stopPrice` field.
|
|
185
|
+
- `STOP_LIMIT` — Sits inactive until the market hits `stopPrice`, then converts to a limit order at `price`. More control than `STOP`, but the limit may not fill. Requires both `stopPrice` and `price`.
|
|
186
|
+
"""
|
|
187
|
+
updated_at: NotRequired[datetime]
|
|
188
|
+
r"""Time the order record was last updated. Use this to show status freshness."""
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
class TradeOrderV2(BaseModel):
|
|
192
|
+
r"""Standard v2 order shape returned by the trading endpoints. Identical across **GET /v2/accounts/{id}/orders** (cache and DB), **GET /v2/accounts/{id}/orders/history**, and WebSocket `accUpdates` — merge live updates with REST by `clOrdId` without field remapping. Numeric quantities and prices are decimal strings. Fields marked optional in Go (`omitempty`) may be absent when empty; core quantity, price, and timestamp fields are always present on each order object."""
|
|
193
|
+
|
|
194
|
+
account_id: Annotated[Optional[str], pydantic.Field(alias="accountId")] = None
|
|
195
|
+
r"""Account that owns this order."""
|
|
196
|
+
|
|
197
|
+
avg_price: Annotated[Optional[str], pydantic.Field(alias="avgPrice")] = None
|
|
198
|
+
r"""Average fill price at the order level. For multi-leg orders this may be zero; use each leg's `avgPrice` instead."""
|
|
199
|
+
|
|
200
|
+
category: Optional[Category] = None
|
|
201
|
+
r"""What kind of trade this order represents.
|
|
202
|
+
- `EQUITY` — Plain stock or ETF order.
|
|
203
|
+
- `SINGLE_LEG` — One option contract (call or put).
|
|
204
|
+
- `MULTI_LEG` — Two-to-four-leg option strategy (spread, condor, straddle, etc.). See the `legs` array.
|
|
205
|
+
|
|
206
|
+
Omitted when the order has not been classified.
|
|
207
|
+
"""
|
|
208
|
+
|
|
209
|
+
cl_ord_id: Annotated[Optional[str], pydantic.Field(alias="clOrdId")] = None
|
|
210
|
+
r"""Client order ID — unique per account, used as the merge key with WebSocket order snapshots."""
|
|
211
|
+
|
|
212
|
+
client_id: Annotated[Optional[str], pydantic.Field(alias="clientId")] = None
|
|
213
|
+
r"""OAuth client / application identifier that submitted the order. Always serialized; may be empty."""
|
|
214
|
+
|
|
215
|
+
created_at: Annotated[Optional[datetime], pydantic.Field(alias="createdAt")] = None
|
|
216
|
+
r"""Time the order record was created. Use this for timeline and sorting displays."""
|
|
217
|
+
|
|
218
|
+
cum_qty: Annotated[Optional[str], pydantic.Field(alias="cumQty")] = None
|
|
219
|
+
r"""Total quantity already filled, returned as a decimal string."""
|
|
220
|
+
|
|
221
|
+
currency: Optional[str] = None
|
|
222
|
+
r"""Currency for prices and amounts on this order, usually USD for U.S. securities."""
|
|
223
|
+
|
|
224
|
+
ex_destination: Annotated[
|
|
225
|
+
Optional[ExDestination], pydantic.Field(alias="exDestination")
|
|
226
|
+
] = None
|
|
227
|
+
r"""Where the order was routed for execution. Useful for support diagnostics and advanced routing displays.
|
|
228
|
+
- `MNGD` — Managed routing (Aries chooses the best venue automatically).
|
|
229
|
+
- `MNGDFTE` — Managed routing with fill-then-end (extended) handling.
|
|
230
|
+
"""
|
|
231
|
+
|
|
232
|
+
leaves_qty: Annotated[Optional[str], pydantic.Field(alias="leavesQty")] = None
|
|
233
|
+
r"""Quantity still open and waiting to fill, returned as a decimal string."""
|
|
234
|
+
|
|
235
|
+
legs: Optional[List[TradeOrderLegV2]] = None
|
|
236
|
+
r"""Per-leg details for option spreads or other multi-leg orders. Empty or omitted for normal single-symbol orders."""
|
|
237
|
+
|
|
238
|
+
ord_id: Annotated[Optional[str], pydantic.Field(alias="ordId")] = None
|
|
239
|
+
r"""Broker order ID. Always serialized; may be an empty string for cancel-rejects or before the broker accepts the order."""
|
|
240
|
+
|
|
241
|
+
ord_rej_reason: Annotated[Optional[str], pydantic.Field(alias="ordRejReason")] = (
|
|
242
|
+
None
|
|
243
|
+
)
|
|
244
|
+
r"""Broker rejection reason code or text. Use this with `text` to explain why an order was rejected."""
|
|
245
|
+
|
|
246
|
+
ord_status: Annotated[Optional[OrdStatus], pydantic.Field(alias="ordStatus")] = None
|
|
247
|
+
r"""Current state of the order. Possible values:
|
|
248
|
+
- `PENDING_NEW` — Submitted, waiting for exchange acknowledgement.
|
|
249
|
+
- `NEW` — Accepted by the exchange and live in the order book; no fills yet.
|
|
250
|
+
- `PARTIALLY_FILLED` — Some of the quantity has executed; the rest is still working. See `cumQty` and `leavesQty`.
|
|
251
|
+
- `FILLED` — Fully executed. Order is complete.
|
|
252
|
+
- `PENDING_CANCEL` — Cancel request submitted; waiting for exchange confirmation.
|
|
253
|
+
- `CANCELED` — Order was cancelled and will not execute further.
|
|
254
|
+
- `PENDING_REPLACE` — Replace/modify request submitted; waiting for exchange confirmation.
|
|
255
|
+
- `REPLACED` — Order was successfully replaced/modified.
|
|
256
|
+
- `REJECTED` — Order was refused (bad parameters, insufficient buying power, halted symbol, etc.). Check `ordRejReason` and `text`.
|
|
257
|
+
- `EXPIRED` — Order reached its time-in-force limit without filling (e.g. a `DAY` order that didn't fill before close).
|
|
258
|
+
- `DONE_FOR_DAY` — Order is no longer active for today's session but may resume on the next trading day (rare).
|
|
259
|
+
- `STOPPED` — Trading was stopped on this order by an exchange action.
|
|
260
|
+
- `SUSPENDED` — Order is temporarily suspended by the broker or exchange.
|
|
261
|
+
- `CALCULATED` — End-of-day calculated status from FIX (rarely surfaced).
|
|
262
|
+
- `ACCEPTED_FOR_BID` — Acknowledged for a bid (auction workflows).
|
|
263
|
+
- `SUPERSEDED` — Replaced by a newer record; excluded from history responses server-side.
|
|
264
|
+
|
|
265
|
+
Omitted when the broker has not yet reported a status.
|
|
266
|
+
"""
|
|
267
|
+
|
|
268
|
+
orig_cl_ord_id: Annotated[Optional[str], pydantic.Field(alias="origClOrdId")] = None
|
|
269
|
+
r"""Original client order ID for replace/cancel chains. Omitted when not part of a chain."""
|
|
270
|
+
|
|
271
|
+
price: Optional[str] = None
|
|
272
|
+
r"""Limit or reference price as a decimal string. Required for limit-style orders and empty or zero for pure market orders."""
|
|
273
|
+
|
|
274
|
+
qty: Optional[str] = None
|
|
275
|
+
r"""Original order size as a decimal string. Use this with filled and remaining quantities to show execution progress."""
|
|
276
|
+
|
|
277
|
+
security_type: Annotated[
|
|
278
|
+
Optional[TradeOrderV2SecurityType], pydantic.Field(alias="securityType")
|
|
279
|
+
] = None
|
|
280
|
+
r"""Instrument type for the order. EQUITY is stock or ETF; OPTION is an options contract."""
|
|
281
|
+
|
|
282
|
+
side: Optional[OrderSideEnum] = None
|
|
283
|
+
r"""Which direction to trade in. Pick one:
|
|
284
|
+
- `BUY` — buying shares or contracts (opens a long position or closes an existing short).
|
|
285
|
+
- `SELL` — selling shares or contracts you already hold (closes a long position).
|
|
286
|
+
- `SELL_SHORT` — selling shares you do not own (opens a short position). Subject to short-sale regulations.
|
|
287
|
+
- `BUY_TO_COVER` — buying shares to close an open short position.
|
|
288
|
+
"""
|
|
289
|
+
|
|
290
|
+
stop_price: Annotated[Optional[str], pydantic.Field(alias="stopPrice")] = None
|
|
291
|
+
r"""Stop trigger price as a decimal string. Required for stop-style orders and empty or zero when not used."""
|
|
292
|
+
|
|
293
|
+
symbol: Optional[str] = None
|
|
294
|
+
r"""Primary symbol traded by the order."""
|
|
295
|
+
|
|
296
|
+
text: Optional[str] = None
|
|
297
|
+
r"""Broker or platform message about the order. Show this when status is rejected or when the user needs extra context."""
|
|
298
|
+
|
|
299
|
+
time_in_force: Annotated[
|
|
300
|
+
Optional[TimeInForceEnum], pydantic.Field(alias="timeInForce")
|
|
301
|
+
] = None
|
|
302
|
+
r"""How long the order should stay alive before automatically cancelling. Pick one:
|
|
303
|
+
- `DAY` — Active until the end of today's regular trading session, then cancelled if not filled. The default choice for most orders.
|
|
304
|
+
- `GTC` — Good 'Til Cancelled. Stays open across multiple trading days until you cancel it (the broker may cap at 60–90 days).
|
|
305
|
+
- `IOC` — Immediate Or Cancel. Fill whatever you can right now; cancel the rest immediately. Useful when you want partial fills but no resting order.
|
|
306
|
+
- `FOK` — Fill Or Kill. Fill the entire order immediately, or cancel it entirely. No partial fills allowed.
|
|
307
|
+
- `EXTENDED_HOURS` — Active during pre-market and after-hours trading sessions in addition to regular hours.
|
|
308
|
+
- `AT_THE_OPENING` — Execute at the official market open price; if it can't fill at open, it's cancelled.
|
|
309
|
+
- `AT_THE_CLOSE` — Execute at the official market close price; if it can't fill at close, it's cancelled.
|
|
310
|
+
"""
|
|
311
|
+
|
|
312
|
+
type: Optional[OrderTypeEnum] = None
|
|
313
|
+
r"""How the order is priced. Pick one:
|
|
314
|
+
- `MARKET` — Execute immediately at the best available price. Fast and guaranteed to fill, but no price guarantee — the actual fill price can move during execution.
|
|
315
|
+
- `LIMIT` — Execute only at the limit `price` or better (lower for buys, higher for sells). Gives you price control, no execution guarantee. Requires the `price` field.
|
|
316
|
+
- `STOP` — Sits inactive until the market hits `stopPrice`, then converts to a market order. Common for stop-loss exits. Requires the `stopPrice` field.
|
|
317
|
+
- `STOP_LIMIT` — Sits inactive until the market hits `stopPrice`, then converts to a limit order at `price`. More control than `STOP`, but the limit may not fill. Requires both `stopPrice` and `price`.
|
|
318
|
+
"""
|
|
319
|
+
|
|
320
|
+
updated_at: Annotated[Optional[datetime], pydantic.Field(alias="updatedAt")] = None
|
|
321
|
+
r"""Time the order record was last updated. Use this to show status freshness."""
|
|
322
|
+
|
|
323
|
+
@field_serializer("category")
|
|
324
|
+
def serialize_category(self, value):
|
|
325
|
+
if isinstance(value, str):
|
|
326
|
+
try:
|
|
327
|
+
return models.Category(value)
|
|
328
|
+
except ValueError:
|
|
329
|
+
return value
|
|
330
|
+
return value
|
|
331
|
+
|
|
332
|
+
@field_serializer("ex_destination")
|
|
333
|
+
def serialize_ex_destination(self, value):
|
|
334
|
+
if isinstance(value, str):
|
|
335
|
+
try:
|
|
336
|
+
return models.ExDestination(value)
|
|
337
|
+
except ValueError:
|
|
338
|
+
return value
|
|
339
|
+
return value
|
|
340
|
+
|
|
341
|
+
@field_serializer("ord_status")
|
|
342
|
+
def serialize_ord_status(self, value):
|
|
343
|
+
if isinstance(value, str):
|
|
344
|
+
try:
|
|
345
|
+
return models.OrdStatus(value)
|
|
346
|
+
except ValueError:
|
|
347
|
+
return value
|
|
348
|
+
return value
|
|
349
|
+
|
|
350
|
+
@field_serializer("security_type")
|
|
351
|
+
def serialize_security_type(self, value):
|
|
352
|
+
if isinstance(value, str):
|
|
353
|
+
try:
|
|
354
|
+
return models.TradeOrderV2SecurityType(value)
|
|
355
|
+
except ValueError:
|
|
356
|
+
return value
|
|
357
|
+
return value
|
|
358
|
+
|
|
359
|
+
@field_serializer("side")
|
|
360
|
+
def serialize_side(self, value):
|
|
361
|
+
if isinstance(value, str):
|
|
362
|
+
try:
|
|
363
|
+
return models.OrderSideEnum(value)
|
|
364
|
+
except ValueError:
|
|
365
|
+
return value
|
|
366
|
+
return value
|
|
367
|
+
|
|
368
|
+
@field_serializer("time_in_force")
|
|
369
|
+
def serialize_time_in_force(self, value):
|
|
370
|
+
if isinstance(value, str):
|
|
371
|
+
try:
|
|
372
|
+
return models.TimeInForceEnum(value)
|
|
373
|
+
except ValueError:
|
|
374
|
+
return value
|
|
375
|
+
return value
|
|
376
|
+
|
|
377
|
+
@field_serializer("type")
|
|
378
|
+
def serialize_type(self, value):
|
|
379
|
+
if isinstance(value, str):
|
|
380
|
+
try:
|
|
381
|
+
return models.OrderTypeEnum(value)
|
|
382
|
+
except ValueError:
|
|
383
|
+
return value
|
|
384
|
+
return value
|
|
385
|
+
|
|
386
|
+
@model_serializer(mode="wrap")
|
|
387
|
+
def serialize_model(self, handler):
|
|
388
|
+
optional_fields = set(
|
|
389
|
+
[
|
|
390
|
+
"accountId",
|
|
391
|
+
"avgPrice",
|
|
392
|
+
"category",
|
|
393
|
+
"clOrdId",
|
|
394
|
+
"clientId",
|
|
395
|
+
"createdAt",
|
|
396
|
+
"cumQty",
|
|
397
|
+
"currency",
|
|
398
|
+
"exDestination",
|
|
399
|
+
"leavesQty",
|
|
400
|
+
"legs",
|
|
401
|
+
"ordId",
|
|
402
|
+
"ordRejReason",
|
|
403
|
+
"ordStatus",
|
|
404
|
+
"origClOrdId",
|
|
405
|
+
"price",
|
|
406
|
+
"qty",
|
|
407
|
+
"securityType",
|
|
408
|
+
"side",
|
|
409
|
+
"stopPrice",
|
|
410
|
+
"symbol",
|
|
411
|
+
"text",
|
|
412
|
+
"timeInForce",
|
|
413
|
+
"type",
|
|
414
|
+
"updatedAt",
|
|
415
|
+
]
|
|
416
|
+
)
|
|
417
|
+
serialized = handler(self)
|
|
418
|
+
m = {}
|
|
419
|
+
|
|
420
|
+
for n, f in type(self).model_fields.items():
|
|
421
|
+
k = f.alias or n
|
|
422
|
+
val = serialized.get(k, serialized.get(n))
|
|
423
|
+
|
|
424
|
+
if val != UNSET_SENTINEL:
|
|
425
|
+
if val is not None or k not in optional_fields:
|
|
426
|
+
m[k] = val
|
|
427
|
+
|
|
428
|
+
return m
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
try:
|
|
432
|
+
TradeOrderV2.model_rebuild()
|
|
433
|
+
except NameError:
|
|
434
|
+
pass
|