├── .gitattributes ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── IbFlexReader ├── .editorconfig ├── IbFlexReader.Contracts │ ├── Attributes │ │ └── FormatAttribute.cs │ ├── Enums │ │ ├── AssetCategory.cs │ │ ├── BuySell.cs │ │ ├── CashTransactionType.cs │ │ ├── Currencies.cs │ │ ├── LongShort.cs │ │ ├── Notes.cs │ │ ├── OpenClose.cs │ │ └── PutCall.cs │ ├── ErrorMessage.cs │ ├── FlexQueryResponse.cs │ ├── FlexResult.cs │ ├── FlexStatementResponse.cs │ ├── FlexStatements.cs │ ├── Ib │ │ ├── AccountInformation.cs │ │ ├── AssetSummary.cs │ │ ├── CFDCharge.cs │ │ ├── CFDCharges.cs │ │ ├── CashTransaction.cs │ │ ├── CashTransactions.cs │ │ ├── ChangeInDividendAccrual.cs │ │ ├── ChangeInDividendAccruals.cs │ │ ├── ComplexPosition.cs │ │ ├── ComplexPositions.cs │ │ ├── Constants.cs │ │ ├── ConversionRate.cs │ │ ├── ConversionRates.cs │ │ ├── EquitySummaryByReportDateInBase.cs │ │ ├── EquitySummaryInBase.cs │ │ ├── FlexStatement.cs │ │ ├── InterestAccruals.cs │ │ ├── InterestAccrualsCurrency.cs │ │ ├── Lot.cs │ │ ├── OpenDividendAccrual.cs │ │ ├── OpenDividendAccruals.cs │ │ ├── OpenPosition.cs │ │ ├── OpenPositions.cs │ │ ├── OptionEAE.cs │ │ ├── OptionEAEs.cs │ │ ├── Options.cs │ │ ├── Order.cs │ │ ├── PriorPeriodPosition.cs │ │ ├── PriorPeriodPositions.cs │ │ ├── SLBActivities.cs │ │ ├── SLBActivity.cs │ │ ├── SLBFee.cs │ │ ├── SLBFees.cs │ │ ├── SecuritiesInfo.cs │ │ ├── SecurityInfo.cs │ │ ├── StatementOfFundsLine.cs │ │ ├── StmtFunds.cs │ │ ├── SymbolSummary.cs │ │ ├── TierInterestDetail.cs │ │ ├── TierInterestDetails.cs │ │ ├── Trade.cs │ │ ├── TradeConfirm.cs │ │ ├── TradeConfirms.cs │ │ ├── Trades.cs │ │ ├── TransactionTax.cs │ │ ├── TransactionTaxes.cs │ │ ├── Transfer.cs │ │ ├── Transfers.cs │ │ ├── UnbundledCommissionDetail.cs │ │ └── UnbundledCommissionDetails.cs │ └── IbFlexReader.Contracts.csproj ├── IbFlexReader.Tests │ ├── Contracts │ │ └── NotesTest.cs │ ├── IbFlexReader.Tests.csproj │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── ReaderTests.cs │ ├── Utils │ │ ├── DumpFileWriterTest.cs │ │ └── UtilsTest.cs │ ├── Xml │ │ ├── CashTransactionTest.cs │ │ ├── StatementOfFundsTest.cs │ │ ├── StringFactory.cs │ │ ├── TradeTest.cs │ │ ├── XmlTest.cs │ │ └── XmlTradeConfirmsTest.cs │ ├── XmlFileTest │ │ ├── TestFileHelper.cs │ │ ├── TestFileHelperTests.cs │ │ └── TestFiles │ │ │ ├── StatementOfFunds.xml │ │ │ └── TestForCoding.xml │ ├── app.config │ └── packages.config ├── IbFlexReader.Utils │ ├── DumpFileWriter.cs │ ├── Extensions.cs │ ├── IbFlexReader.Utils.csproj │ └── ObjectExtension.cs ├── IbFlexReader.Xml │ ├── Contracts │ │ ├── QueryResponse │ │ │ ├── AccountInformation.cs │ │ │ ├── AssetSummary.cs │ │ │ ├── CFDCharge.cs │ │ │ ├── CFDCharges.cs │ │ │ ├── CashTransaction.cs │ │ │ ├── CashTransactions.cs │ │ │ ├── ChangeInDividendAccrual.cs │ │ │ ├── ChangeInDividendAccruals.cs │ │ │ ├── ComplexPosition.cs │ │ │ ├── ComplexPositions.cs │ │ │ ├── ConversionRate.cs │ │ │ ├── ConversionRates.cs │ │ │ ├── EquitySummaryByReportDateInBase.cs │ │ │ ├── EquitySummaryInBase.cs │ │ │ ├── FlexQueryResponse.cs │ │ │ ├── FlexStatement.cs │ │ │ ├── FlexStatements.cs │ │ │ ├── InterestAccruals.cs │ │ │ ├── InterestAccrualsCurrency.cs │ │ │ ├── Lot.cs │ │ │ ├── OpenDividendAccrual.cs │ │ │ ├── OpenDividendAccruals.cs │ │ │ ├── OpenPosition.cs │ │ │ ├── OpenPositions.cs │ │ │ ├── OptionEAE.cs │ │ │ ├── OptionEAEs.cs │ │ │ ├── Order.cs │ │ │ ├── PriorPeriodPosition.cs │ │ │ ├── PriorPeriodPositions.cs │ │ │ ├── SLBActivities.cs │ │ │ ├── SLBActivity.cs │ │ │ ├── SLBFee.cs │ │ │ ├── SLBFees.cs │ │ │ ├── SecuritiesInfo.cs │ │ │ ├── SecurityInfo.cs │ │ │ ├── StatementOfFundsLine.cs │ │ │ ├── StmtFunds.cs │ │ │ ├── SymbolSummary.cs │ │ │ ├── TierInterestDetail.cs │ │ │ ├── TierInterestDetails.cs │ │ │ ├── Trade.cs │ │ │ ├── TradeConfirm.cs │ │ │ ├── TradeConfirms.cs │ │ │ ├── Trades.cs │ │ │ ├── TransactionTax.cs │ │ │ ├── TransactionTaxes.cs │ │ │ ├── Transfer.cs │ │ │ ├── Transfers.cs │ │ │ ├── UnbundledCommissionDetail.cs │ │ │ └── UnbundledCommissionDetails.cs │ │ ├── XmlBase.cs │ │ └── XmlFlexStatementResponse.cs │ ├── Deserializer.cs │ ├── IStreamBuilder.cs │ ├── IbFlexReader.Xml.csproj │ └── StringStream.cs ├── IbFlexReader.sln ├── IbFlexReader │ ├── Biehler.IbFlexReader.csproj │ ├── Logic.cs │ └── Reader.cs └── stylecop.ruleset ├── LICENSE ├── PROJECT.md ├── README.md ├── codecov.yml └── renovate.json /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015/2017 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # Visual Studio 2017 auto generated files 33 | Generated\ Files/ 34 | 35 | # MSTest test Results 36 | [Tt]est[Rr]esult*/ 37 | [Bb]uild[Ll]og.* 38 | 39 | # NUNIT 40 | *.VisualState.xml 41 | TestResult.xml 42 | 43 | # Build Results of an ATL Project 44 | [Dd]ebugPS/ 45 | [Rr]eleasePS/ 46 | dlldata.c 47 | 48 | # Benchmark Results 49 | BenchmarkDotNet.Artifacts/ 50 | 51 | # .NET Core 52 | project.lock.json 53 | project.fragment.lock.json 54 | artifacts/ 55 | **/Properties/launchSettings.json 56 | 57 | # StyleCop 58 | StyleCopReport.xml 59 | 60 | # Files built by Visual Studio 61 | *_i.c 62 | *_p.c 63 | *_i.h 64 | *.ilk 65 | *.meta 66 | *.obj 67 | *.iobj 68 | *.pch 69 | *.pdb 70 | *.ipdb 71 | *.pgc 72 | *.pgd 73 | *.rsp 74 | *.sbr 75 | *.tlb 76 | *.tli 77 | *.tlh 78 | *.tmp 79 | *.tmp_proj 80 | *.log 81 | *.vspscc 82 | *.vssscc 83 | .builds 84 | *.pidb 85 | *.svclog 86 | *.scc 87 | 88 | # Chutzpah Test files 89 | _Chutzpah* 90 | 91 | # Visual C++ cache files 92 | ipch/ 93 | *.aps 94 | *.ncb 95 | *.opendb 96 | *.opensdf 97 | *.sdf 98 | *.cachefile 99 | *.VC.db 100 | *.VC.VC.opendb 101 | 102 | # Visual Studio profiler 103 | *.psess 104 | *.vsp 105 | *.vspx 106 | *.sap 107 | 108 | # Visual Studio Trace Files 109 | *.e2e 110 | 111 | # TFS 2012 Local Workspace 112 | $tf/ 113 | 114 | # Guidance Automation Toolkit 115 | *.gpState 116 | 117 | # ReSharper is a .NET coding add-in 118 | _ReSharper*/ 119 | *.[Rr]e[Ss]harper 120 | *.DotSettings.user 121 | 122 | # JustCode is a .NET coding add-in 123 | .JustCode 124 | 125 | # TeamCity is a build add-in 126 | _TeamCity* 127 | 128 | # DotCover is a Code Coverage Tool 129 | *.dotCover 130 | 131 | # AxoCover is a Code Coverage Tool 132 | .axoCover/* 133 | !.axoCover/settings.json 134 | 135 | # Visual Studio code coverage results 136 | *.coverage 137 | *.coveragexml 138 | 139 | # NCrunch 140 | _NCrunch_* 141 | .*crunch*.local.xml 142 | nCrunchTemp_* 143 | 144 | # MightyMoose 145 | *.mm.* 146 | AutoTest.Net/ 147 | 148 | # Web workbench (sass) 149 | .sass-cache/ 150 | 151 | # Installshield output folder 152 | [Ee]xpress/ 153 | 154 | # DocProject is a documentation generator add-in 155 | DocProject/buildhelp/ 156 | DocProject/Help/*.HxT 157 | DocProject/Help/*.HxC 158 | DocProject/Help/*.hhc 159 | DocProject/Help/*.hhk 160 | DocProject/Help/*.hhp 161 | DocProject/Help/Html2 162 | DocProject/Help/html 163 | 164 | # Click-Once directory 165 | publish/ 166 | 167 | # Publish Web Output 168 | *.[Pp]ublish.xml 169 | *.azurePubxml 170 | # Note: Comment the next line if you want to checkin your web deploy settings, 171 | # but database connection strings (with potential passwords) will be unencrypted 172 | *.pubxml 173 | *.publishproj 174 | 175 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 176 | # checkin your Azure Web App publish settings, but sensitive information contained 177 | # in these scripts will be unencrypted 178 | PublishScripts/ 179 | 180 | # NuGet Packages 181 | *.nupkg 182 | # The packages folder can be ignored because of Package Restore 183 | **/[Pp]ackages/* 184 | # except build/, which is used as an MSBuild target. 185 | !**/[Pp]ackages/build/ 186 | # Uncomment if necessary however generally it will be regenerated when needed 187 | #!**/[Pp]ackages/repositories.config 188 | # NuGet v3's project.json files produces more ignorable files 189 | *.nuget.props 190 | *.nuget.targets 191 | 192 | # Microsoft Azure Build Output 193 | csx/ 194 | *.build.csdef 195 | 196 | # Microsoft Azure Emulator 197 | ecf/ 198 | rcf/ 199 | 200 | # Windows Store app package directories and files 201 | AppPackages/ 202 | BundleArtifacts/ 203 | Package.StoreAssociation.xml 204 | _pkginfo.txt 205 | *.appx 206 | 207 | # Visual Studio cache files 208 | # files ending in .cache can be ignored 209 | *.[Cc]ache 210 | # but keep track of directories ending in .cache 211 | !*.[Cc]ache/ 212 | 213 | # Others 214 | ClientBin/ 215 | ~$* 216 | *~ 217 | *.dbmdl 218 | *.dbproj.schemaview 219 | *.jfm 220 | *.pfx 221 | *.publishsettings 222 | orleans.codegen.cs 223 | 224 | # Including strong name files can present a security risk 225 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 226 | #*.snk 227 | 228 | # Since there are multiple workflows, uncomment next line to ignore bower_components 229 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 230 | #bower_components/ 231 | 232 | # RIA/Silverlight projects 233 | Generated_Code/ 234 | 235 | # Backup & report files from converting an old project file 236 | # to a newer Visual Studio version. Backup files are not needed, 237 | # because we have git ;-) 238 | _UpgradeReport_Files/ 239 | Backup*/ 240 | UpgradeLog*.XML 241 | UpgradeLog*.htm 242 | ServiceFabricBackup/ 243 | *.rptproj.bak 244 | 245 | # SQL Server files 246 | *.mdf 247 | *.ldf 248 | *.ndf 249 | 250 | # Business Intelligence projects 251 | *.rdl.data 252 | *.bim.layout 253 | *.bim_*.settings 254 | *.rptproj.rsuser 255 | 256 | # Microsoft Fakes 257 | FakesAssemblies/ 258 | 259 | # GhostDoc plugin setting file 260 | *.GhostDoc.xml 261 | 262 | # Node.js Tools for Visual Studio 263 | .ntvs_analysis.dat 264 | node_modules/ 265 | 266 | # Visual Studio 6 build log 267 | *.plg 268 | 269 | # Visual Studio 6 workspace options file 270 | *.opt 271 | 272 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 273 | *.vbw 274 | 275 | # Visual Studio LightSwitch build output 276 | **/*.HTMLClient/GeneratedArtifacts 277 | **/*.DesktopClient/GeneratedArtifacts 278 | **/*.DesktopClient/ModelManifest.xml 279 | **/*.Server/GeneratedArtifacts 280 | **/*.Server/ModelManifest.xml 281 | _Pvt_Extensions 282 | 283 | # Paket dependency manager 284 | .paket/paket.exe 285 | paket-files/ 286 | 287 | # FAKE - F# Make 288 | .fake/ 289 | 290 | # JetBrains Rider 291 | .idea/ 292 | *.sln.iml 293 | 294 | # CodeRush 295 | .cr/ 296 | 297 | # Python Tools for Visual Studio (PTVS) 298 | __pycache__/ 299 | *.pyc 300 | 301 | # Cake - Uncomment if you are using it 302 | # tools/** 303 | # !tools/packages.config 304 | 305 | # Tabs Studio 306 | *.tss 307 | 308 | # Telerik's JustMock configuration file 309 | *.jmconfig 310 | 311 | # BizTalk build output 312 | *.btp.cs 313 | *.btm.cs 314 | *.odx.cs 315 | *.xsd.cs 316 | 317 | # OpenCover UI analysis results 318 | OpenCover/ 319 | 320 | # Azure Stream Analytics local run output 321 | ASALocalRun/ 322 | 323 | # MSBuild Binary and Structured Log 324 | *.binlog 325 | 326 | # NVidia Nsight GPU debugger configuration file 327 | *.nvuser 328 | 329 | # MFractors (Xamarin productivity tool) working folder 330 | .mfractor/ 331 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | 2 | language: csharp 3 | solution: IbFlexReader/IbFlexReader.sln 4 | 5 | install: 6 | - nuget restore IbFlexReader/IbFlexReader.sln 7 | - nuget install NUnit.Console -Version 3.9.0 -OutputDirectory testrunner 8 | 9 | script: 10 | - msbuild /p:Configuration=Release IbFlexReader/IbFlexReader.sln 11 | - mono ./testrunner/NUnit.ConsoleRunner.3.9.0/tools/nunit3-console.exe ./IbFlexReader/IbFlexReader.Tests/bin/Release/IbFlexReader.Tests.dll 12 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # OBSOLETE 2 | use https://github.com/gabbersepp/ib-flex-reader/releases instead 3 | 4 | # Changelog 5 | 6 | Here you can see a full list of changes between each release. 7 | 8 | ## Version 1.4.0 9 | 10 | Released on March 12, 2019 11 | 12 | - add Statement of Funds 13 | 14 | ## Version 1.3.0 15 | 16 | Released on Januar 26, 2019 17 | 18 | - new currencies 19 | - add CASH asset category 20 | - added usings, added test 21 | - add editor config to solution 22 | - curly braces 23 | - editorconfig file added 24 | - add Deposit/Withdrawal transaction type 25 | - reader dumps to file 26 | - add last edit 27 | - interim solution 28 | - add HKD currency 29 | - Add folder "Solution Items" 30 | - add git file 31 | - add new gitignore 32 | 33 | ## Version 1.2.0 34 | 35 | Released on November 06, 2018 36 | 37 | - add SEK currency 38 | - add TradeConfirm (JueMueller) 39 | 40 | ## Version 1.1.0 41 | 42 | Released on November 06, 2018 43 | 44 | - split up Open/Close trades. see issue #3 45 | - allow flagable enums 46 | 47 | ## Version 1.0.3 48 | 49 | Released on November 05, 2018 50 | 51 | - make more stable by not throwing exception when something can not be parsed 52 | 53 | ## Version 1.0.2 54 | 55 | Released on November 01, 2018 56 | 57 | - add notes enum to "Trade" class 58 | - add more currencies [Hummel83] 59 | 60 | ## Version 1.0.1 61 | 62 | Released on October 23, 2018 63 | 64 | - add cash transaction type "Price Adjustment" 65 | 66 | ## Version 1.0.0 67 | 68 | Released on October 22, 2018 69 | 70 | well, very much :-) 71 | 72 | ## Version 0.0.0 73 | 74 | The basic implementation of parsing and the full XML model. -------------------------------------------------------------------------------- /IbFlexReader/.editorconfig: -------------------------------------------------------------------------------- 1 | # 4 space indentation 2 | [*.cs] 3 | indent_style = space 4 | indent_size = 4 5 | trim_trailing_whitespace = true -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Attributes/FormatAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Attributes 2 | { 3 | using System; 4 | 5 | [AttributeUsage(AttributeTargets.Property, AllowMultiple = true)] 6 | public class FormatAttribute : Attribute 7 | { 8 | public readonly string Value; 9 | public readonly int Order; 10 | 11 | public FormatAttribute(string value, int order = 0) 12 | { 13 | Value = value; 14 | Order = order; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Enums/AssetCategory.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Enums 2 | { 3 | public enum AssetCategory 4 | { 5 | STK, OPT, FOP, CFD, FUT, CASH, FXCFD, BOND 6 | } 7 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Enums/BuySell.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Enums 2 | { 3 | using EnumParser; 4 | 5 | [EnumName] 6 | public enum BuySell 7 | { 8 | [EnumName("BUY")] 9 | BUY, 10 | [EnumName("SELL")] 11 | SELL, 12 | [EnumName("SELL (Ca.)")] 13 | SELLCa 14 | } 15 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Enums/CashTransactionType.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Enums 2 | { 3 | using EnumParser; 4 | 5 | [EnumName] 6 | public enum CashTransactionType 7 | { 8 | [EnumName("Other Fees")] 9 | OtherFees, 10 | [EnumName("Withholding Tax")] 11 | WithholdingTax, 12 | [EnumName("871(m) Withholding")] 13 | Withholding871, 14 | [EnumName("Dividends")] 15 | Dividends, 16 | [EnumName("Payment In Lieu Of Dividends")] 17 | PaymentInLieuOfDividends, 18 | [EnumName("Broker Interest Paid")] 19 | BrokerInterestPaid, 20 | [EnumName("Price Adjustments")] 21 | PriceAdjustments, 22 | [EnumName("Deposits/Withdrawals")] 23 | DepositsWithdrawals, 24 | [EnumName("Broker Interest Received")] 25 | BrokerInterestReceived, 26 | [EnumName("Bond Interest Received")] 27 | BondInterestReceived 28 | } 29 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Enums/Currencies.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Enums 2 | { 3 | public enum Currencies 4 | { 5 | EUR, 6 | USD, 7 | JPY, 8 | CHF, 9 | GBP, 10 | NZD, 11 | AUD, 12 | CAD, 13 | SEK, 14 | HKD, 15 | MXN, 16 | RUB, 17 | NOK, 18 | ZAR, 19 | SGD 20 | } 21 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Enums/LongShort.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Enums 2 | { 3 | public enum LongShort 4 | { 5 | Long, Short 6 | } 7 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Enums/Notes.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Enums 2 | { 3 | using System; 4 | using EnumParser; 5 | 6 | [EnumName] 7 | [Flags] 8 | public enum Notes : long 9 | { 10 | [EnumName("A")] 11 | Assigned = 1, 12 | [EnumName("AEx")] 13 | AutomaticalExercise = 1L << 1, 14 | [EnumName("Adj")] 15 | Adjustment = 1L << 2, 16 | [EnumName("Al")] 17 | Allocation = 1L << 3, 18 | [EnumName("Aw")] 19 | AwayTrade = 1L << 4, 20 | [EnumName("B")] 21 | AutoBuyIn = 1L << 5, 22 | [EnumName("Bo")] 23 | DirectLending = 1L << 6, 24 | [EnumName("C")] 25 | ClosingTrade = 1L << 7, 26 | [EnumName("CD")] 27 | CashDelivery = 1L << 8, 28 | [EnumName("CP")] 29 | ComplexePosition = 1L << 9, 30 | [EnumName("Ca")] 31 | Deleted = 1L << 10, 32 | [EnumName("Co")] 33 | CorrectedTrade = 1L << 11, 34 | [EnumName("Cx")] 35 | CrossTrade = 1L << 12, 36 | [EnumName("ETF")] 37 | EtfCreation = 1L << 13, 38 | [EnumName("Ep")] 39 | Expired = 1L << 14, 40 | [EnumName("Ex")] 41 | Exercised = 1L << 15, 42 | [EnumName("G")] 43 | GuaranteedAccountSegment = 1L << 16, 44 | [EnumName("HC")] 45 | MaxTaxBase = 1L << 17, 46 | [EnumName("HFI")] 47 | InvestmentTransferToHedgeFund = 1L << 18, 48 | [EnumName("HFR")] 49 | RedemptionForHedgeFund = 1L << 19, 50 | [EnumName("I")] 51 | InternalTransfer = 1L << 20, 52 | [EnumName("IA")] 53 | ExecutedAgainstCompany = 1L << 21, 54 | [EnumName("INV")] 55 | InvestmentTransferFromInvestor = 1L << 22, 56 | [EnumName("IPO")] 57 | IPO = 1L << 23, 58 | [EnumName("L")] 59 | MarginViolation = 1L << 24, 60 | [EnumName("LD")] 61 | AdjustedLossWashSale = 1L << 25, 62 | [EnumName("LI")] 63 | LiFo = 1L << 26, 64 | [EnumName("LT")] 65 | LongTermPL = 1L << 27, 66 | [EnumName("Lo")] 67 | DirectLoan = 1L << 28, 68 | [EnumName("M")] 69 | ManualThroughIB = 1L << 29, 70 | [EnumName("MEx")] 71 | ManualExercise = 1L << 30, 72 | [EnumName("ML")] 73 | MaximizeLoss = 1L << 31, 74 | [EnumName("MLG")] 75 | MLG = 1L << 32, 76 | [EnumName("MLL")] 77 | MLL = 1L << 33, 78 | [EnumName("MSG")] 79 | MSG = 1L << 34, 80 | [EnumName("MSL")] 81 | MSL = 1L << 35, 82 | [EnumName("O")] 83 | OpeningTrade = 1L << 36, 84 | [EnumName("P")] 85 | PartialExecution = 1L << 37, 86 | [EnumName("PI")] 87 | PI = 1L << 38, 88 | [EnumName("Po")] 89 | InterestDividendAccrualPosting = 1L << 39, 90 | [EnumName("Pr")] 91 | PrincipalTrade = 1L << 40, 92 | [EnumName("R")] 93 | DividendReinvestment = 1L << 41, 94 | [EnumName("RED")] 95 | RedemptionToInvestor = 1L << 42, 96 | [EnumName("Re")] 97 | TransformationInterestDividend = 1L << 43, 98 | [EnumName("Ri")] 99 | Refund = 1L << 44, 100 | [EnumName("SI")] 101 | ArrangedByIB = 1L << 45, 102 | [EnumName("SL")] 103 | SL = 1L << 46, 104 | [EnumName("SO")] 105 | ArrangedByIntroducingBroker = 1L << 47, 106 | [EnumName("SS")] 107 | ShortendedExecution = 1L << 48, 108 | [EnumName("ST")] 109 | ShortTermPL = 1L << 49, 110 | [EnumName("SY")] 111 | StockYieldEligible = 1L << 50, 112 | [EnumName("T")] 113 | Transfer = 1L << 51, 114 | 115 | [EnumName("ADR")] 116 | ADRFeeAccrual = 1L << 52, 117 | [EnumName("FP")] 118 | IBPrincipalForFractional = 1L << 53, 119 | [EnumName("FPA")] 120 | IBPrincipalForFractionalAgentWhole = 1L << 54, 121 | [EnumName("RP")] 122 | IBRisklessPrincipalForFractional = 1L << 55, 123 | [EnumName("RPA")] 124 | IBRisklessPrincipalForFractionalAgentWhole = 1L << 56, 125 | [EnumName("U")] 126 | UnvestedSharesFromStockGrant = 1L << 57, 127 | [EnumName("D")] 128 | Delisted = 1L << 58 129 | } 130 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Enums/OpenClose.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Enums 2 | { 3 | using System; 4 | 5 | [Flags] 6 | public enum OpenClose 7 | { 8 | O = 1, C = 2 9 | } 10 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Enums/PutCall.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Enums 2 | { 3 | public enum PutCall 4 | { 5 | P, C 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/ErrorMessage.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts 2 | { 3 | public class ErrorMessage 4 | { 5 | public string Object; 6 | public string Message; 7 | } 8 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/FlexQueryResponse.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts 2 | { 3 | using System.Collections.Generic; 4 | 5 | public class FlexQueryResponse 6 | { 7 | public FlexStatements FlexStatements { get; set; } 8 | 9 | public string QueryName { get; set; } 10 | 11 | public string Type { get; set; } 12 | 13 | public List Errors { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/FlexResult.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts 2 | { 3 | public class FlexResult 4 | { 5 | public string ErrorMessage { get; set; } 6 | public int? ErrorCode { get; set; } 7 | public string Status { get; set; } 8 | public bool IsSuccess => Status == "Success"; 9 | public FlexQueryResponse FlexQueryResponse { get; set; } 10 | public string ReferenceCode { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/FlexStatementResponse.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | public class FlexStatementResponse 8 | { 9 | public string Status { get; set; } 10 | public long? ReferenceCode { get; set; } 11 | public string Url { get; set; } 12 | public int? ErrorCode { get; set; } 13 | public string ErrorMessage { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/FlexStatements.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts 2 | { 3 | using System.Collections.Generic; 4 | using IbFlexReader.Contracts.Ib; 5 | 6 | public class FlexStatements 7 | { 8 | public List FlexStatement { get; set; } 9 | 10 | public int? Count { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/AccountInformation.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System; 4 | using IbFlexReader.Contracts.Attributes; 5 | using IbFlexReader.Contracts.Enums; 6 | 7 | public class AccountInformation 8 | { 9 | public string AccountId { get; set; } 10 | 11 | public string AcctAlias { get; set; } 12 | 13 | public string Model { get; set; } 14 | 15 | public Currencies? Currency { get; set; } 16 | 17 | public string Name { get; set; } 18 | 19 | public string AccountType { get; set; } 20 | 21 | public string CustomerType { get; set; } 22 | 23 | public string AccountCapabilities { get; set; } 24 | 25 | public string TradingPermissions { get; set; } 26 | 27 | public string RegisteredRepName { get; set; } 28 | 29 | public string RegisteredRepPhone { get; set; } 30 | 31 | [Format(Constants.DateFormat)] 32 | public DateTime? DateOpened { get; set; } 33 | 34 | [Format(Constants.DateFormat)] 35 | public DateTime? DateFunded { get; set; } 36 | 37 | [Format(Constants.DateFormat)] 38 | public DateTime? DateClosed { get; set; } 39 | 40 | public string Street { get; set; } 41 | 42 | public string Street2 { get; set; } 43 | 44 | public string City { get; set; } 45 | 46 | public string State { get; set; } 47 | 48 | public string Country { get; set; } 49 | 50 | public string PostalCode { get; set; } 51 | 52 | public string StreetResidentialAddress { get; set; } 53 | 54 | public string Street2ResidentialAddress { get; set; } 55 | 56 | public string CityResidentialAddress { get; set; } 57 | 58 | public string StateResidentialAddress { get; set; } 59 | 60 | public string CountryResidentialAddress { get; set; } 61 | 62 | public string PostalCodeResidentialAddress { get; set; } 63 | 64 | public string MasterName { get; set; } 65 | 66 | public string IbEntity { get; set; } 67 | 68 | public string PrimaryEmail { get; set; } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/AssetSummary.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | public class AssetSummary : Trade 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/CFDCharge.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System; 4 | using IbFlexReader.Contracts.Attributes; 5 | using IbFlexReader.Contracts.Enums; 6 | 7 | public class CFDCharge 8 | { 9 | public string AccountId { get; set; } 10 | 11 | public string AcctAlias { get; set; } 12 | 13 | public string Model { get; set; } 14 | 15 | public Currencies? Currency { get; set; } 16 | 17 | public double? FxRateToBase { get; set; } 18 | 19 | public AssetCategory? AssetCategory { get; set; } 20 | 21 | public string Symbol { get; set; } 22 | 23 | public string Description { get; set; } 24 | 25 | public long? Conid { get; set; } 26 | 27 | public string SecurityID { get; set; } 28 | 29 | public string SecurityIDType { get; set; } 30 | 31 | public string Cusip { get; set; } 32 | 33 | public string Isin { get; set; } 34 | 35 | public string ListingExchange { get; set; } 36 | 37 | public long? UnderlyingConid { get; set; } 38 | 39 | public string UnderlyingSymbol { get; set; } 40 | 41 | public string UnderlyingSecurityID { get; set; } 42 | 43 | public string UnderlyingListingExchange { get; set; } 44 | 45 | public string Issuer { get; set; } 46 | 47 | public int? Multiplier { get; set; } 48 | 49 | public double? Strike { get; set; } 50 | 51 | [Format(Constants.DateFormat)] 52 | public DateTime? Expiry { get; set; } 53 | 54 | public PutCall? PutCall { get; set; } 55 | 56 | public string PrincipalAdjustFactor { get; set; } 57 | 58 | [Format(Constants.DateFormat)] 59 | public DateTime? Date { get; set; } 60 | 61 | public double? Received { get; set; } 62 | 63 | public double? Paid { get; set; } 64 | 65 | public double? Total { get; set; } 66 | 67 | public string TransactionID { get; set; } 68 | } 69 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/CFDCharges.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System.Collections.Generic; 4 | 5 | public class CFDCharges 6 | { 7 | public List CFDCharge { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/CashTransaction.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System; 4 | using IbFlexReader.Contracts.Attributes; 5 | using IbFlexReader.Contracts.Enums; 6 | 7 | public class CashTransaction 8 | { 9 | public string AccountId { get; set; } 10 | 11 | public string AcctAlias { get; set; } 12 | 13 | public string Model { get; set; } 14 | 15 | public Currencies? Currency { get; set; } 16 | 17 | public double? FxRateToBase { get; set; } 18 | 19 | public AssetCategory? AssetCategory { get; set; } 20 | 21 | public string Symbol { get; set; } 22 | 23 | public string Description { get; set; } 24 | 25 | public long? Conid { get; set; } 26 | 27 | public string SecurityID { get; set; } 28 | 29 | public string SecurityIDType { get; set; } 30 | 31 | public string Cusip { get; set; } 32 | 33 | public string Isin { get; set; } 34 | 35 | public string ListingExchange { get; set; } 36 | 37 | public long? UnderlyingConid { get; set; } 38 | 39 | public string UnderlyingSymbol { get; set; } 40 | 41 | public string UnderlyingSecurityID { get; set; } 42 | 43 | public string UnderlyingListingExchange { get; set; } 44 | 45 | public string Issuer { get; set; } 46 | 47 | public int? Multiplier { get; set; } 48 | 49 | public double? Strike { get; set; } 50 | 51 | [Format(Constants.DateFormat)] 52 | public DateTime? Expiry { get; set; } 53 | 54 | public PutCall? PutCall { get; set; } 55 | 56 | public string PrincipalAdjustFactor { get; set; } 57 | 58 | [Format(Constants.DateFormat), Format(Constants.DateTimeFormat, order: 1)] 59 | public DateTime? DateTime { get; set; } 60 | 61 | public double? Amount { get; set; } 62 | 63 | public CashTransactionType? Type { get; set; } 64 | 65 | public long? TradeID { get; set; } 66 | 67 | public string Code { get; set; } 68 | 69 | public long? TransactionID { get; set; } 70 | 71 | //Note: The reportDate XML attribute may contain either a date or a string, i.e. reportDate="MULTI" 72 | public string ReportDate { get; set; } 73 | 74 | public string ClientReference { get; set; } 75 | 76 | [Format(Constants.DateFormat)] 77 | public string SettleDate { get; set; } 78 | } 79 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/CashTransactions.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System.Collections.Generic; 4 | 5 | public class CashTransactions 6 | { 7 | public List CashTransaction { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/ChangeInDividendAccrual.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System; 4 | using IbFlexReader.Contracts.Attributes; 5 | using IbFlexReader.Contracts.Enums; 6 | 7 | public class ChangeInDividendAccrual 8 | { 9 | public string AccountId { get; set; } 10 | 11 | public string AcctAlias { get; set; } 12 | 13 | public string Model { get; set; } 14 | 15 | public Currencies? Currency { get; set; } 16 | 17 | public double? FxRateToBase { get; set; } 18 | 19 | public AssetCategory? AssetCategory { get; set; } 20 | 21 | public string Symbol { get; set; } 22 | 23 | public string Description { get; set; } 24 | 25 | public long? Conid { get; set; } 26 | 27 | public string SecurityID { get; set; } 28 | 29 | public string SecurityIDType { get; set; } 30 | 31 | public string Cusip { get; set; } 32 | 33 | public string Isin { get; set; } 34 | 35 | public string ListingExchange { get; set; } 36 | 37 | public long? UnderlyingConid { get; set; } 38 | 39 | public string UnderlyingSymbol { get; set; } 40 | 41 | public string UnderlyingSecurityID { get; set; } 42 | 43 | public string UnderlyingListingExchange { get; set; } 44 | 45 | public string Issuer { get; set; } 46 | 47 | public int? Multiplier { get; set; } 48 | 49 | public double? Strike { get; set; } 50 | 51 | [Format(Constants.DateFormat)] 52 | public DateTime? Expiry { get; set; } 53 | 54 | public PutCall? PutCall { get; set; } 55 | 56 | public string PrincipalAdjustFactor { get; set; } 57 | 58 | //Note: The reportDate XML attribute may contain either a date or a string, i.e. reportDate="MULTI" 59 | public string ReportDate { get; set; } 60 | 61 | [Format(Constants.DateFormat)] 62 | public DateTime? Date { get; set; } 63 | 64 | public string ExDate { get; set; } 65 | 66 | public string PayDate { get; set; } 67 | 68 | public double? Quantity { get; set; } 69 | 70 | public double? Tax { get; set; } 71 | 72 | public double? Fee { get; set; } 73 | 74 | public double? GrossRate { get; set; } 75 | 76 | public double? GrossAmount { get; set; } 77 | 78 | public double? NetAmount { get; set; } 79 | 80 | public string Code { get; set; } 81 | 82 | public string FromAcct { get; set; } 83 | 84 | public string ToAcct { get; set; } 85 | } 86 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/ChangeInDividendAccruals.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System.Collections.Generic; 4 | 5 | public class ChangeInDividendAccruals 6 | { 7 | public List ChangeInDividendAccrual { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/ComplexPosition.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System; 4 | using IbFlexReader.Contracts.Attributes; 5 | using IbFlexReader.Contracts.Enums; 6 | 7 | public class ComplexPosition 8 | { 9 | public string AccountId { get; set; } 10 | 11 | public string AcctAlias { get; set; } 12 | 13 | public string LevelOfDetail { get; set; } 14 | 15 | public double? Quantity { get; set; } 16 | 17 | public string PrincipalAdjustFactor { get; set; } 18 | 19 | public PutCall? PutCall { get; set; } 20 | 21 | public string Issuer { get; set; } 22 | 23 | public int? Multiplier { get; set; } 24 | 25 | public double? Strike { get; set; } 26 | 27 | [Format(Constants.DateFormat)] 28 | public DateTime? Expiry { get; set; } 29 | 30 | public AssetCategory? AssetCategory { get; set; } 31 | 32 | public string Symbol { get; set; } 33 | 34 | public string Description { get; set; } 35 | 36 | public long? Conid { get; set; } 37 | 38 | public string SecurityID { get; set; } 39 | 40 | public string SecurityIDType { get; set; } 41 | 42 | public string Cusip { get; set; } 43 | 44 | public string Isin { get; set; } 45 | 46 | public string ListingExchange { get; set; } 47 | 48 | public long? UnderlyingConid { get; set; } 49 | 50 | public string UnderlyingSymbol { get; set; } 51 | 52 | public string UnderlyingSecurityID { get; set; } 53 | 54 | public string UnderlyingListingExchange { get; set; } 55 | 56 | public double? MtmPnl { get; set; } 57 | 58 | public double? Value { get; set; } 59 | 60 | public double? ClosePrice { get; set; } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/ComplexPositions.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System.Collections.Generic; 4 | 5 | public class ComplexPositions 6 | { 7 | public List ComplexPosition { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/Constants.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | public class Constants 4 | { 5 | public const string DateFormat = "yyyyMMdd"; 6 | public const string TimeFormat = "HHmmss"; 7 | public const string DateTimeFormat = DateFormat + ";" + TimeFormat; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/ConversionRate.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using IbFlexReader.Contracts.Enums; 4 | 5 | public class ConversionRate 6 | { 7 | //Note: The reportDate XML attribute may contain either a date or a string, i.e. reportDate="MULTI" 8 | public string ReportDate { get; set; } 9 | 10 | public Currencies FromCurrency { get; set; } 11 | 12 | public Currencies ToCurrency { get; set; } 13 | 14 | public double Rate { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/ConversionRates.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System.Collections.Generic; 4 | 5 | public class ConversionRates 6 | { 7 | public List ConversionRate { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/EquitySummaryByReportDateInBase.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | public class EquitySummaryByReportDateInBase 4 | { 5 | public string AccountId { get; set; } 6 | 7 | public string AcctAlias { get; set; } 8 | 9 | public string Model { get; set; } 10 | 11 | //Note: The reportDate XML attribute may contain either a date or a string, i.e. reportDate="MULTI" 12 | public string ReportDate { get; set; } 13 | 14 | public double? Cash { get; set; } 15 | 16 | public double? CashLong { get; set; } 17 | 18 | public double? CashShort { get; set; } 19 | 20 | public double? SlbCashCollateral { get; set; } 21 | 22 | public double? SlbCashCollateralLong { get; set; } 23 | 24 | public double? SlbCashCollateralShort { get; set; } 25 | 26 | public double? Stock { get; set; } 27 | 28 | public double? StockLong { get; set; } 29 | 30 | public double? StockShort { get; set; } 31 | 32 | public double? SlbDirectSecuritiesBorrowed { get; set; } 33 | 34 | public double? SlbDirectSecuritiesBorrowedLong { get; set; } 35 | 36 | public double? SlbDirectSecuritiesBorrowedShort { get; set; } 37 | 38 | public double? SlbDirectSecuritiesLent { get; set; } 39 | 40 | public double? SlbDirectSecuritiesLentLong { get; set; } 41 | 42 | public double? SlbDirectSecuritiesLentShort { get; set; } 43 | 44 | public double? Options { get; set; } 45 | 46 | public double? OptionsLong { get; set; } 47 | 48 | public double? OptionsShort { get; set; } 49 | 50 | public double? Commodities { get; set; } 51 | 52 | public double? CommoditiesLong { get; set; } 53 | 54 | public double? CommoditiesShort { get; set; } 55 | 56 | public double? Bonds { get; set; } 57 | 58 | public double? BondsLong { get; set; } 59 | 60 | public double? BondsShort { get; set; } 61 | 62 | public double? Notes { get; set; } 63 | 64 | public double? NotesLong { get; set; } 65 | 66 | public double? NotesShort { get; set; } 67 | 68 | public double? Funds { get; set; } 69 | 70 | public double? FundsLong { get; set; } 71 | 72 | public double? FundsShort { get; set; } 73 | 74 | public double? InterestAccruals { get; set; } 75 | 76 | public double? InterestAccrualsLong { get; set; } 77 | 78 | public double? InterestAccrualsShort { get; set; } 79 | 80 | public double? SoftDollars { get; set; } 81 | 82 | public double? SoftDollarsLong { get; set; } 83 | 84 | public double? SoftDollarsShort { get; set; } 85 | 86 | public double? ForexCfdUnrealizedPl { get; set; } 87 | 88 | public double? ForexCfdUnrealizedPlLong { get; set; } 89 | 90 | public double? ForexCfdUnrealizedPlShort { get; set; } 91 | 92 | public double? CfdUnrealizedPl { get; set; } 93 | 94 | public double? CfdUnrealizedPlLong { get; set; } 95 | 96 | public double? CfdUnrealizedPlShort { get; set; } 97 | 98 | public double? DividendAccruals { get; set; } 99 | 100 | public double? DividendAccrualsLong { get; set; } 101 | 102 | public double? DividendAccrualsShort { get; set; } 103 | 104 | public double? FdicInsuredBankSweepAccountCashComponent { get; set; } 105 | 106 | public double? FdicInsuredBankSweepAccountCashComponentLong { get; set; } 107 | 108 | public double? FdicInsuredBankSweepAccountCashComponentShort { get; set; } 109 | 110 | public double? FdicInsuredAccountInterestAccrualsComponent { get; set; } 111 | 112 | public double? FdicInsuredAccountInterestAccrualsComponentLong { get; set; } 113 | 114 | public double? FdicInsuredAccountInterestAccrualsComponentShort { get; set; } 115 | 116 | public double? Total { get; set; } 117 | 118 | public double? TotalLong { get; set; } 119 | 120 | public double? TotalShort { get; set; } 121 | } 122 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/EquitySummaryInBase.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System.Collections.Generic; 4 | 5 | public class EquitySummaryInBase 6 | { 7 | public List EquitySummaryByReportDateInBase { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/FlexStatement.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System; 4 | using IbFlexReader.Contracts.Attributes; 5 | 6 | public class FlexStatement 7 | { 8 | public AccountInformation AccountInformation { get; set; } 9 | 10 | public CashTransactions CashTransactions { get; set; } 11 | 12 | public CFDCharges CFDCharges { get; set; } 13 | 14 | public ChangeInDividendAccruals ChangeInDividendAccruals { get; set; } 15 | 16 | public ComplexPositions ComplexPositions { get; set; } 17 | 18 | public ConversionRates ConversionRates { get; set; } 19 | 20 | public string CorporateActions { get; set; } 21 | 22 | public EquitySummaryInBase EquitySummaryInBase { get; set; } 23 | 24 | public InterestAccruals InterestAccruals { get; set; } 25 | 26 | public OpenDividendAccruals OpenDividendAccruals { get; set; } 27 | 28 | public OpenPositions OpenPositions { get; set; } 29 | 30 | public OptionEAEs OptionEAEs { get; set; } 31 | 32 | public PriorPeriodPositions PriorPeriodPositions { get; set; } 33 | 34 | public SecuritiesInfo SecuritiesInfo { get; set; } 35 | 36 | public SLBActivities SLBActivities { get; set; } 37 | 38 | public SLBFees SLBFees { get; set; } 39 | 40 | public StmtFunds StatementOfFunds { get; set; } 41 | 42 | public TierInterestDetails TierInterestDetails { get; set; } 43 | 44 | public TradeConfirms TradeConfirms { get; set; } 45 | 46 | public Trades Trades { get; set; } 47 | 48 | public TransactionTaxes TransactionTaxes { get; set; } 49 | 50 | public Transfers Transfers { get; set; } 51 | 52 | public UnbundledCommissionDetails UnbundledCommissionDetails { get; set; } 53 | 54 | public string AccountId { get; set; } 55 | 56 | [Format(Constants.DateFormat)] 57 | public DateTime? FromDate { get; set; } 58 | 59 | [Format(Constants.DateFormat)] 60 | public DateTime? ToDate { get; set; } 61 | 62 | public string Period { get; set; } 63 | 64 | [Format(Constants.DateTimeFormat)] 65 | public DateTime? WhenGenerated { get; set; } 66 | } 67 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/InterestAccruals.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System.Collections.Generic; 4 | 5 | public class InterestAccruals 6 | { 7 | public List InterestAccrualsCurrency { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/InterestAccrualsCurrency.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System; 4 | using IbFlexReader.Contracts.Attributes; 5 | 6 | public class InterestAccrualsCurrency 7 | { 8 | [Format(Constants.DateFormat)] 9 | public DateTime? ToDate { get; set; } 10 | 11 | [Format(Constants.DateFormat)] 12 | public DateTime? FromDate { get; set; } 13 | 14 | public string AccountId { get; set; } 15 | 16 | public string AcctAlias { get; set; } 17 | 18 | public string Model { get; set; } 19 | 20 | //Note: IB does not use a standard currency code here. It is a value like BASE_SUMMARY. 21 | public string Currency { get; set; } 22 | 23 | public double? EndingAccrualBalance { get; set; } 24 | 25 | public double? FxTranslation { get; set; } 26 | 27 | public double? AccrualReversal { get; set; } 28 | 29 | public double? InterestAccrued { get; set; } 30 | 31 | public double? StartingAccrualBalance { get; set; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/Lot.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | public class Lot : Trade 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/OpenDividendAccrual.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System; 4 | using IbFlexReader.Contracts.Attributes; 5 | using IbFlexReader.Contracts.Enums; 6 | 7 | public class OpenDividendAccrual 8 | { 9 | public string AccountId { get; set; } 10 | 11 | public string AcctAlias { get; set; } 12 | 13 | public string Model { get; set; } 14 | 15 | public Currencies? Currency { get; set; } 16 | 17 | public double? FxRateToBase { get; set; } 18 | 19 | public AssetCategory? AssetCategory { get; set; } 20 | 21 | public string Symbol { get; set; } 22 | 23 | public string Description { get; set; } 24 | 25 | public long? Conid { get; set; } 26 | 27 | public string SecurityID { get; set; } 28 | 29 | public string SecurityIDType { get; set; } 30 | 31 | public string Cusip { get; set; } 32 | 33 | public string Isin { get; set; } 34 | 35 | public string ListingExchange { get; set; } 36 | 37 | public long? UnderlyingConid { get; set; } 38 | 39 | public string UnderlyingSymbol { get; set; } 40 | 41 | public string UnderlyingSecurityID { get; set; } 42 | 43 | public string UnderlyingListingExchange { get; set; } 44 | 45 | public string Issuer { get; set; } 46 | 47 | public int? Multiplier { get; set; } 48 | 49 | public double? Strike { get; set; } 50 | 51 | [Format(Constants.DateFormat)] 52 | public DateTime? Expiry { get; set; } 53 | 54 | public PutCall? PutCall { get; set; } 55 | 56 | public string PrincipalAdjustFactor { get; set; } 57 | 58 | public string ExDate { get; set; } 59 | 60 | public string PayDate { get; set; } 61 | 62 | public double? Quantity { get; set; } 63 | 64 | public double? Tax { get; set; } 65 | 66 | public double? Fee { get; set; } 67 | 68 | public double? GrossRate { get; set; } 69 | 70 | public double? GrossAmount { get; set; } 71 | 72 | public double? NetAmount { get; set; } 73 | 74 | public string Code { get; set; } 75 | 76 | public string FromAcct { get; set; } 77 | 78 | public string ToAcct { get; set; } 79 | } 80 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/OpenDividendAccruals.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | public class OpenDividendAccruals 4 | { 5 | public OpenDividendAccrual OpenDividendAccrual { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/OpenPosition.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System; 4 | using IbFlexReader.Contracts.Attributes; 5 | using IbFlexReader.Contracts.Enums; 6 | 7 | public class OpenPosition 8 | { 9 | public string AccountId { get; set; } 10 | 11 | public string AcctAlias { get; set; } 12 | 13 | public string Model { get; set; } 14 | 15 | public Currencies? Currency { get; set; } 16 | 17 | public double? FxRateToBase { get; set; } 18 | 19 | public AssetCategory? AssetCategory { get; set; } 20 | 21 | public string Symbol { get; set; } 22 | 23 | public string Description { get; set; } 24 | 25 | public long? Conid { get; set; } 26 | 27 | public string SecurityID { get; set; } 28 | 29 | public string SecurityIDType { get; set; } 30 | 31 | public string Cusip { get; set; } 32 | 33 | public string Isin { get; set; } 34 | 35 | public string ListingExchange { get; set; } 36 | 37 | public int? UnderlyingConid { get; set; } 38 | 39 | public string UnderlyingSymbol { get; set; } 40 | 41 | public string UnderlyingSecurityID { get; set; } 42 | 43 | public string UnderlyingListingExchange { get; set; } 44 | 45 | public string Issuer { get; set; } 46 | 47 | public int? Multiplier { get; set; } 48 | 49 | public double? Strike { get; set; } 50 | 51 | [Format(Constants.DateFormat)] 52 | public DateTime? Expiry { get; set; } 53 | 54 | public PutCall? PutCall { get; set; } 55 | 56 | public string PrincipalAdjustFactor { get; set; } 57 | 58 | //Note: The reportDate XML attribute may contain either a date or a string, i.e. reportDate="MULTI" 59 | public string ReportDate { get; set; } 60 | 61 | public int? Position { get; set; } 62 | 63 | public double? MarkPrice { get; set; } 64 | 65 | public double? PositionValue { get; set; } 66 | 67 | public double? OpenPrice { get; set; } 68 | 69 | public double? CostBasisPrice { get; set; } 70 | 71 | public double? CostBasisMoney { get; set; } 72 | 73 | public double? PercentOfNAV { get; set; } 74 | 75 | public double? FifoPnlUnrealized { get; set; } 76 | 77 | public LongShort? Side { get; set; } 78 | 79 | public string LevelOfDetail { get; set; } 80 | 81 | [Format(Constants.DateTimeFormat)] 82 | public DateTime? OpenDateTime { get; set; } 83 | 84 | [Format(Constants.DateTimeFormat)] 85 | public DateTime? HoldingPeriodDateTime { get; set; } 86 | 87 | public string Code { get; set; } 88 | 89 | public long? OriginatingOrderID { get; set; } 90 | 91 | public long? OriginatingTransactionID { get; set; } 92 | 93 | public double? AccruedInt { get; set; } 94 | } 95 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/OpenPositions.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System.Collections.Generic; 4 | 5 | public class OpenPositions 6 | { 7 | public List OpenPosition { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/OptionEAE.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System; 4 | using IbFlexReader.Contracts.Attributes; 5 | using IbFlexReader.Contracts.Enums; 6 | 7 | public class OptionEAE 8 | { 9 | public string AccountId { get; set; } 10 | 11 | public string AcctAlias { get; set; } 12 | 13 | public string Model { get; set; } 14 | 15 | public Currencies? Currency { get; set; } 16 | 17 | public double? FxRateToBase { get; set; } 18 | 19 | public AssetCategory? AssetCategory { get; set; } 20 | 21 | public string Symbol { get; set; } 22 | 23 | public string Description { get; set; } 24 | 25 | public long? Conid { get; set; } 26 | 27 | public string SecurityID { get; set; } 28 | 29 | public string SecurityIDType { get; set; } 30 | 31 | public string Cusip { get; set; } 32 | 33 | public string Isin { get; set; } 34 | 35 | public string ListingExchange { get; set; } 36 | 37 | public long? UnderlyingConid { get; set; } 38 | 39 | public string UnderlyingSymbol { get; set; } 40 | 41 | public string UnderlyingSecurityID { get; set; } 42 | 43 | public string UnderlyingListingExchange { get; set; } 44 | 45 | public string Issuer { get; set; } 46 | 47 | public int? Multiplier { get; set; } 48 | 49 | public double? Strike { get; set; } 50 | 51 | [Format(Constants.DateFormat)] 52 | public DateTime? Expiry { get; set; } 53 | 54 | public PutCall? PutCall { get; set; } 55 | 56 | public string PrincipalAdjustFactor { get; set; } 57 | 58 | [Format(Constants.DateFormat)] 59 | public DateTime? Date { get; set; } 60 | 61 | public string TransactionType { get; set; } 62 | 63 | public double? Quantity { get; set; } 64 | 65 | public double? TradePrice { get; set; } 66 | 67 | public double? MarkPrice { get; set; } 68 | 69 | public double? Proceeds { get; set; } 70 | 71 | public double? CommisionsAndTax { get; set; } 72 | 73 | public double? CostBasis { get; set; } 74 | 75 | public double? RealizedPnl { get; set; } 76 | 77 | public double? FxPnl { get; set; } 78 | 79 | public double? MtmPnl { get; set; } 80 | 81 | public string TradeID { get; set; } 82 | } 83 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/OptionEAEs.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System.Collections.Generic; 4 | public class OptionEAEs 5 | { 6 | public List OptionEAE { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/Options.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | public class Options 4 | { 5 | public bool SplitUpOpenCloseTrades; 6 | public bool UseXmlReader; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/Order.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | public class Order : Trade 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/PriorPeriodPosition.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System; 4 | using IbFlexReader.Contracts.Attributes; 5 | using IbFlexReader.Contracts.Enums; 6 | 7 | public class PriorPeriodPosition 8 | { 9 | public string AccountId { get; set; } 10 | 11 | public string AcctAlias { get; set; } 12 | 13 | public string Model { get; set; } 14 | 15 | public Currencies? Currency { get; set; } 16 | 17 | public double? FxRateToBase { get; set; } 18 | 19 | public AssetCategory? AssetCategory { get; set; } 20 | 21 | public string Symbol { get; set; } 22 | 23 | public string Description { get; set; } 24 | 25 | public long? Conid { get; set; } 26 | 27 | public string SecurityID { get; set; } 28 | 29 | public string SecurityIDType { get; set; } 30 | 31 | public string Cusip { get; set; } 32 | 33 | public string Isin { get; set; } 34 | 35 | public string ListingExchange { get; set; } 36 | 37 | public long? UnderlyingConid { get; set; } 38 | 39 | public string UnderlyingSymbol { get; set; } 40 | 41 | public string UnderlyingSecurityID { get; set; } 42 | 43 | public string UnderlyingListingExchange { get; set; } 44 | 45 | public string Issuer { get; set; } 46 | 47 | public int? Multiplier { get; set; } 48 | 49 | public double? Strike { get; set; } 50 | 51 | [Format(Constants.DateFormat)] 52 | public DateTime? Expiry { get; set; } 53 | 54 | public PutCall? PutCall { get; set; } 55 | 56 | public string PrincipalAdjustFactor { get; set; } 57 | 58 | [Format(Constants.DateFormat)] 59 | public DateTime? Date { get; set; } 60 | 61 | public double? Price { get; set; } 62 | 63 | public double? PriorMtmPnl { get; set; } 64 | } 65 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/PriorPeriodPositions.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System.Collections.Generic; 4 | 5 | public class PriorPeriodPositions 6 | { 7 | public List PriorPeriodPosition { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/SLBActivities.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System.Collections.Generic; 4 | 5 | public class SLBActivities 6 | { 7 | public List SLBActivity { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/SLBActivity.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System; 4 | using IbFlexReader.Contracts.Attributes; 5 | using IbFlexReader.Contracts.Enums; 6 | 7 | public class SLBActivity 8 | { 9 | public string AccountId { get; set; } 10 | 11 | public string AcctAlias { get; set; } 12 | 13 | public string Model { get; set; } 14 | 15 | public Currencies? Currency { get; set; } 16 | 17 | public double? FxRateToBase { get; set; } 18 | 19 | public AssetCategory? AssetCategory { get; set; } 20 | 21 | public string Symbol { get; set; } 22 | 23 | public string Description { get; set; } 24 | 25 | public long? Conid { get; set; } 26 | 27 | public string SecurityID { get; set; } 28 | 29 | public string SecurityIDType { get; set; } 30 | 31 | public string Cusip { get; set; } 32 | 33 | public string Isin { get; set; } 34 | 35 | public string ListingExchange { get; set; } 36 | 37 | public long? UnderlyingConid { get; set; } 38 | 39 | public string UnderlyingSymbol { get; set; } 40 | 41 | public string UnderlyingSecurityID { get; set; } 42 | 43 | public string UnderlyingListingExchange { get; set; } 44 | 45 | public string Issuer { get; set; } 46 | 47 | public int? Multiplier { get; set; } 48 | 49 | public double? Strike { get; set; } 50 | 51 | [Format(Constants.DateFormat)] 52 | public DateTime? Expiry { get; set; } 53 | 54 | public PutCall? PutCall { get; set; } 55 | 56 | public string PrincipalAdjustFactor { get; set; } 57 | 58 | public string Exchange { get; set; } 59 | 60 | public string Type { get; set; } 61 | 62 | [Format(Constants.DateFormat)] 63 | public DateTime? Date { get; set; } 64 | 65 | public double? MarkCurrentPrice { get; set; } 66 | 67 | public double? MarkPriorPrice { get; set; } 68 | 69 | public double? MarkQuantity { get; set; } 70 | 71 | public double? CollateralAmount { get; set; } 72 | 73 | public string ActivityDescription { get; set; } 74 | 75 | public double? Quantity { get; set; } 76 | 77 | public string SlbTransactionId { get; set; } 78 | } 79 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/SLBFee.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System; 4 | using IbFlexReader.Contracts.Attributes; 5 | using IbFlexReader.Contracts.Enums; 6 | 7 | public class SLBFee 8 | { 9 | public string AccountId { get; set; } 10 | 11 | public string AcctAlias { get; set; } 12 | 13 | public string Model { get; set; } 14 | 15 | public Currencies? Currency { get; set; } 16 | 17 | public double? FxRateToBase { get; set; } 18 | 19 | public AssetCategory? AssetCategory { get; set; } 20 | 21 | public string Symbol { get; set; } 22 | 23 | public string Description { get; set; } 24 | 25 | public long? Conid { get; set; } 26 | 27 | public string SecurityID { get; set; } 28 | 29 | public string SecurityIDType { get; set; } 30 | 31 | public string Cusip { get; set; } 32 | 33 | public string Isin { get; set; } 34 | 35 | public string ListingExchange { get; set; } 36 | 37 | public long? UnderlyingConid { get; set; } 38 | 39 | public string UnderlyingSymbol { get; set; } 40 | 41 | public string UnderlyingSecurityID { get; set; } 42 | 43 | public string UnderlyingListingExchange { get; set; } 44 | 45 | public string Issuer { get; set; } 46 | 47 | public int? Multiplier { get; set; } 48 | 49 | public double? Strike { get; set; } 50 | 51 | [Format(Constants.DateFormat)] 52 | public DateTime? Expiry { get; set; } 53 | 54 | public PutCall? PutCall { get; set; } 55 | 56 | public string PrincipalAdjustFactor { get; set; } 57 | 58 | public string Exchange { get; set; } 59 | 60 | public double? Quantity { get; set; } 61 | 62 | public string Code { get; set; } 63 | 64 | public string ToAcct { get; set; } 65 | 66 | public string FromAcct { get; set; } 67 | 68 | public string Type { get; set; } 69 | 70 | [Format(Constants.DateFormat)] 71 | public DateTime? ValueDate { get; set; } 72 | 73 | public string CollateralAmount { get; set; } 74 | 75 | public string UniqueID { get; set; } 76 | 77 | public double? NetLendFee { get; set; } 78 | 79 | public double? NetLendFeeRate { get; set; } 80 | 81 | public double? GrossLendFee { get; set; } 82 | 83 | public double? MarketFeeRate { get; set; } 84 | 85 | public double? TotalCharges { get; set; } 86 | 87 | public double? TicketCharge { get; set; } 88 | 89 | public double? CarryCharge { get; set; } 90 | 91 | public double? Fee { get; set; } 92 | 93 | public double? FeeRate { get; set; } 94 | 95 | [Format(Constants.DateFormat)] 96 | public DateTime? StartDate { get; set; } 97 | } 98 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/SLBFees.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System.Collections.Generic; 4 | 5 | public class SLBFees 6 | { 7 | public List SLBFee { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/SecuritiesInfo.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System.Collections.Generic; 4 | 5 | public class SecuritiesInfo 6 | { 7 | public List SecurityInfo { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/SecurityInfo.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System; 4 | using IbFlexReader.Contracts.Attributes; 5 | using IbFlexReader.Contracts.Enums; 6 | 7 | public class SecurityInfo 8 | { 9 | public AssetCategory? AssetCategory { get; set; } 10 | 11 | public string Symbol { get; set; } 12 | 13 | public string Description { get; set; } 14 | 15 | public long? Conid { get; set; } 16 | 17 | public string SecurityID { get; set; } 18 | 19 | public string SecurityIDType { get; set; } 20 | 21 | public string Cusip { get; set; } 22 | 23 | public string Isin { get; set; } 24 | 25 | public string ListingExchange { get; set; } 26 | 27 | public long? UnderlyingConid { get; set; } 28 | 29 | public string UnderlyingSymbol { get; set; } 30 | 31 | public string UnderlyingSecurityID { get; set; } 32 | 33 | public string UnderlyingListingExchange { get; set; } 34 | 35 | public string Issuer { get; set; } 36 | 37 | public int? Multiplier { get; set; } 38 | 39 | public double? Strike { get; set; } 40 | 41 | [Format(Constants.DateFormat)] 42 | public DateTime? Expiry { get; set; } 43 | 44 | public PutCall? PutCall { get; set; } 45 | 46 | public string PrincipalAdjustFactor { get; set; } 47 | 48 | public string Maturity { get; set; } 49 | 50 | public string IssueDate { get; set; } 51 | 52 | public string UnderlyingCategory { get; set; } 53 | 54 | public string SubCategory { get; set; } 55 | 56 | public string Code { get; set; } 57 | } 58 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/StatementOfFundsLine.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System; 4 | using IbFlexReader.Contracts.Attributes; 5 | using IbFlexReader.Contracts.Enums; 6 | 7 | public class StatementOfFundsLine 8 | { 9 | public string AccountId { get; set; } 10 | public string AcctAlias { get; set; } 11 | public string ActivityCode { get; set; } 12 | public string ActivityDescription { get; set; } 13 | public double? Amount { get; set; } 14 | public AssetCategory? AssetCategory { get; set; } 15 | public double? Balance { get; set; } 16 | public BuySell? BuySell { get; set; } 17 | public long? Conid { get; set; } 18 | public double? Credit { get; set; } 19 | public Currencies? Currency { get; set; } 20 | public string Cusip { get; set; } 21 | [Format(Constants.DateFormat)] 22 | public DateTime? Date { get; set; } 23 | public double? Debit { get; set; } 24 | public string Description { get; set; } 25 | [Format(Constants.DateFormat)] 26 | public DateTime? Expiry { get; set; } 27 | public double? FxRateToBase { get; set; } 28 | public string Isin { get; set; } 29 | public string Issuer { get; set; } 30 | public string LevelOfDetail { get; set; } 31 | public string ListingExchange { get; set; } 32 | public string Model { get; set; } 33 | public int? Multiplier { get; set; } 34 | public string OrderID { get; set; } 35 | public string PrincipalAdjustFactor { get; set; } 36 | public PutCall? PutCall { get; set; } 37 | [Format(Constants.DateFormat)] 38 | public DateTime? ReportDate { get; set; } 39 | public string SecurityID { get; set; } 40 | public string SecurityIDType { get; set; } 41 | [Format(Constants.DateFormat)] 42 | public DateTime? SettleDate { get; set; } 43 | public double? Strike { get; set; } 44 | public string Symbol { get; set; } 45 | public string TradeCode { get; set; } 46 | public double? TradeCommission { get; set; } 47 | public double? TradeGross { get; set; } 48 | public string TradeID { get; set; } 49 | public double? TradePrice { get; set; } 50 | public double? TradeQuantity { get; set; } 51 | public double? TradeTax { get; set; } 52 | public long? UnderlyingConid { get; set; } 53 | public string UnderlyingListingExchange { get; set; } 54 | public string UnderlyingSecurityID { get; set; } 55 | public string UnderlyingSymbol { get; set; } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/StmtFunds.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System.Collections.Generic; 4 | 5 | public class StmtFunds 6 | { 7 | public List StatementOfFundsLine { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/SymbolSummary.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System; 4 | using IbFlexReader.Contracts.Attributes; 5 | using IbFlexReader.Contracts.Enums; 6 | 7 | public class SymbolSummary : Trade 8 | { 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/TierInterestDetail.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System; 4 | using IbFlexReader.Contracts.Attributes; 5 | using IbFlexReader.Contracts.Enums; 6 | 7 | public class TierInterestDetail 8 | { 9 | public string AccountId { get; set; } 10 | 11 | public string AcctAlias { get; set; } 12 | 13 | public string Model { get; set; } 14 | 15 | public Currencies? Currency { get; set; } 16 | 17 | public double? FxRateToBase { get; set; } 18 | 19 | public string Code { get; set; } 20 | 21 | public string ToAcct { get; set; } 22 | 23 | public string FromAcct { get; set; } 24 | 25 | public double? TotalInterest { get; set; } 26 | 27 | public double? IbuklInterest { get; set; } 28 | 29 | public double? CommoditiesInterest { get; set; } 30 | 31 | public double? SecuritiesInterest { get; set; } 32 | 33 | public double? Rate { get; set; } 34 | 35 | public double? TotalPrincipal { get; set; } 36 | 37 | public double? IbuklPrincipal { get; set; } 38 | 39 | public double? CommoditiesPrincipal { get; set; } 40 | 41 | public double? SecuritiesPrincipal { get; set; } 42 | 43 | public double? BalanceThreshold { get; set; } 44 | 45 | public string TierBreak { get; set; } 46 | 47 | [Format(Constants.DateFormat)] 48 | public DateTime? ValueDate { get; set; } 49 | 50 | public string InterestType { get; set; } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/TierInterestDetails.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System.Collections.Generic; 4 | 5 | public class TierInterestDetails 6 | { 7 | public List TierInterestDetail { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/Trade.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System; 4 | using IbFlexReader.Contracts.Attributes; 5 | using IbFlexReader.Contracts.Enums; 6 | 7 | public class Trade 8 | { 9 | public string AccountId { get; set; } 10 | 11 | public string AcctAlias { get; set; } 12 | 13 | public string Model { get; set; } 14 | 15 | public Currencies? Currency { get; set; } 16 | 17 | public double? FxRateToBase { get; set; } 18 | 19 | public AssetCategory? AssetCategory { get; set; } 20 | 21 | public string Symbol { get; set; } 22 | 23 | public string Description { get; set; } 24 | 25 | public long? Conid { get; set; } 26 | 27 | public string SecurityID { get; set; } 28 | 29 | public string SecurityIDType { get; set; } 30 | 31 | public string Cusip { get; set; } 32 | 33 | public string Isin { get; set; } 34 | 35 | public string ListingExchange { get; set; } 36 | 37 | public long? UnderlyingConid { get; set; } 38 | 39 | public string UnderlyingSymbol { get; set; } 40 | 41 | public string UnderlyingSecurityID { get; set; } 42 | 43 | public string UnderlyingListingExchange { get; set; } 44 | 45 | public string Issuer { get; set; } 46 | 47 | public int? Multiplier { get; set; } 48 | 49 | public double? Strike { get; set; } 50 | 51 | [Format(Constants.DateFormat)] 52 | public DateTime? Expiry { get; set; } 53 | 54 | public long? TradeID { get; set; } 55 | 56 | public PutCall? PutCall { get; set; } 57 | 58 | //Note: The reportDate XML attribute may contain either a date or a string, i.e. reportDate="MULTI" 59 | public string ReportDate { get; set; } 60 | 61 | public string PrincipalAdjustFactor { get; set; } 62 | 63 | [Format(Constants.DateTimeFormat, 0)] 64 | // alternative format 65 | [Format(Constants.DateFormat, 1)] 66 | public DateTime? TradeDateTime { get; set; } 67 | 68 | //Note: The tradeDate XML attribute may contain either a date or a string, i.e. tradeDate="MULTI" 69 | public string TradeDate { get; set; } 70 | 71 | //Note: The settleDateTarget XML attribute may contain either a date or a string, i.e. settleDateTarget="MULTI" 72 | public string SettleDateTarget { get; set; } 73 | 74 | public string TransactionType { get; set; } 75 | 76 | public string Exchange { get; set; } 77 | 78 | public double? Quantity { get; set; } 79 | 80 | public double? TradePrice { get; set; } 81 | 82 | public double? TradeMoney { get; set; } 83 | 84 | public double? Proceeds { get; set; } 85 | 86 | public double? Taxes { get; set; } 87 | 88 | public double? IbCommission { get; set; } 89 | 90 | public Currencies? IbCommissionCurrency { get; set; } 91 | 92 | public double? NetCash { get; set; } 93 | 94 | public double? ClosePrice { get; set; } 95 | 96 | public OpenClose? OpenCloseIndicator { get; set; } 97 | 98 | public Notes? Notes { get; set; } 99 | 100 | public double? Cost { get; set; } 101 | 102 | public double? FifoPnlRealized { get; set; } 103 | 104 | public double? FxPnl { get; set; } 105 | 106 | public double? MtmPnl { get; set; } 107 | 108 | public double? OrigTradePrice { get; set; } 109 | 110 | [Format(Constants.DateFormat)] 111 | public DateTime? OrigTradeDate { get; set; } 112 | 113 | public long? OrigTradeID { get; set; } 114 | 115 | public long? OrigOrderID { get; set; } 116 | 117 | public string ClearingFirmID { get; set; } 118 | 119 | //public string TransactionID { get; set; } 120 | 121 | public BuySell? BuySell { get; set; } 122 | 123 | public long? IbOrderID { get; set; } 124 | 125 | public string IbExecID { get; set; } 126 | 127 | public string BrokerageOrderID { get; set; } 128 | 129 | public string OrderReference { get; set; } 130 | 131 | public string VolatilityOrderLink { get; set; } 132 | 133 | public string ExchOrderId { get; set; } 134 | 135 | public string ExtExecID { get; set; } 136 | 137 | [Format(Constants.DateTimeFormat)] 138 | public DateTime? OrderTime { get; set; } 139 | 140 | [Format(Constants.DateTimeFormat)] 141 | public DateTime? OpenDateTime { get; set; } 142 | 143 | [Format(Constants.DateTimeFormat)] 144 | public DateTime? HoldingPeriodDateTime { get; set; } 145 | 146 | [Format(Constants.DateTimeFormat)] 147 | public DateTime? WhenRealized { get; set; } 148 | 149 | [Format(Constants.DateTimeFormat)] 150 | public DateTime? WhenReopened { get; set; } 151 | 152 | public string LevelOfDetail { get; set; } 153 | 154 | public double? ChangeInPrice { get; set; } 155 | 156 | public double? ChangeInQuantity { get; set; } 157 | 158 | public string OrderType { get; set; } 159 | 160 | public string IsAPIOrder { get; set; } 161 | 162 | public double? AccruedInterest { get; set; } 163 | 164 | public string TraderID { get; set; } 165 | } 166 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/TradeConfirm.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System; 4 | using IbFlexReader.Contracts.Attributes; 5 | using IbFlexReader.Contracts.Enums; 6 | 7 | public class TradeConfirm 8 | { 9 | public string AccountId { get; set; } 10 | 11 | public string AcctAlias { get; set; } 12 | 13 | public string Model { get; set; } 14 | 15 | public Currencies? Currency { get; set; } 16 | 17 | public AssetCategory? AssetCategory { get; set; } 18 | 19 | public string Symbol { get; set; } 20 | 21 | public string Description { get; set; } 22 | 23 | public long? Conid { get; set; } 24 | 25 | public string SecurityID { get; set; } 26 | 27 | public string SecurityIDType { get; set; } 28 | 29 | public string Cusip { get; set; } 30 | 31 | public string Isin { get; set; } 32 | 33 | public string ListingExchange { get; set; } 34 | 35 | public long? UnderlyingConid { get; set; } 36 | 37 | public string UnderlyingSymbol { get; set; } 38 | 39 | public string UnderlyingSecurityID { get; set; } 40 | 41 | public string UnderlyingListingExchange { get; set; } 42 | 43 | public string Issuer { get; set; } 44 | 45 | public int? Multiplier { get; set; } 46 | 47 | public double? Strike { get; set; } 48 | 49 | [Format(Constants.DateFormat)] 50 | public DateTime? Expiry { get; set; } 51 | 52 | public long? TradeID { get; set; } 53 | 54 | public PutCall? PutCall { get; set; } 55 | 56 | //Note: The reportDate XML attribute may contain either a date or a string, i.e. reportDate="MULTI" 57 | public string ReportDate { get; set; } 58 | 59 | [Format(Constants.DateFormat)] 60 | public DateTime? SettleDate { get; set; } 61 | 62 | //Note: The tradeDate XML attribute may contain either a date or a string, i.e. tradeDate="MULTI" 63 | public string TradeDate { get; set; } 64 | 65 | public string PrincipalAdjustFactor { get; set; } 66 | 67 | [Format(Constants.DateTimeFormat)] 68 | [Format(Constants.DateFormat)] 69 | public DateTime? DateTime { get; set; } 70 | 71 | public string TransactionType { get; set; } 72 | 73 | public string Exchange { get; set; } 74 | 75 | public double? Quantity { get; set; } 76 | 77 | public double? Proceeds { get; set; } 78 | 79 | public double? Tax { get; set; } 80 | 81 | public double? Commission { get; set; } 82 | 83 | public Currencies? CommissionCurrency { get; set; } 84 | 85 | public double? Price { get; set; } 86 | 87 | public double? Amount { get; set; } 88 | 89 | public double? OrigTradePrice { get; set; } 90 | 91 | [Format(Constants.DateFormat)] 92 | public DateTime? OrigTradeDate { get; set; } 93 | 94 | public long? OrigTradeID { get; set; } 95 | 96 | public string ClearingFirmID { get; set; } 97 | 98 | public BuySell? BuySell { get; set; } 99 | 100 | public long? OrderID { get; set; } 101 | 102 | public string ExecID { get; set; } 103 | 104 | public string BrokerageOrderID { get; set; } 105 | 106 | public string OrderReference { get; set; } 107 | 108 | public string VolatilityOrderLink { get; set; } 109 | 110 | //public string ExchOrderId { get; set; } 111 | 112 | [Format(Constants.DateTimeFormat)] 113 | public DateTime? OrderTime { get; set; } 114 | 115 | public string LevelOfDetail { get; set; } 116 | 117 | public string OrderType { get; set; } 118 | 119 | public string TraderID { get; set; } 120 | 121 | public string IsAPIOrder { get; set; } 122 | 123 | public Notes? Code { get; set; } 124 | 125 | public double? BrokerExecutionCommission { get; set; } 126 | 127 | public double? BrokerClearingCommission { get; set; } 128 | 129 | public double? ThirdPartyExecutionCommission { get; set; } 130 | 131 | public double? ThirdPartyClearingCommission { get; set; } 132 | 133 | public double? ThirdPartyRegulatoryCommission { get; set; } 134 | 135 | public double? OtherCommission { get; set; } 136 | 137 | public string AllocatedTo { get; set; } 138 | } 139 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/TradeConfirms.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System.Collections.Generic; 4 | 5 | public class TradeConfirms 6 | { 7 | public List TradeConfirm { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/Trades.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System.Collections.Generic; 4 | 5 | public class Trades 6 | { 7 | public List Lot { get; set; } 8 | public List Trade { get; set; } 9 | public List AssetSummary { get; set; } 10 | public List SymbolSummary { get; set; } 11 | public List Order { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/TransactionTax.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System; 4 | using IbFlexReader.Contracts.Attributes; 5 | using IbFlexReader.Contracts.Enums; 6 | 7 | public class TransactionTax 8 | { 9 | public string AccountId { get; set; } 10 | 11 | public string AcctAlias { get; set; } 12 | 13 | public string Model { get; set; } 14 | 15 | public Currencies? Currency { get; set; } 16 | 17 | public double? FxRateToBase { get; set; } 18 | 19 | public AssetCategory? AssetCategory { get; set; } 20 | 21 | public string Symbol { get; set; } 22 | 23 | public string Description { get; set; } 24 | 25 | public long? Conid { get; set; } 26 | 27 | public string SecurityID { get; set; } 28 | 29 | public string SecurityIDType { get; set; } 30 | 31 | public string Cusip { get; set; } 32 | 33 | public string Isin { get; set; } 34 | 35 | public string ListingExchange { get; set; } 36 | 37 | public long? UnderlyingConid { get; set; } 38 | 39 | public string UnderlyingSymbol { get; set; } 40 | 41 | public string UnderlyingSecurityID { get; set; } 42 | 43 | public string UnderlyingListingExchange { get; set; } 44 | 45 | public string Issuer { get; set; } 46 | 47 | public int? Multiplier { get; set; } 48 | 49 | public double? Strike { get; set; } 50 | 51 | [Format(Constants.DateFormat)] 52 | public DateTime? Expiry { get; set; } 53 | 54 | public PutCall? PutCall { get; set; } 55 | 56 | public string PrincipalAdjustFactor { get; set; } 57 | 58 | [Format(Constants.DateFormat)] 59 | public DateTime? Date { get; set; } 60 | 61 | public string TaxDescription { get; set; } 62 | 63 | public double? Quantity { get; set; } 64 | 65 | //Note: The reportDate XML attribute may contain either a date or a string, i.e. reportDate="MULTI" 66 | public string ReportDate { get; set; } 67 | 68 | public double? TaxAmount { get; set; } 69 | 70 | public long? TradeID { get; set; } 71 | 72 | public double? TradePrice { get; set; } 73 | 74 | public string Source { get; set; } 75 | 76 | public string Code { get; set; } 77 | 78 | public string LevelOfDetail { get; set; } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/TransactionTaxes.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System.Collections.Generic; 4 | 5 | public class TransactionTaxes 6 | { 7 | public List TransactionTax { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/Transfer.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System; 4 | using IbFlexReader.Contracts.Attributes; 5 | using IbFlexReader.Contracts.Enums; 6 | 7 | public class Transfer 8 | { 9 | public string AccountId { get; set; } 10 | 11 | public string AcctAlias { get; set; } 12 | 13 | public string Model { get; set; } 14 | 15 | public Currencies? Currency { get; set; } 16 | 17 | public double? FxRateToBase { get; set; } 18 | 19 | public AssetCategory? AssetCategory { get; set; } 20 | 21 | public string Symbol { get; set; } 22 | 23 | public string Description { get; set; } 24 | 25 | public long? Conid { get; set; } 26 | 27 | public string SecurityID { get; set; } 28 | 29 | public string SecurityIDType { get; set; } 30 | 31 | public string Cusip { get; set; } 32 | 33 | public string Isin { get; set; } 34 | 35 | public string ListingExchange { get; set; } 36 | 37 | public long? UnderlyingConid { get; set; } 38 | 39 | public string UnderlyingSymbol { get; set; } 40 | 41 | public string UnderlyingSecurityID { get; set; } 42 | 43 | public string UnderlyingListingExchange { get; set; } 44 | 45 | public string Issuer { get; set; } 46 | 47 | public int? Multiplier { get; set; } 48 | 49 | public double? Strike { get; set; } 50 | 51 | [Format(Constants.DateFormat)] 52 | public DateTime? Expiry { get; set; } 53 | 54 | public PutCall? PutCall { get; set; } 55 | 56 | public string PrincipalAdjustFactor { get; set; } 57 | 58 | //Note: The reportDate XML attribute may contain either a date or a string, i.e. reportDate="MULTI" 59 | public string ReportDate { get; set; } 60 | 61 | [Format(Constants.DateFormat)] 62 | public DateTime? Date { get; set; } 63 | 64 | [Format(Constants.DateTimeFormat, 0)] 65 | // alternative format 66 | [Format(Constants.DateFormat, 1)] 67 | public DateTime? TradeDateTime { get; set; } 68 | 69 | public string Type { get; set; } 70 | 71 | public string Direction { get; set; } 72 | 73 | public string Company { get; set; } 74 | 75 | public string Account { get; set; } 76 | 77 | public string AccountName { get; set; } 78 | 79 | public double? Quantity { get; set; } 80 | 81 | public double? TransferPrice { get; set; } 82 | 83 | public double? PositionAmount { get; set; } 84 | 85 | public double? PositionAmountInBase { get; set; } 86 | 87 | public double? PnlAmount { get; set; } 88 | 89 | public double? PnlAmountInBase { get; set; } 90 | 91 | public double? FxPnl { get; set; } 92 | 93 | public double? CashTransfer { get; set; } 94 | 95 | public string Code { get; set; } 96 | 97 | public string ClientReference { get; set; } 98 | 99 | public long? TransactionID { get; set; } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/Transfers.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System.Collections.Generic; 4 | public class Transfers 5 | { 6 | public List Transfer { get; set; } 7 | } 8 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/UnbundledCommissionDetail.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System; 4 | using IbFlexReader.Contracts.Attributes; 5 | using IbFlexReader.Contracts.Enums; 6 | 7 | public class UnbundledCommissionDetail 8 | { 9 | public string AccountId { get; set; } 10 | 11 | public string AcctAlias { get; set; } 12 | 13 | public double? Quantity { get; set; } 14 | 15 | public string PrincipalAdjustFactor { get; set; } 16 | 17 | public PutCall? PutCall { get; set; } 18 | 19 | public string Issuer { get; set; } 20 | 21 | public int? Multiplier { get; set; } 22 | 23 | public double? Strike { get; set; } 24 | 25 | [Format(Constants.DateFormat)] 26 | public DateTime? Expiry { get; set; } 27 | 28 | public AssetCategory? AssetCategory { get; set; } 29 | 30 | public string Symbol { get; set; } 31 | 32 | public string Description { get; set; } 33 | 34 | public long? Conid { get; set; } 35 | 36 | public string SecurityID { get; set; } 37 | 38 | public string SecurityIDType { get; set; } 39 | 40 | public string Cusip { get; set; } 41 | 42 | public string Isin { get; set; } 43 | 44 | public string ListingExchange { get; set; } 45 | 46 | public long? UnderlyingConid { get; set; } 47 | 48 | public string UnderlyingSymbol { get; set; } 49 | 50 | public string UnderlyingSecurityID { get; set; } 51 | 52 | public string UnderlyingListingExchange { get; set; } 53 | 54 | public string OrderReference { get; set; } 55 | 56 | public BuySell? BuySell { get; set; } 57 | 58 | public string Exchange { get; set; } 59 | 60 | public string DateTime { get; set; } 61 | 62 | public string TradeID { get; set; } 63 | 64 | public string Model { get; set; } 65 | 66 | public Currencies? Currency { get; set; } 67 | 68 | public double? FxRateToBase { get; set; } 69 | 70 | public string Other { get; set; } 71 | 72 | public string RegOther { get; set; } 73 | 74 | public double? RegSection31TransactionFee { get; set; } 75 | 76 | public double? RegFINRATradingActivityFee { get; set; } 77 | 78 | public double? ThirdPartyRegulatoryCharge { get; set; } 79 | 80 | public double? ThirdPartyClearingCharge { get; set; } 81 | 82 | public double? ThirdPartyExecutionCharge { get; set; } 83 | 84 | public double? BrokerClearingCharge { get; set; } 85 | 86 | public double? BrokerExecutionCharge { get; set; } 87 | 88 | public double? TotalCommission { get; set; } 89 | 90 | public double? Price { get; set; } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/Ib/UnbundledCommissionDetails.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Contracts.Ib 2 | { 3 | using System.Collections.Generic; 4 | 5 | public class UnbundledCommissionDetails 6 | { 7 | public List UnbundledCommissionDetail { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Contracts/IbFlexReader.Contracts.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | IbFlexReader.Contracts 6 | False 7 | ./../stylecop.ruleset 8 | 9 | 10 | 11 | true 12 | 13 | 14 | 15 | 16 | 17 | all 18 | runtime; build; native; contentfiles; analyzers 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Tests/Contracts/NotesTest.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Tests.Contracts 2 | { 3 | using System; 4 | using System.Linq; 5 | using FluentAssertions; 6 | using IbFlexReader.Contracts.Enums; 7 | using NUnit.Framework; 8 | 9 | public class NotesTest 10 | { 11 | [Test] 12 | public void TestDifferentCombinations() 13 | { 14 | var notes = Notes.AdjustedLossWashSale | Notes.Adjustment | Notes.ArrangedByIB | Notes.CrossTrade | Notes.RedemptionToInvestor; 15 | EnsureEverythingIsEmpty(notes, Notes.AdjustedLossWashSale, Notes.Adjustment, Notes.ArrangedByIB, Notes.CrossTrade, Notes.RedemptionToInvestor); 16 | notes.HasFlag(Notes.AdjustedLossWashSale).Should().BeTrue(); 17 | notes.HasFlag(Notes.Adjustment).Should().BeTrue(); 18 | notes.HasFlag(Notes.ArrangedByIB).Should().BeTrue(); 19 | notes.HasFlag(Notes.CrossTrade).Should().BeTrue(); 20 | notes.HasFlag(Notes.RedemptionToInvestor).Should().BeTrue(); 21 | } 22 | 23 | private void EnsureEverythingIsEmpty(Notes combined, params Notes[] except) 24 | { 25 | Enum.GetValues(typeof(Notes)).Cast() 26 | .Where(x => except.All(ex => ex != x)).ToList() 27 | .ForEach(note => { combined.HasFlag(note).Should().BeFalse($"{combined} should not have flag {note}"); }); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // Allgemeine Informationen über eine Assembly werden über die folgenden 5 | // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, 6 | // die einer Assembly zugeordnet sind. 7 | [assembly: AssemblyTitle("IbFlexReader.Tests")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("IbFlexReader.Tests")] 12 | [assembly: AssemblyCopyright("Copyright © 2018")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly 17 | // für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von 18 | // COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. 19 | [assembly: ComVisible(false)] 20 | 21 | // Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird 22 | [assembly: Guid("a50c11a7-f1ad-4741-a22f-9941e8cc4ffb")] 23 | 24 | // Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: 25 | // 26 | // Hauptversion 27 | // Nebenversion 28 | // Buildnummer 29 | // Revision 30 | // 31 | // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, 32 | // indem Sie "*" wie unten gezeigt eingeben: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Tests/ReaderTests.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Tests 2 | { 3 | using System.IO; 4 | using System.Linq; 5 | using IbFlexReader.Tests.XmlFileTest; 6 | using NUnit.Framework; 7 | 8 | public class ReaderTests 9 | { 10 | // fill with proper values to run the tests 11 | private readonly string queryId = string.Empty; 12 | private readonly string token = string.Empty; 13 | 14 | [Test] 15 | public void GetByApi() 16 | { 17 | Assert.Inconclusive("add valid queryID and token to run this test"); 18 | var result = new Reader().GetByApi(token, queryId, @"c:\Tests\Dump.xml"); 19 | result.Wait(); 20 | Assert.IsNotNull(result); 21 | } 22 | 23 | [Test] 24 | public void GetByString() 25 | { 26 | //Arrange 27 | var tfh = new TestFileHelper(); 28 | var stringCol = tfh.ConvertXmlToString(tfh.GetXmlFiles()); 29 | var result = new Reader(); 30 | var fQR = new IbFlexReader.Contracts.FlexQueryResponse(); 31 | 32 | //Act 33 | 34 | foreach (var file in stringCol) 35 | { 36 | fQR = result.GetByString(file); 37 | //Assert 38 | Assert.NotNull(fQR); 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Tests/Utils/DumpFileWriterTest.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Tests.Utils 2 | { 3 | using System; 4 | using FluentAssertions; 5 | using IbFlexReader.Utils; 6 | using NUnit.Framework; 7 | 8 | public class DumpFileWriterTest 9 | { 10 | [Test] 11 | public void ToDumpFilename() 12 | { 13 | string f = DumpFileWriter.ToDumpFilename(@"c:\Test\Dump.xml", "1"); 14 | f.Should().Be(@"c:\Test\Dump.1.xml"); 15 | 16 | f = DumpFileWriter.ToDumpFilename(@"c:\Test\a\b\c\Dump.xml", "123"); 17 | f.Should().Be(@"c:\Test\a\b\c\Dump.123.xml"); 18 | 19 | f = DumpFileWriter.ToDumpFilename(@"c:\Dump.xml", "a"); 20 | f.Should().Be(@"c:\Dump.a.xml"); 21 | 22 | f = DumpFileWriter.ToDumpFilename(@"c:\Test\Dump", "1"); 23 | f.Should().Be(@"c:\Test\Dump.1"); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Tests/Utils/UtilsTest.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Tests.Utils 2 | { 3 | using System.Collections.Generic; 4 | using FluentAssertions; 5 | using IbFlexReader.Contracts; 6 | using IbFlexReader.Utils; 7 | using NUnit.Framework; 8 | using Contracts = IbFlexReader.Contracts; 9 | 10 | public class UtilsTest 11 | { 12 | [Test] 13 | public void PopulateFrom_AllowDateTimeWithTime() 14 | { 15 | var cashTransactionXml = new IbFlexReader.Xml.Contracts.QueryResponse.CashTransaction(); 16 | cashTransactionXml.DateTime = "20180305;202000"; 17 | var dto = new Contracts.Ib.CashTransaction(); 18 | var mesg = new List(); 19 | dto.PopulateFrom(cashTransactionXml, mesg); 20 | mesg.Should().BeEmpty(); 21 | dto.DateTime.Should().NotBeNull(); 22 | } 23 | 24 | [Test] 25 | public void PopulateFrom_AllowDateTimeWothoutTime() 26 | { 27 | var cashTransactionXml = new IbFlexReader.Xml.Contracts.QueryResponse.CashTransaction(); 28 | cashTransactionXml.DateTime = "20180305"; 29 | var dto = new Contracts.Ib.CashTransaction(); 30 | var mesg = new List(); 31 | dto.PopulateFrom(cashTransactionXml, mesg); 32 | mesg.Should().BeEmpty(); 33 | dto.DateTime.Should().NotBeNull(); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Tests/Xml/CashTransactionTest.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Tests.Xml 2 | { 3 | using FluentAssertions; 4 | using IbFlexReader.Xml; 5 | using NUnit.Framework; 6 | using Contracts = IbFlexReader.Contracts; 7 | using FlexQueryResponse = IbFlexReader.Xml.Contracts.QueryResponse.FlexQueryResponse; 8 | 9 | public class CashTransactionTest 10 | { 11 | private IStreamBuilder streamBuilder; 12 | 13 | [SetUp] 14 | public void InitTests() 15 | { 16 | streamBuilder = new StringStream(); 17 | } 18 | 19 | [Test] 20 | public void BrokerInterestReceived() 21 | { 22 | var str = StringFactory.XmlStart + @" 23 | 24 | " + StringFactory.XmlEnd; 25 | var obj = Deserializer.Deserialize(streamBuilder.GenerateStream(str), out var msg); 26 | var cashTransactions = obj.FlexStatements.FlexStatement[0].CashTransactions.CashTransaction; 27 | cashTransactions.Count.Should().Be(1); 28 | cashTransactions[0].Type.Should().Be(Contracts.Enums.CashTransactionType.BrokerInterestReceived); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Tests/Xml/StatementOfFundsTest.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Tests.Xml 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using FluentAssertions; 9 | using IbFlexReader.Contracts.Enums; 10 | using IbFlexReader.Tests.XmlFileTest; 11 | using NUnit.Framework; 12 | 13 | public class StatementOfFundsTest 14 | { 15 | [Test] 16 | public void StatementOfFunds() 17 | { 18 | var file = new TestFileHelper().ReadXmlFiles("StatementOfFunds").Single(); 19 | var response = new Reader().GetByString(file); 20 | var anyEntry = response.FlexStatements.FlexStatement[0].StatementOfFunds.StatementOfFundsLine.First(x => x.TradeID == "554955532"); 21 | anyEntry.ActivityDescription.Should().Be("Buy 1 XSP 05DEC18 270.0 C "); 22 | anyEntry.BuySell.Should().Be(BuySell.BUY); 23 | anyEntry.TradePrice.Should().Be(14.2); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Tests/Xml/StringFactory.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Tests.Xml 2 | { 3 | public static class StringFactory 4 | { 5 | public static string XmlStart = @" 6 | 7 | 8 | "; 9 | public static string XmlEnd = @" 10 | 11 | "; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Tests/XmlFileTest/TestFileHelper.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Tests.XmlFileTest 2 | { 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Reflection; 7 | using System.Text.RegularExpressions; 8 | using System.Xml; 9 | 10 | public class TestFileHelper 11 | { 12 | public IList XmlTestFiles { get; set; } = new List(); 13 | public IList ConvertedXml { get; set; } = new List(); 14 | 15 | public string TestFilePath { get; set; } 16 | public string SlnPath { get; set; } 17 | 18 | public string GetTestFilePath() 19 | { 20 | string ext = @"/IbFlexReader.Tests/bin/Release/XmlFileTest/TestFiles"; 21 | 22 | var slnpath = GetSlnPath(); 23 | 24 | TestFilePath = Path.GetFullPath(slnpath + ext).Trim(); 25 | 26 | return TestFilePath; 27 | } 28 | 29 | public string GetSlnPath() 30 | { 31 | var exePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); 32 | var parrent1 = Directory.GetParent(exePath).ToString(); 33 | var parrent2 = Directory.GetParent(parrent1).ToString(); 34 | var slnPath = Directory.GetParent(parrent2).ToString(); 35 | 36 | return slnPath; 37 | } 38 | 39 | public IList ReadXmlFiles(string name) 40 | { 41 | var xml = GetXmlFiles(name); 42 | return ConvertXmlToString(xml); 43 | } 44 | 45 | public IList GetXmlFiles(string namePattern = null) 46 | { 47 | foreach (string file in Directory.GetFiles(GetTestFilePath(), "*.xml").Where(x => new Regex($".*{namePattern}.*").IsMatch(x))) 48 | { 49 | XmlDocument doc = new XmlDocument(); 50 | doc.Load(file); 51 | XmlTestFiles.Add(doc); 52 | } 53 | 54 | return XmlTestFiles; 55 | } 56 | 57 | public IList ConvertXmlToString(IList xmlTestFiles) 58 | { 59 | foreach (XmlDocument file in xmlTestFiles) 60 | { 61 | var newfile = file.InnerXml.ToString(); 62 | ConvertedXml.Add(newfile); 63 | } 64 | 65 | return ConvertedXml; 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Tests/XmlFileTest/TestFileHelperTests.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Tests.XmlFileTest 2 | { 3 | using NUnit.Framework; 4 | 5 | public class TestFileHelperTests 6 | { 7 | private TestFileHelper tfh; 8 | 9 | [SetUp] 10 | public void InitTests() 11 | { 12 | tfh = new TestFileHelper(); 13 | } 14 | 15 | [Test] 16 | public void GetSlnPathTest() 17 | { 18 | // Arrange 19 | bool check = false; 20 | string exp = @"ib-flex-reader\IbFlexReader"; 21 | 22 | // Act 23 | var path = tfh.GetSlnPath().Replace("/", "\\"); 24 | if (path.Contains(exp)) 25 | { 26 | check = true; 27 | } 28 | 29 | // Assert 30 | Assert.IsTrue(check, $"exp: {exp}, current: {path}"); 31 | } 32 | 33 | [Test] 34 | public void GetTestFilePathTest() 35 | { 36 | // Arrange 37 | string exp = @"\ib-flex-reader\IbFlexReader\IbFlexReader.Tests\bin\Release\XmlFileTest\TestFiles"; 38 | bool check = false; 39 | 40 | // Act 41 | var path = tfh.GetTestFilePath().Replace("/", "\\"); 42 | 43 | // Assert 44 | if (path.Contains(exp)) 45 | { 46 | check = true; 47 | } 48 | 49 | Assert.True(check, $"exp: {exp}, current: {path}"); 50 | } 51 | 52 | [Test] 53 | public void GetTestFilesTest() 54 | { 55 | // Arrange 56 | int xmlsInPath = 2; 57 | 58 | //Act 59 | var xfiles = tfh.GetXmlFiles().Count; 60 | 61 | //Assert 62 | Assert.AreEqual(xmlsInPath, xfiles); 63 | } 64 | 65 | [Test] 66 | public void ConvertXmlStringTest() 67 | { 68 | // Arrange 69 | var xmlStart = @" 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Utils/DumpFileWriter.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Utils 2 | { 3 | using System; 4 | using System.IO; 5 | 6 | public static class DumpFileWriter 7 | { 8 | public static void DumpSendRequest(Stream stream, string filename) 9 | { 10 | filename = ToDumpFilename(filename, "1"); 11 | DumpStream(stream, filename); 12 | } 13 | 14 | public static void DumpGetStatement(Stream stream, string filename) 15 | { 16 | filename = ToDumpFilename(filename, "2"); 17 | DumpStream(stream, filename); 18 | } 19 | 20 | /// 21 | /// Insert the token between filename and extension. 22 | /// 23 | /// 24 | /// 25 | /// 26 | public static string ToDumpFilename(string filename, string token) 27 | { 28 | string path = Path.GetDirectoryName(filename); 29 | 30 | string extension = Path.GetExtension(filename); 31 | string file = Path.GetFileNameWithoutExtension(filename); 32 | 33 | filename = Path.Combine(path, string.Concat(file, ".", token, extension)); 34 | 35 | return filename; 36 | } 37 | 38 | public static void DumpStream(Stream stream, string filename) 39 | { 40 | using (StreamReader w = new StreamReader(stream, System.Text.Encoding.Default, false, 1024, true)) 41 | { 42 | File.WriteAllText(filename, w.ReadToEnd()); 43 | stream.Seek(0, SeekOrigin.Begin); 44 | } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Utils/IbFlexReader.Utils.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | False 6 | ./../stylecop.ruleset 7 | 8 | 9 | 10 | true 11 | 12 | 13 | 14 | 15 | 16 | all 17 | runtime; build; native; contentfiles; analyzers 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Utils/ObjectExtension.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Utils 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | 8 | public static class ObjectExtension 9 | { 10 | public static bool Matches(this T t, Func fn) 11 | { 12 | return fn(t); 13 | } 14 | 15 | public static T Clone(this T from) where T : new() 16 | { 17 | var type = typeof(T); 18 | var newT = new T(); 19 | 20 | foreach (var prop in type.GetProperties().Where(x => x.SetMethod != null)) 21 | { 22 | prop.SetValue(newT, prop.GetValue(from)); 23 | } 24 | 25 | return newT; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/AccountInformation.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 3 | 4 | http://www.apache.org/licenses/LICENSE-2.0 5 | 6 | https://xmltocsharp.azurewebsites.net/ 7 | */ 8 | 9 | namespace IbFlexReader.Xml.Contracts.QueryResponse 10 | { 11 | using System.Xml.Serialization; 12 | 13 | [XmlRoot(ElementName = "AccountInformation")] 14 | public class AccountInformation 15 | { 16 | [XmlAttribute(AttributeName = "accountId")] 17 | public string AccountId { get; set; } 18 | 19 | [XmlAttribute(AttributeName = "acctAlias")] 20 | public string AcctAlias { get; set; } 21 | 22 | [XmlAttribute(AttributeName = "model")] 23 | public string Model { get; set; } 24 | 25 | [XmlAttribute(AttributeName = "currency")] 26 | public string Currency { get; set; } 27 | 28 | [XmlAttribute(AttributeName = "name")] 29 | public string Name { get; set; } 30 | 31 | [XmlAttribute(AttributeName = "accountType")] 32 | public string AccountType { get; set; } 33 | 34 | [XmlAttribute(AttributeName = "customerType")] 35 | public string CustomerType { get; set; } 36 | 37 | [XmlAttribute(AttributeName = "accountCapabilities")] 38 | public string AccountCapabilities { get; set; } 39 | 40 | [XmlAttribute(AttributeName = "tradingPermissions")] 41 | public string TradingPermissions { get; set; } 42 | 43 | [XmlAttribute(AttributeName = "registeredRepName")] 44 | public string RegisteredRepName { get; set; } 45 | 46 | [XmlAttribute(AttributeName = "registeredRepPhone")] 47 | public string RegisteredRepPhone { get; set; } 48 | 49 | [XmlAttribute(AttributeName = "dateOpened")] 50 | public string DateOpened { get; set; } 51 | 52 | [XmlAttribute(AttributeName = "dateFunded")] 53 | public string DateFunded { get; set; } 54 | 55 | [XmlAttribute(AttributeName = "dateClosed")] 56 | public string DateClosed { get; set; } 57 | 58 | [XmlAttribute(AttributeName = "street")] 59 | public string Street { get; set; } 60 | 61 | [XmlAttribute(AttributeName = "street2")] 62 | public string Street2 { get; set; } 63 | 64 | [XmlAttribute(AttributeName = "city")] 65 | public string City { get; set; } 66 | 67 | [XmlAttribute(AttributeName = "state")] 68 | public string State { get; set; } 69 | 70 | [XmlAttribute(AttributeName = "country")] 71 | public string Country { get; set; } 72 | 73 | [XmlAttribute(AttributeName = "postalCode")] 74 | public string PostalCode { get; set; } 75 | 76 | [XmlAttribute(AttributeName = "streetResidentialAddress")] 77 | public string StreetResidentialAddress { get; set; } 78 | 79 | [XmlAttribute(AttributeName = "street2ResidentialAddress")] 80 | public string Street2ResidentialAddress { get; set; } 81 | 82 | [XmlAttribute(AttributeName = "cityResidentialAddress")] 83 | public string CityResidentialAddress { get; set; } 84 | 85 | [XmlAttribute(AttributeName = "stateResidentialAddress")] 86 | public string StateResidentialAddress { get; set; } 87 | 88 | [XmlAttribute(AttributeName = "countryResidentialAddress")] 89 | public string CountryResidentialAddress { get; set; } 90 | 91 | [XmlAttribute(AttributeName = "postalCodeResidentialAddress")] 92 | public string PostalCodeResidentialAddress { get; set; } 93 | 94 | [XmlAttribute(AttributeName = "masterName")] 95 | public string MasterName { get; set; } 96 | 97 | [XmlAttribute(AttributeName = "ibEntity")] 98 | public string IbEntity { get; set; } 99 | 100 | [XmlAttribute(AttributeName = "primaryEmail")] 101 | public string PrimaryEmail { get; set; } 102 | } 103 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/CFDCharge.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Xml.Serialization; 4 | 5 | [XmlRoot(ElementName = "CFDCharge")] 6 | public class CFDCharge 7 | { 8 | [XmlAttribute(AttributeName = "accountId")] 9 | public string AccountId { get; set; } 10 | 11 | [XmlAttribute(AttributeName = "acctAlias")] 12 | public string AcctAlias { get; set; } 13 | 14 | [XmlAttribute(AttributeName = "model")] 15 | public string Model { get; set; } 16 | 17 | [XmlAttribute(AttributeName = "currency")] 18 | public string Currency { get; set; } 19 | 20 | [XmlAttribute(AttributeName = "fxRateToBase")] 21 | public string FxRateToBase { get; set; } 22 | 23 | [XmlAttribute(AttributeName = "assetCategory")] 24 | public string AssetCategory { get; set; } 25 | 26 | [XmlAttribute(AttributeName = "symbol")] 27 | public string Symbol { get; set; } 28 | 29 | [XmlAttribute(AttributeName = "description")] 30 | public string Description { get; set; } 31 | 32 | [XmlAttribute(AttributeName = "conid")] 33 | public string Conid { get; set; } 34 | 35 | [XmlAttribute(AttributeName = "securityID")] 36 | public string SecurityID { get; set; } 37 | 38 | [XmlAttribute(AttributeName = "securityIDType")] 39 | public string SecurityIDType { get; set; } 40 | 41 | [XmlAttribute(AttributeName = "cusip")] 42 | public string Cusip { get; set; } 43 | 44 | [XmlAttribute(AttributeName = "isin")] 45 | public string Isin { get; set; } 46 | 47 | [XmlAttribute(AttributeName = "listingExchange")] 48 | public string ListingExchange { get; set; } 49 | 50 | [XmlAttribute(AttributeName = "underlyingConid")] 51 | public string UnderlyingConid { get; set; } 52 | 53 | [XmlAttribute(AttributeName = "underlyingSymbol")] 54 | public string UnderlyingSymbol { get; set; } 55 | 56 | [XmlAttribute(AttributeName = "underlyingSecurityID")] 57 | public string UnderlyingSecurityID { get; set; } 58 | 59 | [XmlAttribute(AttributeName = "underlyingListingExchange")] 60 | public string UnderlyingListingExchange { get; set; } 61 | 62 | [XmlAttribute(AttributeName = "issuer")] 63 | public string Issuer { get; set; } 64 | 65 | [XmlAttribute(AttributeName = "multiplier")] 66 | public string Multiplier { get; set; } 67 | 68 | [XmlAttribute(AttributeName = "strike")] 69 | public string Strike { get; set; } 70 | 71 | [XmlAttribute(AttributeName = "expiry")] 72 | public string Expiry { get; set; } 73 | 74 | [XmlAttribute(AttributeName = "putCall")] 75 | public string PutCall { get; set; } 76 | 77 | [XmlAttribute(AttributeName = "principalAdjustFactor")] 78 | public string PrincipalAdjustFactor { get; set; } 79 | 80 | [XmlAttribute(AttributeName = "date")] 81 | public string Date { get; set; } 82 | 83 | [XmlAttribute(AttributeName = "received")] 84 | public string Received { get; set; } 85 | 86 | [XmlAttribute(AttributeName = "paid")] 87 | public string Paid { get; set; } 88 | 89 | [XmlAttribute(AttributeName = "total")] 90 | public string Total { get; set; } 91 | 92 | [XmlAttribute(AttributeName = "transactionID")] 93 | public string TransactionID { get; set; } 94 | } 95 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/CFDCharges.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Collections.Generic; 4 | using System.Xml.Serialization; 5 | 6 | [XmlRoot(ElementName = "CFDCharges")] 7 | public class CFDCharges 8 | { 9 | [XmlElement(ElementName = "CFDCharge")] 10 | public List CFDCharge { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/CashTransaction.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Xml.Serialization; 4 | 5 | [XmlRoot(ElementName = "CashTransaction")] 6 | public class CashTransaction 7 | { 8 | [XmlAttribute(AttributeName = "accountId")] 9 | public string AccountId { get; set; } 10 | 11 | [XmlAttribute(AttributeName = "acctAlias")] 12 | public string AcctAlias { get; set; } 13 | 14 | [XmlAttribute(AttributeName = "model")] 15 | public string Model { get; set; } 16 | 17 | [XmlAttribute(AttributeName = "currency")] 18 | public string Currency { get; set; } 19 | 20 | [XmlAttribute(AttributeName = "fxRateToBase")] 21 | public string FxRateToBase { get; set; } 22 | 23 | [XmlAttribute(AttributeName = "assetCategory")] 24 | public string AssetCategory { get; set; } 25 | 26 | [XmlAttribute(AttributeName = "symbol")] 27 | public string Symbol { get; set; } 28 | 29 | [XmlAttribute(AttributeName = "description")] 30 | public string Description { get; set; } 31 | 32 | [XmlAttribute(AttributeName = "conid")] 33 | public string Conid { get; set; } 34 | 35 | [XmlAttribute(AttributeName = "securityID")] 36 | public string SecurityID { get; set; } 37 | 38 | [XmlAttribute(AttributeName = "securityIDType")] 39 | public string SecurityIDType { get; set; } 40 | 41 | [XmlAttribute(AttributeName = "cusip")] 42 | public string Cusip { get; set; } 43 | 44 | [XmlAttribute(AttributeName = "isin")] 45 | public string Isin { get; set; } 46 | 47 | [XmlAttribute(AttributeName = "listingExchange")] 48 | public string ListingExchange { get; set; } 49 | 50 | [XmlAttribute(AttributeName = "underlyingConid")] 51 | public string UnderlyingConid { get; set; } 52 | 53 | [XmlAttribute(AttributeName = "underlyingSymbol")] 54 | public string UnderlyingSymbol { get; set; } 55 | 56 | [XmlAttribute(AttributeName = "underlyingSecurityID")] 57 | public string UnderlyingSecurityID { get; set; } 58 | 59 | [XmlAttribute(AttributeName = "underlyingListingExchange")] 60 | public string UnderlyingListingExchange { get; set; } 61 | 62 | [XmlAttribute(AttributeName = "issuer")] 63 | public string Issuer { get; set; } 64 | 65 | [XmlAttribute(AttributeName = "multiplier")] 66 | public string Multiplier { get; set; } 67 | 68 | [XmlAttribute(AttributeName = "strike")] 69 | public string Strike { get; set; } 70 | 71 | [XmlAttribute(AttributeName = "expiry")] 72 | public string Expiry { get; set; } 73 | 74 | [XmlAttribute(AttributeName = "putCall")] 75 | public string PutCall { get; set; } 76 | 77 | [XmlAttribute(AttributeName = "principalAdjustFactor")] 78 | public string PrincipalAdjustFactor { get; set; } 79 | 80 | [XmlAttribute(AttributeName = "dateTime")] 81 | public string DateTime { get; set; } 82 | 83 | [XmlAttribute(AttributeName = "amount")] 84 | public string Amount { get; set; } 85 | 86 | [XmlAttribute(AttributeName = "type")] 87 | public string Type { get; set; } 88 | 89 | [XmlAttribute(AttributeName = "tradeID")] 90 | public string TradeID { get; set; } 91 | 92 | [XmlAttribute(AttributeName = "code")] 93 | public string Code { get; set; } 94 | 95 | [XmlAttribute(AttributeName = "transactionID")] 96 | public string TransactionID { get; set; } 97 | 98 | [XmlAttribute(AttributeName = "reportDate")] 99 | public string ReportDate { get; set; } 100 | 101 | [XmlAttribute(AttributeName = "clientReference")] 102 | public string ClientReference { get; set; } 103 | 104 | [XmlAttribute(AttributeName = "settleDate")] 105 | public string SettleDate { get; set; } 106 | } 107 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/CashTransactions.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Collections.Generic; 4 | using System.Xml.Serialization; 5 | 6 | [XmlRoot(ElementName = "CashTransactions")] 7 | public class CashTransactions 8 | { 9 | [XmlElement(ElementName = "CashTransaction")] 10 | public List CashTransaction { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/ChangeInDividendAccrual.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Xml.Serialization; 4 | 5 | [XmlRoot(ElementName = "ChangeInDividendAccrual")] 6 | public class ChangeInDividendAccrual 7 | { 8 | [XmlAttribute(AttributeName = "accountId")] 9 | public string AccountId { get; set; } 10 | 11 | [XmlAttribute(AttributeName = "acctAlias")] 12 | public string AcctAlias { get; set; } 13 | 14 | [XmlAttribute(AttributeName = "model")] 15 | public string Model { get; set; } 16 | 17 | [XmlAttribute(AttributeName = "currency")] 18 | public string Currency { get; set; } 19 | 20 | [XmlAttribute(AttributeName = "fxRateToBase")] 21 | public string FxRateToBase { get; set; } 22 | 23 | [XmlAttribute(AttributeName = "assetCategory")] 24 | public string AssetCategory { get; set; } 25 | 26 | [XmlAttribute(AttributeName = "symbol")] 27 | public string Symbol { get; set; } 28 | 29 | [XmlAttribute(AttributeName = "description")] 30 | public string Description { get; set; } 31 | 32 | [XmlAttribute(AttributeName = "conid")] 33 | public string Conid { get; set; } 34 | 35 | [XmlAttribute(AttributeName = "securityID")] 36 | public string SecurityID { get; set; } 37 | 38 | [XmlAttribute(AttributeName = "securityIDType")] 39 | public string SecurityIDType { get; set; } 40 | 41 | [XmlAttribute(AttributeName = "cusip")] 42 | public string Cusip { get; set; } 43 | 44 | [XmlAttribute(AttributeName = "isin")] 45 | public string Isin { get; set; } 46 | 47 | [XmlAttribute(AttributeName = "listingExchange")] 48 | public string ListingExchange { get; set; } 49 | 50 | [XmlAttribute(AttributeName = "underlyingConid")] 51 | public string UnderlyingConid { get; set; } 52 | 53 | [XmlAttribute(AttributeName = "underlyingSymbol")] 54 | public string UnderlyingSymbol { get; set; } 55 | 56 | [XmlAttribute(AttributeName = "underlyingSecurityID")] 57 | public string UnderlyingSecurityID { get; set; } 58 | 59 | [XmlAttribute(AttributeName = "underlyingListingExchange")] 60 | public string UnderlyingListingExchange { get; set; } 61 | 62 | [XmlAttribute(AttributeName = "issuer")] 63 | public string Issuer { get; set; } 64 | 65 | [XmlAttribute(AttributeName = "multiplier")] 66 | public string Multiplier { get; set; } 67 | 68 | [XmlAttribute(AttributeName = "strike")] 69 | public string Strike { get; set; } 70 | 71 | [XmlAttribute(AttributeName = "expiry")] 72 | public string Expiry { get; set; } 73 | 74 | [XmlAttribute(AttributeName = "putCall")] 75 | public string PutCall { get; set; } 76 | 77 | [XmlAttribute(AttributeName = "principalAdjustFactor")] 78 | public string PrincipalAdjustFactor { get; set; } 79 | 80 | [XmlAttribute(AttributeName = "reportDate")] 81 | public string ReportDate { get; set; } 82 | 83 | [XmlAttribute(AttributeName = "date")] 84 | public string Date { get; set; } 85 | 86 | [XmlAttribute(AttributeName = "exDate")] 87 | public string ExDate { get; set; } 88 | 89 | [XmlAttribute(AttributeName = "payDate")] 90 | public string PayDate { get; set; } 91 | 92 | [XmlAttribute(AttributeName = "quantity")] 93 | public string Quantity { get; set; } 94 | 95 | [XmlAttribute(AttributeName = "tax")] 96 | public string Tax { get; set; } 97 | 98 | [XmlAttribute(AttributeName = "fee")] 99 | public string Fee { get; set; } 100 | 101 | [XmlAttribute(AttributeName = "grossRate")] 102 | public string GrossRate { get; set; } 103 | 104 | [XmlAttribute(AttributeName = "grossAmount")] 105 | public string GrossAmount { get; set; } 106 | 107 | [XmlAttribute(AttributeName = "netAmount")] 108 | public string NetAmount { get; set; } 109 | 110 | [XmlAttribute(AttributeName = "code")] 111 | public string Code { get; set; } 112 | 113 | [XmlAttribute(AttributeName = "fromAcct")] 114 | public string FromAcct { get; set; } 115 | 116 | [XmlAttribute(AttributeName = "toAcct")] 117 | public string ToAcct { get; set; } 118 | } 119 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/ChangeInDividendAccruals.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Collections.Generic; 4 | using System.Xml.Serialization; 5 | 6 | [XmlRoot(ElementName = "ChangeInDividendAccruals")] 7 | public class ChangeInDividendAccruals 8 | { 9 | [XmlElement(ElementName = "ChangeInDividendAccrual")] 10 | public List ChangeInDividendAccrual { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/ComplexPosition.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Xml.Serialization; 4 | 5 | [XmlRoot(ElementName = "ComplexPosition")] 6 | public class ComplexPosition 7 | { 8 | [XmlAttribute(AttributeName = "accountId")] 9 | public string AccountId { get; set; } 10 | 11 | [XmlAttribute(AttributeName = "acctAlias")] 12 | public string AcctAlias { get; set; } 13 | 14 | [XmlAttribute(AttributeName = "levelOfDetail")] 15 | public string LevelOfDetail { get; set; } 16 | 17 | [XmlAttribute(AttributeName = "quantity")] 18 | public string Quantity { get; set; } 19 | 20 | [XmlAttribute(AttributeName = "principalAdjustFactor")] 21 | public string PrincipalAdjustFactor { get; set; } 22 | 23 | [XmlAttribute(AttributeName = "putCall")] 24 | public string PutCall { get; set; } 25 | 26 | [XmlAttribute(AttributeName = "issuer")] 27 | public string Issuer { get; set; } 28 | 29 | [XmlAttribute(AttributeName = "multiplier")] 30 | public string Multiplier { get; set; } 31 | 32 | [XmlAttribute(AttributeName = "strike")] 33 | public string Strike { get; set; } 34 | 35 | [XmlAttribute(AttributeName = "expiry")] 36 | public string Expiry { get; set; } 37 | 38 | [XmlAttribute(AttributeName = "assetCategory")] 39 | public string AssetCategory { get; set; } 40 | 41 | [XmlAttribute(AttributeName = "symbol")] 42 | public string Symbol { get; set; } 43 | 44 | [XmlAttribute(AttributeName = "description")] 45 | public string Description { get; set; } 46 | 47 | [XmlAttribute(AttributeName = "conid")] 48 | public string Conid { get; set; } 49 | 50 | [XmlAttribute(AttributeName = "securityID")] 51 | public string SecurityID { get; set; } 52 | 53 | [XmlAttribute(AttributeName = "securityIDType")] 54 | public string SecurityIDType { get; set; } 55 | 56 | [XmlAttribute(AttributeName = "cusip")] 57 | public string Cusip { get; set; } 58 | 59 | [XmlAttribute(AttributeName = "isin")] 60 | public string Isin { get; set; } 61 | 62 | [XmlAttribute(AttributeName = "listingExchange")] 63 | public string ListingExchange { get; set; } 64 | 65 | [XmlAttribute(AttributeName = "underlyingConid")] 66 | public string UnderlyingConid { get; set; } 67 | 68 | [XmlAttribute(AttributeName = "underlyingSymbol")] 69 | public string UnderlyingSymbol { get; set; } 70 | 71 | [XmlAttribute(AttributeName = "underlyingSecurityID")] 72 | public string UnderlyingSecurityID { get; set; } 73 | 74 | [XmlAttribute(AttributeName = "underlyingListingExchange")] 75 | public string UnderlyingListingExchange { get; set; } 76 | 77 | [XmlAttribute(AttributeName = "mtmPnl")] 78 | public string MtmPnl { get; set; } 79 | 80 | [XmlAttribute(AttributeName = "value")] 81 | public string Value { get; set; } 82 | 83 | [XmlAttribute(AttributeName = "closePrice")] 84 | public string ClosePrice { get; set; } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/ComplexPositions.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Collections.Generic; 4 | using System.Xml.Serialization; 5 | 6 | [XmlRoot(ElementName = "ComplexPositions")] 7 | public class ComplexPositions 8 | { 9 | [XmlElement(ElementName = "ComplexPosition")] 10 | public List ComplexPosition { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/ConversionRate.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Xml.Serialization; 4 | 5 | [XmlRoot(ElementName = "ConversionRate")] 6 | public class ConversionRate 7 | { 8 | [XmlAttribute(AttributeName = "reportDate")] 9 | public string ReportDate { get; set; } 10 | 11 | [XmlAttribute(AttributeName = "fromCurrency")] 12 | public string FromCurrency { get; set; } 13 | 14 | [XmlAttribute(AttributeName = "toCurrency")] 15 | public string ToCurrency { get; set; } 16 | 17 | [XmlAttribute(AttributeName = "rate")] 18 | public string Rate { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/ConversionRates.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Collections.Generic; 4 | using System.Xml.Serialization; 5 | 6 | [XmlRoot(ElementName = "ConversionRates")] 7 | public class ConversionRates 8 | { 9 | [XmlElement(ElementName = "ConversionRate")] 10 | public List ConversionRate { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/EquitySummaryInBase.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Collections.Generic; 4 | using System.Xml.Serialization; 5 | 6 | [XmlRoot(ElementName = "EquitySummaryInBase")] 7 | public class EquitySummaryInBase 8 | { 9 | [XmlElement(ElementName = "EquitySummaryByReportDateInBase")] 10 | public List EquitySummaryByReportDateInBase { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/FlexQueryResponse.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Xml.Serialization; 4 | 5 | [XmlRoot(ElementName = "FlexQueryResponse")] 6 | public class FlexQueryResponse : XmlBase 7 | { 8 | [XmlElement(ElementName = "FlexStatements")] 9 | public FlexStatements FlexStatements { get; set; } 10 | 11 | [XmlAttribute(AttributeName = "queryName")] 12 | public string QueryName { get; set; } 13 | 14 | [XmlAttribute(AttributeName = "type")] 15 | public string Type { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/FlexStatement.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Xml.Serialization; 4 | 5 | [XmlRoot(ElementName = "FlexStatement")] 6 | public class FlexStatement 7 | { 8 | [XmlElement(ElementName = "AccountInformation")] 9 | public AccountInformation AccountInformation { get; set; } 10 | 11 | [XmlElement(ElementName = "CashTransactions")] 12 | public CashTransactions CashTransactions { get; set; } 13 | 14 | [XmlElement(ElementName = "CFDCharges")] 15 | public CFDCharges CFDCharges { get; set; } 16 | 17 | [XmlElement(ElementName = "ChangeInDividendAccruals")] 18 | public ChangeInDividendAccruals ChangeInDividendAccruals { get; set; } 19 | 20 | [XmlElement(ElementName = "ComplexPositions")] 21 | public ComplexPositions ComplexPositions { get; set; } 22 | 23 | [XmlElement(ElementName = "ConversionRates")] 24 | public ConversionRates ConversionRates { get; set; } 25 | 26 | [XmlElement(ElementName = "CorporateActions")] 27 | public string CorporateActions { get; set; } 28 | 29 | [XmlElement(ElementName = "EquitySummaryInBase")] 30 | public EquitySummaryInBase EquitySummaryInBase { get; set; } 31 | 32 | [XmlElement(ElementName = "InterestAccruals")] 33 | public InterestAccruals InterestAccruals { get; set; } 34 | 35 | [XmlElement(ElementName = "OpenDividendAccruals")] 36 | public OpenDividendAccruals OpenDividendAccruals { get; set; } 37 | 38 | [XmlElement(ElementName = "OpenPositions")] 39 | public OpenPositions OpenPositions { get; set; } 40 | 41 | //Note: IB does not pluralize the containing OptionEAE in the FlexStatement so we get ... 42 | [XmlElement(ElementName = "OptionEAE")] 43 | public OptionEAEs OptionEAEs { get; set; } 44 | 45 | [XmlElement(ElementName = "PriorPeriodPositions")] 46 | public PriorPeriodPositions PriorPeriodPositions { get; set; } 47 | 48 | [XmlElement(ElementName = "SecuritiesInfo")] 49 | public SecuritiesInfo SecuritiesInfo { get; set; } 50 | 51 | [XmlElement(ElementName = "SLBActivities")] 52 | public SLBActivities SLBActivities { get; set; } 53 | 54 | [XmlElement(ElementName = "SLBFees")] 55 | public SLBFees SLBFees { get; set; } 56 | 57 | [XmlElement(ElementName = "StmtFunds")] 58 | public StmtFunds StatementOfFunds { get; set; } 59 | 60 | [XmlElement(ElementName = "TierInterestDetails")] 61 | public TierInterestDetails TierInterestDetails { get; set; } 62 | 63 | [XmlElement(ElementName = "TradeConfirms")] 64 | public TradeConfirms TradeConfirms { get; set; } 65 | 66 | [XmlElement(ElementName = "Trades")] 67 | public Trades Trades { get; set; } 68 | 69 | [XmlElement(ElementName = "TransactionTaxes")] 70 | public TransactionTaxes TransactionTaxes { get; set; } 71 | 72 | [XmlElement(ElementName = "Transfers")] 73 | public Transfers Transfers { get; set; } 74 | 75 | [XmlElement(ElementName = "UnbundledCommissionDetails")] 76 | public UnbundledCommissionDetails UnbundledCommissionDetails { get; set; } 77 | 78 | [XmlAttribute(AttributeName = "accountId")] 79 | public string AccountId { get; set; } 80 | 81 | [XmlAttribute(AttributeName = "fromDate")] 82 | public string FromDate { get; set; } 83 | 84 | [XmlAttribute(AttributeName = "toDate")] 85 | public string ToDate { get; set; } 86 | 87 | [XmlAttribute(AttributeName = "period")] 88 | public string Period { get; set; } 89 | 90 | [XmlAttribute(AttributeName = "whenGenerated")] 91 | public string WhenGenerated { get; set; } 92 | } 93 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/FlexStatements.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Collections.Generic; 4 | using System.Xml.Serialization; 5 | 6 | [XmlRoot(ElementName = "FlexStatements")] 7 | public class FlexStatements 8 | { 9 | [XmlElement(ElementName = "FlexStatement")] 10 | public List FlexStatement { get; set; } 11 | 12 | [XmlAttribute(AttributeName = "count")] 13 | public string Count { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/InterestAccruals.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Collections.Generic; 4 | using System.Xml.Serialization; 5 | 6 | [XmlRoot(ElementName = "InterestAccruals")] 7 | public class InterestAccruals 8 | { 9 | [XmlElement(ElementName = "InterestAccrualsCurrency")] 10 | public List InterestAccrualsCurrency { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/InterestAccrualsCurrency.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Xml.Serialization; 4 | 5 | [XmlRoot(ElementName = "InterestAccrualsCurrency")] 6 | public class InterestAccrualsCurrency 7 | { 8 | [XmlAttribute(AttributeName = "toDate")] 9 | public string ToDate { get; set; } 10 | 11 | [XmlAttribute(AttributeName = "fromDate")] 12 | public string FromDate { get; set; } 13 | 14 | [XmlAttribute(AttributeName = "accountId")] 15 | public string AccountId { get; set; } 16 | 17 | [XmlAttribute(AttributeName = "acctAlias")] 18 | public string AcctAlias { get; set; } 19 | 20 | [XmlAttribute(AttributeName = "model")] 21 | public string Model { get; set; } 22 | 23 | [XmlAttribute(AttributeName = "currency")] 24 | public string Currency { get; set; } 25 | 26 | [XmlAttribute(AttributeName = "endingAccrualBalance")] 27 | public string EndingAccrualBalance { get; set; } 28 | 29 | [XmlAttribute(AttributeName = "fxTranslation")] 30 | public string FxTranslation { get; set; } 31 | 32 | [XmlAttribute(AttributeName = "accrualReversal")] 33 | public string AccrualReversal { get; set; } 34 | 35 | [XmlAttribute(AttributeName = "interestAccrued")] 36 | public string InterestAccrued { get; set; } 37 | 38 | [XmlAttribute(AttributeName = "startingAccrualBalance")] 39 | public string StartingAccrualBalance { get; set; } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/OpenDividendAccrual.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Xml.Serialization; 4 | 5 | [XmlRoot(ElementName = "OpenDividendAccrual")] 6 | public class OpenDividendAccrual 7 | { 8 | [XmlAttribute(AttributeName = "accountId")] 9 | public string AccountId { get; set; } 10 | 11 | [XmlAttribute(AttributeName = "acctAlias")] 12 | public string AcctAlias { get; set; } 13 | 14 | [XmlAttribute(AttributeName = "model")] 15 | public string Model { get; set; } 16 | 17 | [XmlAttribute(AttributeName = "currency")] 18 | public string Currency { get; set; } 19 | 20 | [XmlAttribute(AttributeName = "fxRateToBase")] 21 | public string FxRateToBase { get; set; } 22 | 23 | [XmlAttribute(AttributeName = "assetCategory")] 24 | public string AssetCategory { get; set; } 25 | 26 | [XmlAttribute(AttributeName = "symbol")] 27 | public string Symbol { get; set; } 28 | 29 | [XmlAttribute(AttributeName = "description")] 30 | public string Description { get; set; } 31 | 32 | [XmlAttribute(AttributeName = "conid")] 33 | public string Conid { get; set; } 34 | 35 | [XmlAttribute(AttributeName = "securityID")] 36 | public string SecurityID { get; set; } 37 | 38 | [XmlAttribute(AttributeName = "securityIDType")] 39 | public string SecurityIDType { get; set; } 40 | 41 | [XmlAttribute(AttributeName = "cusip")] 42 | public string Cusip { get; set; } 43 | 44 | [XmlAttribute(AttributeName = "isin")] 45 | public string Isin { get; set; } 46 | 47 | [XmlAttribute(AttributeName = "listingExchange")] 48 | public string ListingExchange { get; set; } 49 | 50 | [XmlAttribute(AttributeName = "underlyingConid")] 51 | public string UnderlyingConid { get; set; } 52 | 53 | [XmlAttribute(AttributeName = "underlyingSymbol")] 54 | public string UnderlyingSymbol { get; set; } 55 | 56 | [XmlAttribute(AttributeName = "underlyingSecurityID")] 57 | public string UnderlyingSecurityID { get; set; } 58 | 59 | [XmlAttribute(AttributeName = "underlyingListingExchange")] 60 | public string UnderlyingListingExchange { get; set; } 61 | 62 | [XmlAttribute(AttributeName = "issuer")] 63 | public string Issuer { get; set; } 64 | 65 | [XmlAttribute(AttributeName = "multiplier")] 66 | public string Multiplier { get; set; } 67 | 68 | [XmlAttribute(AttributeName = "strike")] 69 | public string Strike { get; set; } 70 | 71 | [XmlAttribute(AttributeName = "expiry")] 72 | public string Expiry { get; set; } 73 | 74 | [XmlAttribute(AttributeName = "putCall")] 75 | public string PutCall { get; set; } 76 | 77 | [XmlAttribute(AttributeName = "principalAdjustFactor")] 78 | public string PrincipalAdjustFactor { get; set; } 79 | 80 | [XmlAttribute(AttributeName = "exDate")] 81 | public string ExDate { get; set; } 82 | 83 | [XmlAttribute(AttributeName = "payDate")] 84 | public string PayDate { get; set; } 85 | 86 | [XmlAttribute(AttributeName = "quantity")] 87 | public string Quantity { get; set; } 88 | 89 | [XmlAttribute(AttributeName = "tax")] 90 | public string Tax { get; set; } 91 | 92 | [XmlAttribute(AttributeName = "fee")] 93 | public string Fee { get; set; } 94 | 95 | [XmlAttribute(AttributeName = "grossRate")] 96 | public string GrossRate { get; set; } 97 | 98 | [XmlAttribute(AttributeName = "grossAmount")] 99 | public string GrossAmount { get; set; } 100 | 101 | [XmlAttribute(AttributeName = "netAmount")] 102 | public string NetAmount { get; set; } 103 | 104 | [XmlAttribute(AttributeName = "code")] 105 | public string Code { get; set; } 106 | 107 | [XmlAttribute(AttributeName = "fromAcct")] 108 | public string FromAcct { get; set; } 109 | 110 | [XmlAttribute(AttributeName = "toAcct")] 111 | public string ToAcct { get; set; } 112 | } 113 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/OpenDividendAccruals.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Xml.Serialization; 4 | 5 | [XmlRoot(ElementName = "OpenDividendAccruals")] 6 | public class OpenDividendAccruals 7 | { 8 | [XmlElement(ElementName = "OpenDividendAccrual")] 9 | public OpenDividendAccrual OpenDividendAccrual { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/OpenPosition.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Xml.Serialization; 4 | 5 | [XmlRoot(ElementName = "OpenPosition")] 6 | public class OpenPosition 7 | { 8 | [XmlAttribute(AttributeName = "accountId")] 9 | public string AccountId { get; set; } 10 | 11 | [XmlAttribute(AttributeName = "acctAlias")] 12 | public string AcctAlias { get; set; } 13 | 14 | [XmlAttribute(AttributeName = "model")] 15 | public string Model { get; set; } 16 | 17 | [XmlAttribute(AttributeName = "currency")] 18 | public string Currency { get; set; } 19 | 20 | [XmlAttribute(AttributeName = "fxRateToBase")] 21 | public string FxRateToBase { get; set; } 22 | 23 | [XmlAttribute(AttributeName = "assetCategory")] 24 | public string AssetCategory { get; set; } 25 | 26 | [XmlAttribute(AttributeName = "symbol")] 27 | public string Symbol { get; set; } 28 | 29 | [XmlAttribute(AttributeName = "description")] 30 | public string Description { get; set; } 31 | 32 | [XmlAttribute(AttributeName = "conid")] 33 | public string Conid { get; set; } 34 | 35 | [XmlAttribute(AttributeName = "securityID")] 36 | public string SecurityID { get; set; } 37 | 38 | [XmlAttribute(AttributeName = "securityIDType")] 39 | public string SecurityIDType { get; set; } 40 | 41 | [XmlAttribute(AttributeName = "cusip")] 42 | public string Cusip { get; set; } 43 | 44 | [XmlAttribute(AttributeName = "isin")] 45 | public string Isin { get; set; } 46 | 47 | [XmlAttribute(AttributeName = "listingExchange")] 48 | public string ListingExchange { get; set; } 49 | 50 | [XmlAttribute(AttributeName = "underlyingConid")] 51 | public string UnderlyingConid { get; set; } 52 | 53 | [XmlAttribute(AttributeName = "underlyingSymbol")] 54 | public string UnderlyingSymbol { get; set; } 55 | 56 | [XmlAttribute(AttributeName = "underlyingSecurityID")] 57 | public string UnderlyingSecurityID { get; set; } 58 | 59 | [XmlAttribute(AttributeName = "underlyingListingExchange")] 60 | public string UnderlyingListingExchange { get; set; } 61 | 62 | [XmlAttribute(AttributeName = "issuer")] 63 | public string Issuer { get; set; } 64 | 65 | [XmlAttribute(AttributeName = "multiplier")] 66 | public string Multiplier { get; set; } 67 | 68 | [XmlAttribute(AttributeName = "strike")] 69 | public string Strike { get; set; } 70 | 71 | [XmlAttribute(AttributeName = "expiry")] 72 | public string Expiry { get; set; } 73 | 74 | [XmlAttribute(AttributeName = "putCall")] 75 | public string PutCall { get; set; } 76 | 77 | [XmlAttribute(AttributeName = "principalAdjustFactor")] 78 | public string PrincipalAdjustFactor { get; set; } 79 | 80 | [XmlAttribute(AttributeName = "reportDate")] 81 | public string ReportDate { get; set; } 82 | 83 | [XmlAttribute(AttributeName = "position")] 84 | public string Position { get; set; } 85 | 86 | [XmlAttribute(AttributeName = "markPrice")] 87 | public string MarkPrice { get; set; } 88 | 89 | [XmlAttribute(AttributeName = "positionValue")] 90 | public string PositionValue { get; set; } 91 | 92 | [XmlAttribute(AttributeName = "openPrice")] 93 | public string OpenPrice { get; set; } 94 | 95 | [XmlAttribute(AttributeName = "costBasisPrice")] 96 | public string CostBasisPrice { get; set; } 97 | 98 | [XmlAttribute(AttributeName = "costBasisMoney")] 99 | public string CostBasisMoney { get; set; } 100 | 101 | [XmlAttribute(AttributeName = "percentOfNAV")] 102 | public string PercentOfNAV { get; set; } 103 | 104 | [XmlAttribute(AttributeName = "fifoPnlUnrealized")] 105 | public string FifoPnlUnrealized { get; set; } 106 | 107 | [XmlAttribute(AttributeName = "side")] 108 | public string Side { get; set; } 109 | 110 | [XmlAttribute(AttributeName = "levelOfDetail")] 111 | public string LevelOfDetail { get; set; } 112 | 113 | [XmlAttribute(AttributeName = "openDateTime")] 114 | public string OpenDateTime { get; set; } 115 | 116 | [XmlAttribute(AttributeName = "holdingPeriodDateTime")] 117 | public string HoldingPeriodDateTime { get; set; } 118 | 119 | [XmlAttribute(AttributeName = "code")] 120 | public string Code { get; set; } 121 | 122 | [XmlAttribute(AttributeName = "originatingOrderID")] 123 | public string OriginatingOrderID { get; set; } 124 | 125 | [XmlAttribute(AttributeName = "originatingTransactionID")] 126 | public string OriginatingTransactionID { get; set; } 127 | 128 | [XmlAttribute(AttributeName = "accruedInt")] 129 | public string AccruedInt { get; set; } 130 | } 131 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/OpenPositions.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Collections.Generic; 4 | using System.Xml.Serialization; 5 | 6 | [XmlRoot(ElementName = "OpenPositions")] 7 | public class OpenPositions 8 | { 9 | [XmlElement(ElementName = "OpenPosition")] 10 | public List OpenPosition { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/OptionEAE.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Xml.Serialization; 4 | 5 | [XmlRoot(ElementName = "OptionEAE")] 6 | public class OptionEAE 7 | { 8 | [XmlAttribute(AttributeName = "accountId")] 9 | public string AccountId { get; set; } 10 | 11 | [XmlAttribute(AttributeName = "acctAlias")] 12 | public string AcctAlias { get; set; } 13 | 14 | [XmlAttribute(AttributeName = "model")] 15 | public string Model { get; set; } 16 | 17 | [XmlAttribute(AttributeName = "currency")] 18 | public string Currency { get; set; } 19 | 20 | [XmlAttribute(AttributeName = "fxRateToBase")] 21 | public string FxRateToBase { get; set; } 22 | 23 | [XmlAttribute(AttributeName = "assetCategory")] 24 | public string AssetCategory { get; set; } 25 | 26 | [XmlAttribute(AttributeName = "symbol")] 27 | public string Symbol { get; set; } 28 | 29 | [XmlAttribute(AttributeName = "description")] 30 | public string Description { get; set; } 31 | 32 | [XmlAttribute(AttributeName = "conid")] 33 | public string Conid { get; set; } 34 | 35 | [XmlAttribute(AttributeName = "securityID")] 36 | public string SecurityID { get; set; } 37 | 38 | [XmlAttribute(AttributeName = "securityIDType")] 39 | public string SecurityIDType { get; set; } 40 | 41 | [XmlAttribute(AttributeName = "cusip")] 42 | public string Cusip { get; set; } 43 | 44 | [XmlAttribute(AttributeName = "isin")] 45 | public string Isin { get; set; } 46 | 47 | [XmlAttribute(AttributeName = "listingExchange")] 48 | public string ListingExchange { get; set; } 49 | 50 | [XmlAttribute(AttributeName = "underlyingConid")] 51 | public string UnderlyingConid { get; set; } 52 | 53 | [XmlAttribute(AttributeName = "underlyingSymbol")] 54 | public string UnderlyingSymbol { get; set; } 55 | 56 | [XmlAttribute(AttributeName = "underlyingSecurityID")] 57 | public string UnderlyingSecurityID { get; set; } 58 | 59 | [XmlAttribute(AttributeName = "underlyingListingExchange")] 60 | public string UnderlyingListingExchange { get; set; } 61 | 62 | [XmlAttribute(AttributeName = "issuer")] 63 | public string Issuer { get; set; } 64 | 65 | [XmlAttribute(AttributeName = "multiplier")] 66 | public string Multiplier { get; set; } 67 | 68 | [XmlAttribute(AttributeName = "strike")] 69 | public string Strike { get; set; } 70 | 71 | [XmlAttribute(AttributeName = "expiry")] 72 | public string Expiry { get; set; } 73 | 74 | [XmlAttribute(AttributeName = "putCall")] 75 | public string PutCall { get; set; } 76 | 77 | [XmlAttribute(AttributeName = "principalAdjustFactor")] 78 | public string PrincipalAdjustFactor { get; set; } 79 | 80 | [XmlAttribute(AttributeName = "date")] 81 | public string Date { get; set; } 82 | 83 | [XmlAttribute(AttributeName = "transactionType")] 84 | public string TransactionType { get; set; } 85 | 86 | [XmlAttribute(AttributeName = "quantity")] 87 | public string Quantity { get; set; } 88 | 89 | [XmlAttribute(AttributeName = "tradePrice")] 90 | public string TradePrice { get; set; } 91 | 92 | [XmlAttribute(AttributeName = "markPrice")] 93 | public string MarkPrice { get; set; } 94 | 95 | [XmlAttribute(AttributeName = "proceeds")] 96 | public string Proceeds { get; set; } 97 | 98 | [XmlAttribute(AttributeName = "commisionsAndTax")] 99 | public string CommisionsAndTax { get; set; } 100 | 101 | [XmlAttribute(AttributeName = "costBasis")] 102 | public string CostBasis { get; set; } 103 | 104 | [XmlAttribute(AttributeName = "realizedPnl")] 105 | public string RealizedPnl { get; set; } 106 | 107 | [XmlAttribute(AttributeName = "fxPnl")] 108 | public string FxPnl { get; set; } 109 | 110 | [XmlAttribute(AttributeName = "mtmPnl")] 111 | public string MtmPnl { get; set; } 112 | 113 | [XmlAttribute(AttributeName = "tradeID")] 114 | public string TradeID { get; set; } 115 | } 116 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/OptionEAEs.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Collections.Generic; 4 | using System.Xml.Serialization; 5 | 6 | //IB does not pluralize the containing OptionEAE in the FlexStatement 7 | [XmlRoot(ElementName = "OptionEAE")] 8 | public class OptionEAEs 9 | { 10 | [XmlElement(ElementName = "OptionEAE")] 11 | public List OptionEAE { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/PriorPeriodPosition.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Xml.Serialization; 4 | 5 | [XmlRoot(ElementName = "PriorPeriodPosition")] 6 | public class PriorPeriodPosition 7 | { 8 | [XmlAttribute(AttributeName = "accountId")] 9 | public string AccountId { get; set; } 10 | 11 | [XmlAttribute(AttributeName = "acctAlias")] 12 | public string AcctAlias { get; set; } 13 | 14 | [XmlAttribute(AttributeName = "model")] 15 | public string Model { get; set; } 16 | 17 | [XmlAttribute(AttributeName = "currency")] 18 | public string Currency { get; set; } 19 | 20 | [XmlAttribute(AttributeName = "fxRateToBase")] 21 | public string FxRateToBase { get; set; } 22 | 23 | [XmlAttribute(AttributeName = "assetCategory")] 24 | public string AssetCategory { get; set; } 25 | 26 | [XmlAttribute(AttributeName = "symbol")] 27 | public string Symbol { get; set; } 28 | 29 | [XmlAttribute(AttributeName = "description")] 30 | public string Description { get; set; } 31 | 32 | [XmlAttribute(AttributeName = "conid")] 33 | public string Conid { get; set; } 34 | 35 | [XmlAttribute(AttributeName = "securityID")] 36 | public string SecurityID { get; set; } 37 | 38 | [XmlAttribute(AttributeName = "securityIDType")] 39 | public string SecurityIDType { get; set; } 40 | 41 | [XmlAttribute(AttributeName = "cusip")] 42 | public string Cusip { get; set; } 43 | 44 | [XmlAttribute(AttributeName = "isin")] 45 | public string Isin { get; set; } 46 | 47 | [XmlAttribute(AttributeName = "listingExchange")] 48 | public string ListingExchange { get; set; } 49 | 50 | [XmlAttribute(AttributeName = "underlyingConid")] 51 | public string UnderlyingConid { get; set; } 52 | 53 | [XmlAttribute(AttributeName = "underlyingSymbol")] 54 | public string UnderlyingSymbol { get; set; } 55 | 56 | [XmlAttribute(AttributeName = "underlyingSecurityID")] 57 | public string UnderlyingSecurityID { get; set; } 58 | 59 | [XmlAttribute(AttributeName = "underlyingListingExchange")] 60 | public string UnderlyingListingExchange { get; set; } 61 | 62 | [XmlAttribute(AttributeName = "issuer")] 63 | public string Issuer { get; set; } 64 | 65 | [XmlAttribute(AttributeName = "multiplier")] 66 | public string Multiplier { get; set; } 67 | 68 | [XmlAttribute(AttributeName = "strike")] 69 | public string Strike { get; set; } 70 | 71 | [XmlAttribute(AttributeName = "expiry")] 72 | public string Expiry { get; set; } 73 | 74 | [XmlAttribute(AttributeName = "putCall")] 75 | public string PutCall { get; set; } 76 | 77 | [XmlAttribute(AttributeName = "principalAdjustFactor")] 78 | public string PrincipalAdjustFactor { get; set; } 79 | 80 | [XmlAttribute(AttributeName = "date")] 81 | public string Date { get; set; } 82 | 83 | [XmlAttribute(AttributeName = "price")] 84 | public string Price { get; set; } 85 | 86 | [XmlAttribute(AttributeName = "priorMtmPnl")] 87 | public string PriorMtmPnl { get; set; } 88 | } 89 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/PriorPeriodPositions.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Collections.Generic; 4 | using System.Xml.Serialization; 5 | 6 | [XmlRoot(ElementName = "PriorPeriodPositions")] 7 | public class PriorPeriodPositions 8 | { 9 | [XmlElement(ElementName = "PriorPeriodPosition")] 10 | public List PriorPeriodPosition { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/SLBActivities.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Collections.Generic; 4 | using System.Xml.Serialization; 5 | 6 | [XmlRoot(ElementName = "SLBActivities")] 7 | public class SLBActivities 8 | { 9 | [XmlElement(ElementName = "SLBActivity")] 10 | public List SLBActivity { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/SLBActivity.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Xml.Serialization; 4 | 5 | [XmlRoot(ElementName = "SLBActivity")] 6 | public class SLBActivity 7 | { 8 | [XmlAttribute(AttributeName = "accountId")] 9 | public string AccountId { get; set; } 10 | 11 | [XmlAttribute(AttributeName = "acctAlias")] 12 | public string AcctAlias { get; set; } 13 | 14 | [XmlAttribute(AttributeName = "model")] 15 | public string Model { get; set; } 16 | 17 | [XmlAttribute(AttributeName = "currency")] 18 | public string Currency { get; set; } 19 | 20 | [XmlAttribute(AttributeName = "fxRateToBase")] 21 | public string FxRateToBase { get; set; } 22 | 23 | [XmlAttribute(AttributeName = "assetCategory")] 24 | public string AssetCategory { get; set; } 25 | 26 | [XmlAttribute(AttributeName = "symbol")] 27 | public string Symbol { get; set; } 28 | 29 | [XmlAttribute(AttributeName = "description")] 30 | public string Description { get; set; } 31 | 32 | [XmlAttribute(AttributeName = "conid")] 33 | public string Conid { get; set; } 34 | 35 | [XmlAttribute(AttributeName = "securityID")] 36 | public string SecurityID { get; set; } 37 | 38 | [XmlAttribute(AttributeName = "securityIDType")] 39 | public string SecurityIDType { get; set; } 40 | 41 | [XmlAttribute(AttributeName = "cusip")] 42 | public string Cusip { get; set; } 43 | 44 | [XmlAttribute(AttributeName = "isin")] 45 | public string Isin { get; set; } 46 | 47 | [XmlAttribute(AttributeName = "listingExchange")] 48 | public string ListingExchange { get; set; } 49 | 50 | [XmlAttribute(AttributeName = "underlyingConid")] 51 | public string UnderlyingConid { get; set; } 52 | 53 | [XmlAttribute(AttributeName = "underlyingSymbol")] 54 | public string UnderlyingSymbol { get; set; } 55 | 56 | [XmlAttribute(AttributeName = "underlyingSecurityID")] 57 | public string UnderlyingSecurityID { get; set; } 58 | 59 | [XmlAttribute(AttributeName = "underlyingListingExchange")] 60 | public string UnderlyingListingExchange { get; set; } 61 | 62 | [XmlAttribute(AttributeName = "issuer")] 63 | public string Issuer { get; set; } 64 | 65 | [XmlAttribute(AttributeName = "multiplier")] 66 | public string Multiplier { get; set; } 67 | 68 | [XmlAttribute(AttributeName = "strike")] 69 | public string Strike { get; set; } 70 | 71 | [XmlAttribute(AttributeName = "expiry")] 72 | public string Expiry { get; set; } 73 | 74 | [XmlAttribute(AttributeName = "putCall")] 75 | public string PutCall { get; set; } 76 | 77 | [XmlAttribute(AttributeName = "principalAdjustFactor")] 78 | public string PrincipalAdjustFactor { get; set; } 79 | 80 | [XmlAttribute(AttributeName = "exchange")] 81 | public string Exchange { get; set; } 82 | 83 | [XmlAttribute(AttributeName = "type")] 84 | public string Type { get; set; } 85 | 86 | [XmlAttribute(AttributeName = "date")] 87 | public string Date { get; set; } 88 | 89 | [XmlAttribute(AttributeName = "markCurrentPrice")] 90 | public string MarkCurrentPrice { get; set; } 91 | 92 | [XmlAttribute(AttributeName = "markPriorPrice")] 93 | public string MarkPriorPrice { get; set; } 94 | 95 | [XmlAttribute(AttributeName = "markQuantity")] 96 | public string MarkQuantity { get; set; } 97 | 98 | [XmlAttribute(AttributeName = "collateralAmount")] 99 | public string CollateralAmount { get; set; } 100 | 101 | [XmlAttribute(AttributeName = "activityDescription")] 102 | public string ActivityDescription { get; set; } 103 | 104 | [XmlAttribute(AttributeName = "quantity")] 105 | public string Quantity { get; set; } 106 | 107 | [XmlAttribute(AttributeName = "slbTransactionId")] 108 | public string SlbTransactionId { get; set; } 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/SLBFee.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Xml.Serialization; 4 | 5 | [XmlRoot(ElementName = "SLBFee")] 6 | public class SLBFee 7 | { 8 | [XmlAttribute(AttributeName = "accountId")] 9 | public string AccountId { get; set; } 10 | 11 | [XmlAttribute(AttributeName = "acctAlias")] 12 | public string AcctAlias { get; set; } 13 | 14 | [XmlAttribute(AttributeName = "model")] 15 | public string Model { get; set; } 16 | 17 | [XmlAttribute(AttributeName = "currency")] 18 | public string Currency { get; set; } 19 | 20 | [XmlAttribute(AttributeName = "fxRateToBase")] 21 | public string FxRateToBase { get; set; } 22 | 23 | [XmlAttribute(AttributeName = "assetCategory")] 24 | public string AssetCategory { get; set; } 25 | 26 | [XmlAttribute(AttributeName = "symbol")] 27 | public string Symbol { get; set; } 28 | 29 | [XmlAttribute(AttributeName = "description")] 30 | public string Description { get; set; } 31 | 32 | [XmlAttribute(AttributeName = "conid")] 33 | public string Conid { get; set; } 34 | 35 | [XmlAttribute(AttributeName = "securityID")] 36 | public string SecurityID { get; set; } 37 | 38 | [XmlAttribute(AttributeName = "securityIDType")] 39 | public string SecurityIDType { get; set; } 40 | 41 | [XmlAttribute(AttributeName = "cusip")] 42 | public string Cusip { get; set; } 43 | 44 | [XmlAttribute(AttributeName = "isin")] 45 | public string Isin { get; set; } 46 | 47 | [XmlAttribute(AttributeName = "listingExchange")] 48 | public string ListingExchange { get; set; } 49 | 50 | [XmlAttribute(AttributeName = "underlyingConid")] 51 | public string UnderlyingConid { get; set; } 52 | 53 | [XmlAttribute(AttributeName = "underlyingSymbol")] 54 | public string UnderlyingSymbol { get; set; } 55 | 56 | [XmlAttribute(AttributeName = "underlyingSecurityID")] 57 | public string UnderlyingSecurityID { get; set; } 58 | 59 | [XmlAttribute(AttributeName = "underlyingListingExchange")] 60 | public string UnderlyingListingExchange { get; set; } 61 | 62 | [XmlAttribute(AttributeName = "issuer")] 63 | public string Issuer { get; set; } 64 | 65 | [XmlAttribute(AttributeName = "multiplier")] 66 | public string Multiplier { get; set; } 67 | 68 | [XmlAttribute(AttributeName = "strike")] 69 | public string Strike { get; set; } 70 | 71 | [XmlAttribute(AttributeName = "expiry")] 72 | public string Expiry { get; set; } 73 | 74 | [XmlAttribute(AttributeName = "putCall")] 75 | public string PutCall { get; set; } 76 | 77 | [XmlAttribute(AttributeName = "principalAdjustFactor")] 78 | public string PrincipalAdjustFactor { get; set; } 79 | 80 | [XmlAttribute(AttributeName = "exchange")] 81 | public string Exchange { get; set; } 82 | 83 | [XmlAttribute(AttributeName = "quantity")] 84 | public string Quantity { get; set; } 85 | 86 | [XmlAttribute(AttributeName = "code")] 87 | public string Code { get; set; } 88 | 89 | [XmlAttribute(AttributeName = "toAcct")] 90 | public string ToAcct { get; set; } 91 | 92 | [XmlAttribute(AttributeName = "fromAcct")] 93 | public string FromAcct { get; set; } 94 | 95 | [XmlAttribute(AttributeName = "type")] 96 | public string Type { get; set; } 97 | 98 | [XmlAttribute(AttributeName = "valueDate")] 99 | public string ValueDate { get; set; } 100 | 101 | [XmlAttribute(AttributeName = "collateralAmount")] 102 | public string CollateralAmount { get; set; } 103 | 104 | [XmlAttribute(AttributeName = "uniqueID")] 105 | public string UniqueID { get; set; } 106 | 107 | [XmlAttribute(AttributeName = "netLendFee")] 108 | public string NetLendFee { get; set; } 109 | 110 | [XmlAttribute(AttributeName = "netLendFeeRate")] 111 | public string NetLendFeeRate { get; set; } 112 | 113 | [XmlAttribute(AttributeName = "grossLendFee")] 114 | public string GrossLendFee { get; set; } 115 | 116 | [XmlAttribute(AttributeName = "marketFeeRate")] 117 | public string MarketFeeRate { get; set; } 118 | 119 | [XmlAttribute(AttributeName = "totalCharges")] 120 | public string TotalCharges { get; set; } 121 | 122 | [XmlAttribute(AttributeName = "ticketCharge")] 123 | public string TicketCharge { get; set; } 124 | 125 | [XmlAttribute(AttributeName = "carryCharge")] 126 | public string CarryCharge { get; set; } 127 | 128 | [XmlAttribute(AttributeName = "fee")] 129 | public string Fee { get; set; } 130 | 131 | [XmlAttribute(AttributeName = "feeRate")] 132 | public string FeeRate { get; set; } 133 | 134 | [XmlAttribute(AttributeName = "startDate")] 135 | public string StartDate { get; set; } 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/SLBFees.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Collections.Generic; 4 | using System.Xml.Serialization; 5 | 6 | [XmlRoot(ElementName = "SLBFees")] 7 | public class SLBFees 8 | { 9 | [XmlElement(ElementName = "SLBFee")] 10 | public List SLBFee { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/SecuritiesInfo.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Collections.Generic; 4 | using System.Xml.Serialization; 5 | 6 | [XmlRoot(ElementName = "SecuritiesInfo")] 7 | public class SecuritiesInfo 8 | { 9 | [XmlElement(ElementName = "SecurityInfo")] 10 | public List SecurityInfo { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/SecurityInfo.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Xml.Serialization; 4 | 5 | [XmlRoot(ElementName = "SecurityInfo")] 6 | public class SecurityInfo 7 | { 8 | [XmlAttribute(AttributeName = "assetCategory")] 9 | public string AssetCategory { get; set; } 10 | 11 | [XmlAttribute(AttributeName = "symbol")] 12 | public string Symbol { get; set; } 13 | 14 | [XmlAttribute(AttributeName = "description")] 15 | public string Description { get; set; } 16 | 17 | [XmlAttribute(AttributeName = "conid")] 18 | public string Conid { get; set; } 19 | 20 | [XmlAttribute(AttributeName = "securityID")] 21 | public string SecurityID { get; set; } 22 | 23 | [XmlAttribute(AttributeName = "securityIDType")] 24 | public string SecurityIDType { get; set; } 25 | 26 | [XmlAttribute(AttributeName = "cusip")] 27 | public string Cusip { get; set; } 28 | 29 | [XmlAttribute(AttributeName = "isin")] 30 | public string Isin { get; set; } 31 | 32 | [XmlAttribute(AttributeName = "listingExchange")] 33 | public string ListingExchange { get; set; } 34 | 35 | [XmlAttribute(AttributeName = "underlyingConid")] 36 | public string UnderlyingConid { get; set; } 37 | 38 | [XmlAttribute(AttributeName = "underlyingSymbol")] 39 | public string UnderlyingSymbol { get; set; } 40 | 41 | [XmlAttribute(AttributeName = "underlyingSecurityID")] 42 | public string UnderlyingSecurityID { get; set; } 43 | 44 | [XmlAttribute(AttributeName = "underlyingListingExchange")] 45 | public string UnderlyingListingExchange { get; set; } 46 | 47 | [XmlAttribute(AttributeName = "issuer")] 48 | public string Issuer { get; set; } 49 | 50 | [XmlAttribute(AttributeName = "multiplier")] 51 | public string Multiplier { get; set; } 52 | 53 | [XmlAttribute(AttributeName = "strike")] 54 | public string Strike { get; set; } 55 | 56 | [XmlAttribute(AttributeName = "expiry")] 57 | public string Expiry { get; set; } 58 | 59 | [XmlAttribute(AttributeName = "putCall")] 60 | public string PutCall { get; set; } 61 | 62 | [XmlAttribute(AttributeName = "principalAdjustFactor")] 63 | public string PrincipalAdjustFactor { get; set; } 64 | 65 | [XmlAttribute(AttributeName = "maturity")] 66 | public string Maturity { get; set; } 67 | 68 | [XmlAttribute(AttributeName = "issueDate")] 69 | public string IssueDate { get; set; } 70 | 71 | [XmlAttribute(AttributeName = "underlyingCategory")] 72 | public string UnderlyingCategory { get; set; } 73 | 74 | [XmlAttribute(AttributeName = "subCategory")] 75 | public string SubCategory { get; set; } 76 | 77 | [XmlAttribute(AttributeName = "code")] 78 | public string Code { get; set; } 79 | } 80 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/StatementOfFundsLine.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Xml.Serialization; 4 | 5 | [XmlRoot(ElementName = "StatementOfFundsLine")] 6 | public class StatementOfFundsLine 7 | { 8 | [XmlAttribute(AttributeName = "accountId")] 9 | public string AccountId { get; set; } 10 | [XmlAttribute(AttributeName = "acctAlias")] 11 | public string AcctAlias { get; set; } 12 | [XmlAttribute(AttributeName = "activityCode")] 13 | public string ActivityCode { get; set; } 14 | [XmlAttribute(AttributeName = "activityDescription")] 15 | public string ActivityDescription { get; set; } 16 | [XmlAttribute(AttributeName = "amount")] 17 | public string Amount { get; set; } 18 | [XmlAttribute(AttributeName = "assetCategory")] 19 | public string AssetCategory { get; set; } 20 | [XmlAttribute(AttributeName = "balance")] 21 | public string Balance { get; set; } 22 | [XmlAttribute(AttributeName = "buySell")] 23 | public string BuySell { get; set; } 24 | [XmlAttribute(AttributeName = "conid")] 25 | public string Conid { get; set; } 26 | [XmlAttribute(AttributeName = "credit")] 27 | public string Credit { get; set; } 28 | [XmlAttribute(AttributeName = "currency")] 29 | public string Currency { get; set; } 30 | [XmlAttribute(AttributeName = "cusip")] 31 | public string Cusip { get; set; } 32 | [XmlAttribute(AttributeName = "date")] 33 | public string Date { get; set; } 34 | [XmlAttribute(AttributeName = "debit")] 35 | public string Debit { get; set; } 36 | [XmlAttribute(AttributeName = "description")] 37 | public string Description { get; set; } 38 | [XmlAttribute(AttributeName = "expiry")] 39 | public string Expiry { get; set; } 40 | [XmlAttribute(AttributeName = "fxRateToBase")] 41 | public string FxRateToBase { get; set; } 42 | [XmlAttribute(AttributeName = "isin")] 43 | public string Isin { get; set; } 44 | [XmlAttribute(AttributeName = "issuer")] 45 | public string Issuer { get; set; } 46 | [XmlAttribute(AttributeName = "levelOfDetail")] 47 | public string LevelOfDetail { get; set; } 48 | [XmlAttribute(AttributeName = "listingExchange")] 49 | public string ListingExchange { get; set; } 50 | [XmlAttribute(AttributeName = "model")] 51 | public string Model { get; set; } 52 | [XmlAttribute(AttributeName = "multiplier")] 53 | public string Multiplier { get; set; } 54 | [XmlAttribute(AttributeName = "orderID")] 55 | public string OrderID { get; set; } 56 | [XmlAttribute(AttributeName = "principalAdjustFactor")] 57 | public string PrincipalAdjustFactor { get; set; } 58 | [XmlAttribute(AttributeName = "putCall")] 59 | public string PutCall { get; set; } 60 | [XmlAttribute(AttributeName = "reportDate")] 61 | public string ReportDate { get; set; } 62 | [XmlAttribute(AttributeName = "securityID")] 63 | public string SecurityID { get; set; } 64 | [XmlAttribute(AttributeName = "securityIDType")] 65 | public string SecurityIDType { get; set; } 66 | [XmlAttribute(AttributeName = "settleDate")] 67 | public string SettleDate { get; set; } 68 | [XmlAttribute(AttributeName = "strike")] 69 | public string Strike { get; set; } 70 | [XmlAttribute(AttributeName = "symbol")] 71 | public string Symbol { get; set; } 72 | [XmlAttribute(AttributeName = "tradeCode")] 73 | public string TradeCode { get; set; } 74 | [XmlAttribute(AttributeName = "tradeCommission")] 75 | public string TradeCommission { get; set; } 76 | [XmlAttribute(AttributeName = "tradeGross")] 77 | public string TradeGross { get; set; } 78 | [XmlAttribute(AttributeName = "tradeID")] 79 | public string TradeID { get; set; } 80 | [XmlAttribute(AttributeName = "tradePrice")] 81 | public string TradePrice { get; set; } 82 | [XmlAttribute(AttributeName = "tradeQuantity")] 83 | public string TradeQuantity { get; set; } 84 | [XmlAttribute(AttributeName = "tradeTax")] 85 | public string TradeTax { get; set; } 86 | [XmlAttribute(AttributeName = "underlyingConid")] 87 | public string UnderlyingConid { get; set; } 88 | [XmlAttribute(AttributeName = "underlyingListingExchange")] 89 | public string UnderlyingListingExchange { get; set; } 90 | [XmlAttribute(AttributeName = "underlyingSecurityID")] 91 | public string UnderlyingSecurityID { get; set; } 92 | [XmlAttribute(AttributeName = "underlyingSymbol")] 93 | public string UnderlyingSymbol { get; set; } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/StmtFunds.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Collections.Generic; 4 | using System.Xml.Serialization; 5 | 6 | [XmlRoot(ElementName = "StmtFunds")] 7 | public class StmtFunds 8 | { 9 | [XmlElement(ElementName = "StatementOfFundsLine")] 10 | public List StatementOfFundsLine { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/TierInterestDetail.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Xml.Serialization; 4 | 5 | [XmlRoot(ElementName = "TierInterestDetail")] 6 | public class TierInterestDetail 7 | { 8 | [XmlAttribute(AttributeName = "accountId")] 9 | public string AccountId { get; set; } 10 | 11 | [XmlAttribute(AttributeName = "acctAlias")] 12 | public string AcctAlias { get; set; } 13 | 14 | [XmlAttribute(AttributeName = "model")] 15 | public string Model { get; set; } 16 | 17 | [XmlAttribute(AttributeName = "currency")] 18 | public string Currency { get; set; } 19 | 20 | [XmlAttribute(AttributeName = "fxRateToBase")] 21 | public string FxRateToBase { get; set; } 22 | 23 | [XmlAttribute(AttributeName = "code")] 24 | public string Code { get; set; } 25 | 26 | [XmlAttribute(AttributeName = "toAcct")] 27 | public string ToAcct { get; set; } 28 | 29 | [XmlAttribute(AttributeName = "fromAcct")] 30 | public string FromAcct { get; set; } 31 | 32 | [XmlAttribute(AttributeName = "totalInterest")] 33 | public string TotalInterest { get; set; } 34 | 35 | [XmlAttribute(AttributeName = "ibuklInterest")] 36 | public string IbuklInterest { get; set; } 37 | 38 | [XmlAttribute(AttributeName = "commoditiesInterest")] 39 | public string CommoditiesInterest { get; set; } 40 | 41 | [XmlAttribute(AttributeName = "securitiesInterest")] 42 | public string SecuritiesInterest { get; set; } 43 | 44 | [XmlAttribute(AttributeName = "rate")] 45 | public string Rate { get; set; } 46 | 47 | [XmlAttribute(AttributeName = "totalPrincipal")] 48 | public string TotalPrincipal { get; set; } 49 | 50 | [XmlAttribute(AttributeName = "ibuklPrincipal")] 51 | public string IbuklPrincipal { get; set; } 52 | 53 | [XmlAttribute(AttributeName = "commoditiesPrincipal")] 54 | public string CommoditiesPrincipal { get; set; } 55 | 56 | [XmlAttribute(AttributeName = "securitiesPrincipal")] 57 | public string SecuritiesPrincipal { get; set; } 58 | 59 | [XmlAttribute(AttributeName = "balanceThreshold")] 60 | public string BalanceThreshold { get; set; } 61 | 62 | [XmlAttribute(AttributeName = "tierBreak")] 63 | public string TierBreak { get; set; } 64 | 65 | [XmlAttribute(AttributeName = "valueDate")] 66 | public string ValueDate { get; set; } 67 | 68 | [XmlAttribute(AttributeName = "interestType")] 69 | public string InterestType { get; set; } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/TierInterestDetails.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Collections.Generic; 4 | using System.Xml.Serialization; 5 | 6 | [XmlRoot(ElementName = "TierInterestDetails")] 7 | public class TierInterestDetails 8 | { 9 | [XmlElement(ElementName = "TierInterestDetail")] 10 | public List TierInterestDetail { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/TradeConfirms.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Collections.Generic; 4 | using System.Xml.Serialization; 5 | 6 | [XmlRoot(ElementName = "TradeConfirms")] 7 | public class TradeConfirms 8 | { 9 | [XmlElement(ElementName = "TradeConfirm")] 10 | public List TradeConfirm { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/Trades.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Collections.Generic; 4 | using System.Xml.Serialization; 5 | 6 | [XmlRoot(ElementName = "Trades")] 7 | public class Trades 8 | { 9 | [XmlElement(ElementName = "Lot")] 10 | public List Lot { get; set; } 11 | 12 | [XmlElement(ElementName = "Trade")] 13 | public List Trade { get; set; } 14 | 15 | [XmlElement(ElementName = "AssetSummary")] 16 | public List AssetSummary { get; set; } 17 | 18 | [XmlElement(ElementName = "SymbolSummary")] 19 | public List SymbolSummary { get; set; } 20 | 21 | [XmlElement(ElementName = "Order")] 22 | public List Order { get; set; } 23 | } 24 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/TransactionTax.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Xml.Serialization; 4 | 5 | [XmlRoot(ElementName = "Trade")] 6 | public class TransactionTax 7 | { 8 | [XmlAttribute(AttributeName = "accountId")] 9 | public string AccountId { get; set; } 10 | 11 | [XmlAttribute(AttributeName = "acctAlias")] 12 | public string AcctAlias { get; set; } 13 | 14 | [XmlAttribute(AttributeName = "model")] 15 | public string Model { get; set; } 16 | 17 | [XmlAttribute(AttributeName = "currency")] 18 | public string Currency { get; set; } 19 | 20 | [XmlAttribute(AttributeName = "fxRateToBase")] 21 | public string FxRateToBase { get; set; } 22 | 23 | [XmlAttribute(AttributeName = "assetCategory")] 24 | public string AssetCategory { get; set; } 25 | 26 | [XmlAttribute(AttributeName = "symbol")] 27 | public string Symbol { get; set; } 28 | 29 | [XmlAttribute(AttributeName = "description")] 30 | public string Description { get; set; } 31 | 32 | [XmlAttribute(AttributeName = "conid")] 33 | public string Conid { get; set; } 34 | 35 | [XmlAttribute(AttributeName = "securityID")] 36 | public string SecurityID { get; set; } 37 | 38 | [XmlAttribute(AttributeName = "securityIDType")] 39 | public string SecurityIDType { get; set; } 40 | 41 | [XmlAttribute(AttributeName = "cusip")] 42 | public string Cusip { get; set; } 43 | 44 | [XmlAttribute(AttributeName = "isin")] 45 | public string Isin { get; set; } 46 | 47 | [XmlAttribute(AttributeName = "listingExchange")] 48 | public string ListingExchange { get; set; } 49 | 50 | [XmlAttribute(AttributeName = "underlyingConid")] 51 | public string UnderlyingConid { get; set; } 52 | 53 | [XmlAttribute(AttributeName = "underlyingSymbol")] 54 | public string UnderlyingSymbol { get; set; } 55 | 56 | [XmlAttribute(AttributeName = "underlyingSecurityID")] 57 | public string UnderlyingSecurityID { get; set; } 58 | 59 | [XmlAttribute(AttributeName = "underlyingListingExchange")] 60 | public string UnderlyingListingExchange { get; set; } 61 | 62 | [XmlAttribute(AttributeName = "issuer")] 63 | public string Issuer { get; set; } 64 | 65 | [XmlAttribute(AttributeName = "multiplier")] 66 | public string Multiplier { get; set; } 67 | 68 | [XmlAttribute(AttributeName = "strike")] 69 | public string Strike { get; set; } 70 | 71 | [XmlAttribute(AttributeName = "expiry")] 72 | public string Expiry { get; set; } 73 | 74 | [XmlAttribute(AttributeName = "putCall")] 75 | public string PutCall { get; set; } 76 | 77 | [XmlAttribute(AttributeName = "principalAdjustFactor")] 78 | public string PrincipalAdjustFactor { get; set; } 79 | 80 | [XmlAttribute(AttributeName = "date")] 81 | public string Date { get; set; } 82 | 83 | [XmlAttribute(AttributeName = "taxDescription")] 84 | public string TaxDescription { get; set; } 85 | 86 | [XmlAttribute(AttributeName = "quantity")] 87 | public string Quantity { get; set; } 88 | 89 | [XmlAttribute(AttributeName = "reportDate")] 90 | public string ReportDate { get; set; } 91 | 92 | [XmlAttribute(AttributeName = "taxAmount")] 93 | public string TaxAmount { get; set; } 94 | 95 | [XmlAttribute(AttributeName = "tradeID")] 96 | public string TradeID { get; set; } 97 | 98 | [XmlAttribute(AttributeName = "tradePrice")] 99 | public string TradePrice { get; set; } 100 | 101 | [XmlAttribute(AttributeName = "source")] 102 | public string Source { get; set; } 103 | 104 | [XmlAttribute(AttributeName = "code")] 105 | public string Code { get; set; } 106 | 107 | [XmlAttribute(AttributeName = "levelOfDetail")] 108 | public string LevelOfDetail { get; set; } 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/TransactionTaxes.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Collections.Generic; 4 | using System.Xml.Serialization; 5 | 6 | [XmlRoot(ElementName = "TransactionTaxes")] 7 | public class TransactionTaxes 8 | { 9 | [XmlElement(ElementName = "TransactionTax")] 10 | public List TransactionTax { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/Transfer.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Xml.Serialization; 4 | 5 | [XmlRoot(ElementName = "Transfer")] 6 | public class Transfer 7 | { 8 | [XmlAttribute(AttributeName = "accountId")] 9 | public string AccountId { get; set; } 10 | 11 | [XmlAttribute(AttributeName = "acctAlias")] 12 | public string AcctAlias { get; set; } 13 | 14 | [XmlAttribute(AttributeName = "model")] 15 | public string Model { get; set; } 16 | 17 | [XmlAttribute(AttributeName = "currency")] 18 | public string Currency { get; set; } 19 | 20 | [XmlAttribute(AttributeName = "fxRateToBase")] 21 | public string FxRateToBase { get; set; } 22 | 23 | [XmlAttribute(AttributeName = "assetCategory")] 24 | public string AssetCategory { get; set; } 25 | 26 | [XmlAttribute(AttributeName = "symbol")] 27 | public string Symbol { get; set; } 28 | 29 | [XmlAttribute(AttributeName = "description")] 30 | public string Description { get; set; } 31 | 32 | [XmlAttribute(AttributeName = "conid")] 33 | public string Conid { get; set; } 34 | 35 | [XmlAttribute(AttributeName = "securityID")] 36 | public string SecurityID { get; set; } 37 | 38 | [XmlAttribute(AttributeName = "securityIDType")] 39 | public string SecurityIDType { get; set; } 40 | 41 | [XmlAttribute(AttributeName = "cusip")] 42 | public string Cusip { get; set; } 43 | 44 | [XmlAttribute(AttributeName = "isin")] 45 | public string Isin { get; set; } 46 | 47 | [XmlAttribute(AttributeName = "listingExchange")] 48 | public string ListingExchange { get; set; } 49 | 50 | [XmlAttribute(AttributeName = "underlyingConid")] 51 | public string UnderlyingConid { get; set; } 52 | 53 | [XmlAttribute(AttributeName = "underlyingSymbol")] 54 | public string UnderlyingSymbol { get; set; } 55 | 56 | [XmlAttribute(AttributeName = "underlyingSecurityID")] 57 | public string UnderlyingSecurityID { get; set; } 58 | 59 | [XmlAttribute(AttributeName = "underlyingListingExchange")] 60 | public string UnderlyingListingExchange { get; set; } 61 | 62 | [XmlAttribute(AttributeName = "issuer")] 63 | public string Issuer { get; set; } 64 | 65 | [XmlAttribute(AttributeName = "multiplier")] 66 | public string Multiplier { get; set; } 67 | 68 | [XmlAttribute(AttributeName = "strike")] 69 | public string Strike { get; set; } 70 | 71 | [XmlAttribute(AttributeName = "expiry")] 72 | public string Expiry { get; set; } 73 | 74 | [XmlAttribute(AttributeName = "putCall")] 75 | public string PutCall { get; set; } 76 | 77 | [XmlAttribute(AttributeName = "principalAdjustFactor")] 78 | public string PrincipalAdjustFactor { get; set; } 79 | 80 | [XmlAttribute(AttributeName = "reportDate")] 81 | public string ReportDate { get; set; } 82 | 83 | [XmlAttribute(AttributeName = "date")] 84 | public string Date { get; set; } 85 | 86 | [XmlAttribute(AttributeName = "dateTime")] 87 | public string TradeDateTime { get; set; } 88 | 89 | [XmlAttribute(AttributeName = "type")] 90 | public string Type { get; set; } 91 | 92 | [XmlAttribute(AttributeName = "direction")] 93 | public string Direction { get; set; } 94 | 95 | [XmlAttribute(AttributeName = "company")] 96 | public string Company { get; set; } 97 | 98 | [XmlAttribute(AttributeName = "account")] 99 | public string Account { get; set; } 100 | 101 | [XmlAttribute(AttributeName = "accountName")] 102 | public string AccountName { get; set; } 103 | 104 | [XmlAttribute(AttributeName = "quantity")] 105 | public string Quantity { get; set; } 106 | 107 | [XmlAttribute(AttributeName = "transferPrice")] 108 | public string TransferPrice { get; set; } 109 | 110 | [XmlAttribute(AttributeName = "positionAmount")] 111 | public string PositionAmount { get; set; } 112 | 113 | [XmlAttribute(AttributeName = "positionAmountInBase")] 114 | public string PositionAmountInBase { get; set; } 115 | 116 | [XmlAttribute(AttributeName = "pnlAmount")] 117 | public string PnlAmount { get; set; } 118 | 119 | [XmlAttribute(AttributeName = "pnlAmountInBase")] 120 | public string PnlAmountInBase { get; set; } 121 | 122 | [XmlAttribute(AttributeName = "fxPnl")] 123 | public string FxPnl { get; set; } 124 | 125 | [XmlAttribute(AttributeName = "cashTransfer")] 126 | public string CashTransfer { get; set; } 127 | 128 | [XmlAttribute(AttributeName = "code")] 129 | public string Code { get; set; } 130 | 131 | [XmlAttribute(AttributeName = "clientReference")] 132 | public string ClientReference { get; set; } 133 | 134 | [XmlAttribute(AttributeName = "transactionID")] 135 | public string TransactionID { get; set; } 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/Transfers.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Collections.Generic; 4 | using System.Xml.Serialization; 5 | 6 | [XmlRoot(ElementName = "Transfers")] 7 | public class Transfers 8 | { 9 | [XmlElement(ElementName = "Transfer")] 10 | public List Transfer { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/UnbundledCommissionDetail.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Xml.Serialization; 4 | 5 | [XmlRoot(ElementName = "UnbundledCommissionDetail")] 6 | public class UnbundledCommissionDetail 7 | { 8 | [XmlAttribute(AttributeName = "accountId")] 9 | public string AccountId { get; set; } 10 | 11 | [XmlAttribute(AttributeName = "acctAlias")] 12 | public string AcctAlias { get; set; } 13 | 14 | [XmlAttribute(AttributeName = "quantity")] 15 | public string Quantity { get; set; } 16 | 17 | [XmlAttribute(AttributeName = "principalAdjustFactor")] 18 | public string PrincipalAdjustFactor { get; set; } 19 | 20 | [XmlAttribute(AttributeName = "putCall")] 21 | public string PutCall { get; set; } 22 | 23 | [XmlAttribute(AttributeName = "issuer")] 24 | public string Issuer { get; set; } 25 | 26 | [XmlAttribute(AttributeName = "multiplier")] 27 | public string Multiplier { get; set; } 28 | 29 | [XmlAttribute(AttributeName = "strike")] 30 | public string Strike { get; set; } 31 | 32 | [XmlAttribute(AttributeName = "expiry")] 33 | public string Expiry { get; set; } 34 | 35 | [XmlAttribute(AttributeName = "assetCategory")] 36 | public string AssetCategory { get; set; } 37 | 38 | [XmlAttribute(AttributeName = "symbol")] 39 | public string Symbol { get; set; } 40 | 41 | [XmlAttribute(AttributeName = "description")] 42 | public string Description { get; set; } 43 | 44 | [XmlAttribute(AttributeName = "conid")] 45 | public string Conid { get; set; } 46 | 47 | [XmlAttribute(AttributeName = "securityID")] 48 | public string SecurityID { get; set; } 49 | 50 | [XmlAttribute(AttributeName = "securityIDType")] 51 | public string SecurityIDType { get; set; } 52 | 53 | [XmlAttribute(AttributeName = "cusip")] 54 | public string Cusip { get; set; } 55 | 56 | [XmlAttribute(AttributeName = "isin")] 57 | public string Isin { get; set; } 58 | 59 | [XmlAttribute(AttributeName = "listingExchange")] 60 | public string ListingExchange { get; set; } 61 | 62 | [XmlAttribute(AttributeName = "underlyingConid")] 63 | public string UnderlyingConid { get; set; } 64 | 65 | [XmlAttribute(AttributeName = "underlyingSymbol")] 66 | public string UnderlyingSymbol { get; set; } 67 | 68 | [XmlAttribute(AttributeName = "underlyingSecurityID")] 69 | public string UnderlyingSecurityID { get; set; } 70 | 71 | [XmlAttribute(AttributeName = "underlyingListingExchange")] 72 | public string UnderlyingListingExchange { get; set; } 73 | 74 | [XmlAttribute(AttributeName = "orderReference")] 75 | public string OrderReference { get; set; } 76 | 77 | [XmlAttribute(AttributeName = "buySell")] 78 | public string BuySell { get; set; } 79 | 80 | [XmlAttribute(AttributeName = "exchange")] 81 | public string Exchange { get; set; } 82 | 83 | [XmlAttribute(AttributeName = "dateTime")] 84 | public string DateTime { get; set; } 85 | 86 | [XmlAttribute(AttributeName = "tradeID")] 87 | public string TradeID { get; set; } 88 | 89 | [XmlAttribute(AttributeName = "model")] 90 | public string Model { get; set; } 91 | 92 | [XmlAttribute(AttributeName = "currency")] 93 | public string Currency { get; set; } 94 | 95 | [XmlAttribute(AttributeName = "fxRateToBase")] 96 | public string FxRateToBase { get; set; } 97 | 98 | [XmlAttribute(AttributeName = "other")] 99 | public string Other { get; set; } 100 | 101 | [XmlAttribute(AttributeName = "regOther")] 102 | public string RegOther { get; set; } 103 | 104 | [XmlAttribute(AttributeName = "regSection31TransactionFee")] 105 | public string RegSection31TransactionFee { get; set; } 106 | 107 | [XmlAttribute(AttributeName = "regFINRATradingActivityFee")] 108 | public string RegFINRATradingActivityFee { get; set; } 109 | 110 | [XmlAttribute(AttributeName = "thirdPartyRegulatoryCharge")] 111 | public string ThirdPartyRegulatoryCharge { get; set; } 112 | 113 | [XmlAttribute(AttributeName = "thirdPartyClearingCharge")] 114 | public string ThirdPartyClearingCharge { get; set; } 115 | 116 | [XmlAttribute(AttributeName = "thirdPartyExecutionCharge")] 117 | public string ThirdPartyExecutionCharge { get; set; } 118 | 119 | [XmlAttribute(AttributeName = "brokerClearingCharge")] 120 | public string BrokerClearingCharge { get; set; } 121 | 122 | [XmlAttribute(AttributeName = "brokerExecutionCharge")] 123 | public string BrokerExecutionCharge { get; set; } 124 | 125 | [XmlAttribute(AttributeName = "totalCommission")] 126 | public string TotalCommission { get; set; } 127 | 128 | [XmlAttribute(AttributeName = "price")] 129 | public string Price { get; set; } 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/QueryResponse/UnbundledCommissionDetails.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts.QueryResponse 2 | { 3 | using System.Collections.Generic; 4 | using System.Xml.Serialization; 5 | 6 | [XmlRoot(ElementName = "UnbundledCommissionDetails")] 7 | public class UnbundledCommissionDetails 8 | { 9 | [XmlElement(ElementName = "UnbundledCommissionDetail")] 10 | public List UnbundledCommissionDetail { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/XmlBase.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts 2 | { 3 | public abstract class XmlBase 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Contracts/XmlFlexStatementResponse.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml.Contracts 2 | { 3 | using System.Xml.Serialization; 4 | 5 | [XmlRoot("FlexStatementResponse")] 6 | public class XmlFlexStatementResponse : XmlBase 7 | { 8 | public string Status { get; set; } 9 | public long? ReferenceCode { get; set; } 10 | public string Url { get; set; } 11 | public int? ErrorCode { get; set; } 12 | public string ErrorMessage { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/Deserializer.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml 2 | { 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.Xml; 6 | using System.Xml.Serialization; 7 | using IbFlexReader.Contracts; 8 | using IbFlexReader.Utils; 9 | using IbFlexReader.Xml.Contracts; 10 | 11 | public static class Deserializer 12 | { 13 | public static TOut Deserialize(Stream content, out List errorObjects) 14 | where TXml : XmlBase where TOut : class, new() 15 | { 16 | XmlSerializer serializer = new XmlSerializer(typeof(TXml)); 17 | using (XmlReader reader = XmlReader.Create(content)) 18 | { 19 | var obj = (TXml)serializer.Deserialize(reader); 20 | errorObjects = new List(); 21 | return new TOut().PopulateFrom(obj, errorObjects); 22 | } 23 | } 24 | 25 | public static TOut Deserialize(XmlReader content, out List errorObjects) 26 | where TXml : XmlBase where TOut : class, new() 27 | { 28 | XmlSerializer serializer = new XmlSerializer(typeof(TXml)); 29 | var obj = (TXml)serializer.Deserialize(content); 30 | errorObjects = new List(); 31 | return new TOut().PopulateFrom(obj, errorObjects); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/IStreamBuilder.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml 2 | { 3 | using System.IO; 4 | 5 | public interface IStreamBuilder 6 | { 7 | Stream GenerateStream(T content); 8 | } 9 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/IbFlexReader.Xml.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | False 6 | ./../stylecop.ruleset 7 | 8 | 9 | 10 | true 11 | 12 | 13 | 14 | 15 | all 16 | runtime; build; native; contentfiles; analyzers 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | Code 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.Xml/StringStream.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader.Xml 2 | { 3 | using System.IO; 4 | 5 | public class StringStream : IStreamBuilder 6 | { 7 | public Stream GenerateStream(string content) 8 | { 9 | var stream = new MemoryStream(); 10 | var writer = new StreamWriter(stream); 11 | 12 | writer.Write(content); 13 | 14 | writer.Flush(); 15 | 16 | stream.Position = 0; 17 | 18 | return stream; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28010.2026 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IbFlexReader", "IbFlexReader\Biehler.IbFlexReader.csproj", "{9E8052D9-DF98-49AC-B5D2-B1F254330C8F}" 7 | EndProject 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IbFlexReader.Xml", "IbFlexReader.Xml\IbFlexReader.Xml.csproj", "{9A8831DA-29E8-4F17-B2B5-3C4BD0ED54A5}" 9 | EndProject 10 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IbFlexReader.Utils", "IbFlexReader.Utils\IbFlexReader.Utils.csproj", "{5401088F-ECCF-4E3D-8D99-6C31D18E6571}" 11 | EndProject 12 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IbFlexReader.Contracts", "IbFlexReader.Contracts\IbFlexReader.Contracts.csproj", "{21A0A357-2533-429B-AB35-A9D5497263E7}" 13 | EndProject 14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IbFlexReader.Tests", "IbFlexReader.Tests\IbFlexReader.Tests.csproj", "{A50C11A7-F1AD-4741-A22F-9941E8CC4FFB}" 15 | EndProject 16 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3EF9CA9E-6C49-4081-BB66-1E93FCE638F8}" 17 | ProjectSection(SolutionItems) = preProject 18 | .editorconfig = .editorconfig 19 | ..\.travis.yml = ..\.travis.yml 20 | ..\CHANGELOG.md = ..\CHANGELOG.md 21 | ..\LICENSE = ..\LICENSE 22 | ..\README.md = ..\README.md 23 | EndProjectSection 24 | EndProject 25 | Global 26 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 27 | Debug|Any CPU = Debug|Any CPU 28 | Release|Any CPU = Release|Any CPU 29 | EndGlobalSection 30 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 31 | {9E8052D9-DF98-49AC-B5D2-B1F254330C8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 32 | {9E8052D9-DF98-49AC-B5D2-B1F254330C8F}.Debug|Any CPU.Build.0 = Debug|Any CPU 33 | {9E8052D9-DF98-49AC-B5D2-B1F254330C8F}.Release|Any CPU.ActiveCfg = Release|Any CPU 34 | {9E8052D9-DF98-49AC-B5D2-B1F254330C8F}.Release|Any CPU.Build.0 = Release|Any CPU 35 | {9A8831DA-29E8-4F17-B2B5-3C4BD0ED54A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 36 | {9A8831DA-29E8-4F17-B2B5-3C4BD0ED54A5}.Debug|Any CPU.Build.0 = Debug|Any CPU 37 | {9A8831DA-29E8-4F17-B2B5-3C4BD0ED54A5}.Release|Any CPU.ActiveCfg = Release|Any CPU 38 | {9A8831DA-29E8-4F17-B2B5-3C4BD0ED54A5}.Release|Any CPU.Build.0 = Release|Any CPU 39 | {5401088F-ECCF-4E3D-8D99-6C31D18E6571}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 40 | {5401088F-ECCF-4E3D-8D99-6C31D18E6571}.Debug|Any CPU.Build.0 = Debug|Any CPU 41 | {5401088F-ECCF-4E3D-8D99-6C31D18E6571}.Release|Any CPU.ActiveCfg = Release|Any CPU 42 | {5401088F-ECCF-4E3D-8D99-6C31D18E6571}.Release|Any CPU.Build.0 = Release|Any CPU 43 | {21A0A357-2533-429B-AB35-A9D5497263E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 44 | {21A0A357-2533-429B-AB35-A9D5497263E7}.Debug|Any CPU.Build.0 = Debug|Any CPU 45 | {21A0A357-2533-429B-AB35-A9D5497263E7}.Release|Any CPU.ActiveCfg = Release|Any CPU 46 | {21A0A357-2533-429B-AB35-A9D5497263E7}.Release|Any CPU.Build.0 = Release|Any CPU 47 | {A50C11A7-F1AD-4741-A22F-9941E8CC4FFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 48 | {A50C11A7-F1AD-4741-A22F-9941E8CC4FFB}.Debug|Any CPU.Build.0 = Debug|Any CPU 49 | {A50C11A7-F1AD-4741-A22F-9941E8CC4FFB}.Release|Any CPU.ActiveCfg = Release|Any CPU 50 | {A50C11A7-F1AD-4741-A22F-9941E8CC4FFB}.Release|Any CPU.Build.0 = Release|Any CPU 51 | EndGlobalSection 52 | GlobalSection(SolutionProperties) = preSolution 53 | HideSolutionNode = FALSE 54 | EndGlobalSection 55 | GlobalSection(ExtensibilityGlobals) = postSolution 56 | SolutionGuid = {67275CAF-1112-49DD-9686-31C143F3F622} 57 | EndGlobalSection 58 | EndGlobal 59 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader/Biehler.IbFlexReader.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | netstandard2.0 11 | false 12 | False 13 | ./../stylecop.ruleset 14 | 15 | Interactive Brokers Flex Query Reader 16 | Josef Biehler (gabbersepp) 17 | Easily read any flex query. Provides the whole data model. 18 | Josef Biehler (gabbersepp) 19 | https://github.com/gabbersepp/ib-flex-reader 20 | https://github.com/gabbersepp/ib-flex-reader 21 | true 22 | true 23 | snupkg 24 | 2.5.1 25 | 26 | $(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage 27 | 28 | 29 | 30 | true 31 | 32 | 33 | 34 | 35 | all 36 | runtime; build; native; contentfiles; analyzers; buildtransitive 37 | 38 | 39 | all 40 | runtime; build; native; contentfiles; analyzers 41 | 42 | 43 | 44 | 45 | 46 | true 47 | IbFlexReader.Contracts.dll 48 | 49 | 50 | true 51 | IbFlexReader.Utils.dll 52 | 53 | 54 | true 55 | IbFlexReader.Xml.dll 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /IbFlexReader/IbFlexReader/Logic.cs: -------------------------------------------------------------------------------- 1 | namespace IbFlexReader 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using IbFlexReader.Contracts.Enums; 7 | using IbFlexReader.Contracts.Ib; 8 | using IbFlexReader.Utils; 9 | 10 | internal class Logic 11 | { 12 | public static void ProcessStatement(FlexStatement statement, Options options) 13 | { 14 | if (statement != null && options != null && options.SplitUpOpenCloseTrades) 15 | { 16 | statement.Trades.Trade = SplitUpOpenCloseTrades(statement.Trades.Trade, statement.Trades.Lot); 17 | } 18 | } 19 | 20 | private static List SplitUpOpenCloseTrades(List trades, List lots) 21 | { 22 | var ocTrades = trades 23 | .Where(t => t.OpenCloseIndicator.HasValue && t.OpenCloseIndicator.Value.Matches(x => x.HasFlag(OpenClose.C) && x.HasFlag(OpenClose.O))); 24 | var remainingTrades = trades.Where(x => !ocTrades.Contains(x)).ToList(); 25 | 26 | foreach (var ocTrade in ocTrades) 27 | { 28 | var lot = lots.First(x => x.TradeDateTime == ocTrade.TradeDateTime && x.BuySell == ocTrade.BuySell && x.Description == ocTrade.Description); 29 | var copy = ocTrade.Clone(); 30 | 31 | // ocTrade must be the "close" and the copy the "open" 32 | 33 | var newQ = Math.Sign(ocTrade.Quantity.Value) * Math.Abs(lot.Quantity.Value); 34 | ocTrade.OpenCloseIndicator = OpenClose.C; 35 | ocTrade.TradeMoney = (ocTrade.TradeMoney / Math.Abs(ocTrade.Quantity.Value)) * Math.Abs(newQ); 36 | ocTrade.Proceeds = (ocTrade.Proceeds / Math.Abs(ocTrade.Quantity.Value)) * Math.Abs(newQ); 37 | ocTrade.IbCommission = (ocTrade.IbCommission / Math.Abs(ocTrade.Quantity.Value)) * Math.Abs(newQ); 38 | ocTrade.Quantity = newQ; 39 | 40 | copy.OpenCloseIndicator = OpenClose.O; 41 | copy.FifoPnlRealized = 0; 42 | copy.Quantity = Math.Sign(copy.Quantity.Value) * (Math.Abs(copy.Quantity.Value) - Math.Abs(ocTrade.Quantity.Value)); 43 | copy.TradeMoney = copy.TradeMoney - ocTrade.TradeMoney; 44 | copy.Proceeds = copy.Proceeds - ocTrade.Proceeds; 45 | copy.IbCommission = copy.IbCommission - ocTrade.IbCommission; 46 | 47 | remainingTrades.Add(ocTrade); 48 | remainingTrades.Add(copy); 49 | } 50 | 51 | return remainingTrades; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /IbFlexReader/stylecop.ruleset: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 gabbersepp 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /PROJECT.md: -------------------------------------------------------------------------------- 1 | # ib-flex-reader 2 | 3 | This library can help you with fetching flex queries from Interactive Brokers. 4 | 5 | ## Usage 6 | 7 | Simple call the library by passing your token and queryId: 8 | 9 | ```c# 10 | ... 11 | FlexResult result = new Reader().GetByApi(token, queryId).Result; 12 | ... 13 | ``` 14 | 15 | Or pass an already downloaded file: 16 | 17 | ```c# 18 | ... 19 | FlexQueryResponse result = new Reader().GetByString(content); 20 | ... 21 | ``` 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ib-flex-reader 2 | 3 | This library can help you with fetching flex queries from Interactive Brokers. 4 | Just pass Token and Query ID and wait until it has finished. 5 | 6 | [![Build Status](https://travis-ci.org/gabbersepp/ib-flex-reader.svg?branch=master)](https://travis-ci.org/gabbersepp/ib-flex-reader) [![Nuget](https://img.shields.io/nuget/v/Biehler.IbFlexReader.svg?style=popout)](https://www.nuget.org/packages/Biehler.IbFlexReader/) 7 | 8 | ## Usage 9 | 10 | Simple call the library by passing your token and queryId: 11 | 12 | ```c# 13 | ... 14 | FlexResult result = new Reader().GetByApi(token, queryId).Result; 15 | ... 16 | ``` 17 | 18 | Or pass an already downloaded file: 19 | 20 | ```c# 21 | ... 22 | FlexQueryResponse result = new Reader().GetByString(content); 23 | ... 24 | ``` 25 | 26 | ## Install 27 | `nuget install Biehler.IbFlexReader` 28 | 29 | ## Requirements 30 | It requires your application to be .NET Standard 2.0 compliant. 31 | 32 | ## IB Setup 33 | Please read the wiki to be informed about the required IB setup. 34 | 35 | ## [Release Notes](https://github.com/gabbersepp/ib-flex-reader/releases) 36 | 37 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | codecov: 2 | token: 480eb561-dc4b-4921-ab96-7bf123fb2f22 -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "config:base" 4 | ] 5 | } 6 | --------------------------------------------------------------------------------