Skip to content

Commit

Permalink
feat: Full chain streaming prototypes (#1092)
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Skender <[email protected]>
  • Loading branch information
DaveSkender authored Oct 27, 2024
1 parent eeb02bc commit 0605107
Show file tree
Hide file tree
Showing 801 changed files with 22,282 additions and 21,354 deletions.
16 changes: 1 addition & 15 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,9 @@ max_line_length = 150
trim_trailing_whitespace = true
insert_final_newline = true

[*.{csproj,props,targets}]
indent_style = space
indent_size = 2

[*.yml]
indent_style = space
indent_size = 2

[*.{cs,vb}]
tab_width = 4
indent_size = 4
end_of_line = lf

#### Naming styles ####

Expand Down Expand Up @@ -70,11 +61,6 @@ dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case

dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case

dotnet_code_quality_unused_parameters = all:suggestion

dotnet_sort_system_directives_first = true
Expand All @@ -87,7 +73,7 @@ dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_object_initializer = true:suggestion
dotnet_style_prefer_collection_expression = true:suggestion
dotnet_style_prefer_collection_expression = false:suggestion

[*.cs]
# ref: https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/csharp-formatting-options
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ body:
render: csharp
placeholder: |
// example (put your own code here)
IEnumerable<EmaResult> results = quotes.GetEma(14);
IReadOnlyList<EmaResult> results = quotes.GetEma(14);
validations:
required: false
- type: textarea
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: Examples

on:
push:
branches: ["main"]
branches: ["main","v3"]
paths:
- docs/examples/**

pull_request:
branches: ["main"]
branches: ["main","v3"]
paths:
- docs/examples/**
- ".github/workflows/test-examples.yml"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-indicators.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
dotnet-version: ["2.0.x", "6.x", "8.x"]
dotnet-version: ["6.x", "8.x"]

env:

Expand Down
21 changes: 19 additions & 2 deletions .github/workflows/test-performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,29 @@ jobs:
--configuration Release
--property:ContinuousIntegrationBuild=true
- name: Benchmark indicators
- name: Test performance
working-directory: tests/performance
run: dotnet run -c Release

- name: Save test results
uses: actions/upload-artifact@v4
with:
name: test-summaries
path: tests/performance/BenchmarkDotNet.Artifacts/results

- name: Publish summary
working-directory: tests/performance/BenchmarkDotNet.Artifacts/results
run: |
echo "### Package version ${{ steps.gitversion.outputs.fullSemVer }}" >> $GITHUB_STEP_SUMMARY
cat Tests.Performance.IndicatorsStatic-report-github.md >> $GITHUB_STEP_SUMMARY
echo "## Series indicators" >> $GITHUB_STEP_SUMMARY
cat Performance.SeriesIndicators-report-github.md >> $GITHUB_STEP_SUMMARY
echo "## Stream indicators (with Quote caching)" >> $GITHUB_STEP_SUMMARY
cat Performance.StreamIndicators-report-github.md >> $GITHUB_STEP_SUMMARY
echo "## Incremental indicators (with buffer)" >> $GITHUB_STEP_SUMMARY
cat Performance.Incrementals-report-github.md >> $GITHUB_STEP_SUMMARY
echo "## Utilities" >> $GITHUB_STEP_SUMMARY
cat Performance.Utility-report-github.md >> $GITHUB_STEP_SUMMARY
4 changes: 3 additions & 1 deletion .github/workflows/test-website-a11y.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: Website

on:
push:
branches: ["v3"]
pull_request:
branches: [main]
branches: ["main"]
paths:
- 'docs/**'
- ".github/workflows/test-website-a11y.yml"
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test-website-links.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: Website

on:
push:
branches: ["v3"]
pull_request:
branches: [main]
branches: ["main"]
paths:
- 'docs/**'
- ".github/workflows/test-website-links.yml"
Expand Down
13 changes: 7 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,13 @@ $tf/
# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
# ReSharper IDE extension
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
*.DotSettings

# JustCode is a .NET coding add-in
# JustCode IDE extension
.JustCode

# TeamCity is a build add-in
Expand Down Expand Up @@ -218,7 +219,7 @@ ClientBin/
*.publishsettings
orleans.codegen.cs

# Including strong name files can present a security risk
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk

Expand Down Expand Up @@ -314,7 +315,7 @@ __pycache__/
# OpenCover UI analysis results
OpenCover/

# Azure Stream Analytics local run output
# Azure Stream Analytics local run output
ASALocalRun/

# MSBuild Binary and Structured Log
Expand All @@ -323,11 +324,11 @@ ASALocalRun/
# NVidia Nsight GPU debugger configuration file
*.nvuser

# MFractors (Xamarin productivity tool) working folder
# MFractors (Xamarin productivity tool) working folder
.mfractor/

# Jekyll site
_site/

# zip artifacts
.DS_Store
.DS_Store
9 changes: 7 additions & 2 deletions Stock.Indicators.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tests.Other", "tests\other\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tests.Performance", "tests\performance\Tests.Performance.csproj", "{3BD4837B-D197-41FD-A286-A3256D0770E1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Observe.Streaming", "tests\observe\Observe.Streaming.csproj", "{14DEC3AF-9AF2-4A66-8BEE-C342C6CC4307}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test.Application", "tests\application\Test.Application.csproj", "{14DEC3AF-9AF2-4A66-8BEE-C342C6CC4307}"
ProjectSection(ProjectDependencies) = postProject
{11CD6C7E-871F-4903-AEAD-58E034C6521D} = {11CD6C7E-871F-4903-AEAD-58E034C6521D}
{8D0F1781-EDA3-4C51-B05D-D33FF1156E49} = {8D0F1781-EDA3-4C51-B05D-D33FF1156E49}
EndProjectSection
EndProject

Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test.Simulation", "tests\simulate\Test.Simulation.csproj", "{9C9045D2-9928-41F8-97FC-ECCBDD3B9868}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -52,6 +53,10 @@ Global
{14DEC3AF-9AF2-4A66-8BEE-C342C6CC4307}.Debug|Any CPU.Build.0 = Debug|Any CPU
{14DEC3AF-9AF2-4A66-8BEE-C342C6CC4307}.Release|Any CPU.ActiveCfg = Release|Any CPU
{14DEC3AF-9AF2-4A66-8BEE-C342C6CC4307}.Release|Any CPU.Build.0 = Release|Any CPU
{9C9045D2-9928-41F8-97FC-ECCBDD3B9868}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9C9045D2-9928-41F8-97FC-ECCBDD3B9868}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9C9045D2-9928-41F8-97FC-ECCBDD3B9868}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9C9045D2-9928-41F8-97FC-ECCBDD3B9868}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
10 changes: 5 additions & 5 deletions docs/_data/aliases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,23 @@
type: price-characteristic

- title: HL2
permalink: /indicators/BasicQuote/
permalink: /indicators/quotepart/
type: price-transform

- title: HLC3
permalink: /indicators/BasicQuote/
permalink: /indicators/quotepart/
type: price-transform

- title: OC2
permalink: /indicators/BasicQuote/
permalink: /indicators/quotepart/
type: price-transform

- title: OHL3
permalink: /indicators/BasicQuote/
permalink: /indicators/quotepart/
type: price-transform

- title: OHLC4
permalink: /indicators/BasicQuote/
permalink: /indicators/quotepart/
type: price-transform

- title: Price Channels
Expand Down
2 changes: 1 addition & 1 deletion docs/_includes/candle-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

| name | type | notes
| -- |-- |--
| `Date` | DateTime | Date
| `Timestamp` | DateTime | Close date
| `Open` | decimal | Open price
| `High` | decimal | High price
| `Low` | decimal | Low price
Expand Down
2 changes: 1 addition & 1 deletion docs/_includes/candle-result.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### CandleResult

**`Date`** _`DateTime`_ - Date
**`Timestamp`** _`DateTime`_ - Time of last trade in candle period

**`Price`** _`decimal`_ - Price of the most relevant OHLC candle element when a signal is present

Expand Down
18 changes: 4 additions & 14 deletions docs/_indicators/Adl.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,11 @@ Created by Marc Chaikin, the [Accumulation/Distribution Line/Index](https://en.w

```csharp
// C# usage syntax
IEnumerable<AdlResult> results =
IReadOnlyList<AdlResult> results =
quotes.GetAdl();

// usage with optional overlay SMA of ADL (shown above)
IEnumerable<AdlResult> results =
quotes.GetAdl(smaPeriods);
```

## Parameters

**`smaPeriods`** _`int`_ - Optional. Number of periods (`N`) in the moving average of ADL. Must be greater than 0, if specified.

### Historical quotes requirements
## Historical quotes requirements

You must have at least two historical quotes to cover the warmup periods; however, since this is a trendline, more is recommended.

Expand All @@ -37,7 +29,7 @@ You must have at least two historical quotes to cover the warmup periods; howeve
## Response

```csharp
IEnumerable<AdlResult>
IReadOnlyList<AdlResult>
```

- This method returns a time series of all available indicator values for the `quotes` provided.
Expand All @@ -46,16 +38,14 @@ IEnumerable<AdlResult>

### AdlResult

**`Date`** _`DateTime`_ - Date from evaluated `TQuote`
**`Timestamp`** _`DateTime`_ - date from evaluated `TQuote`

**`MoneyFlowMultiplier`** _`double`_ - Money Flow Multiplier

**`MoneyFlowVolume`** _`double`_ - Money Flow Volume

**`Adl`** _`double`_ - Accumulation Distribution Line (ADL)

**`AdlSma`** _`double`_ - Moving average (SMA) of ADL based on `smaPeriods` periods, if specified

> &#128681; **Warning**: absolute values in ADL and MFV are somewhat meaningless. Use with caution.
### Utilities
Expand Down
6 changes: 3 additions & 3 deletions docs/_indicators/Adx.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Created by J. Welles Wilder, the Directional Movement Index (DMI) and [Average D

```csharp
// C# usage syntax
IEnumerable<AdxResult> results =
IReadOnlyList<AdxResult> results =
quotes.GetAdx(lookbackPeriods);
```

Expand All @@ -33,7 +33,7 @@ You must have at least `2×N+100` periods of `quotes` to cover the [warmup and c
## Response

```csharp
IEnumerable<AdxResult>
IReadOnlyList<AdxResult>
```

- This method returns a time series of all available indicator values for the `quotes` provided.
Expand All @@ -45,7 +45,7 @@ IEnumerable<AdxResult>
### AdxResult

**`Date`** _`DateTime`_ - Date from evaluated `TQuote`
**`Timestamp`** _`DateTime`_ - date from evaluated `TQuote`

**`Pdi`** _`double`_ - Plus Directional Index (+DI)

Expand Down
6 changes: 3 additions & 3 deletions docs/_indicators/Alligator.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Created by Bill Williams, Alligator is a depiction of three smoothed moving aver

```csharp
// C# usage syntax
IEnumerable<AlligatorResult> results =
IReadOnlyList<AlligatorResult> results =
quotes.GetAlligator(jawPeriods,jawOffset,teethPeriods,teethOffset,lipsPeriods,lipsOffset);
```

Expand All @@ -43,7 +43,7 @@ You must have at least `JP+JO+100` periods of `quotes` to cover the [warmup and
## Response

```csharp
IEnumerable<AlligatorResult>
IReadOnlyList<AlligatorResult>
```

- This method returns a time series of all available indicator values for the `quotes` provided.
Expand All @@ -55,7 +55,7 @@ IEnumerable<AlligatorResult>
### AlligatorResult

**`Date`** _`DateTime`_ - Date from evaluated `TQuote`
**`Timestamp`** _`DateTime`_ - date from evaluated `TQuote`

**`Jaw`** _`double`_ - Alligator's Jaw

Expand Down
6 changes: 3 additions & 3 deletions docs/_indicators/Alma.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Created by Arnaud Legoux and Dimitrios Kouzis-Loukas, [ALMA]({{site.github.repos

```csharp
// C# usage syntax
IEnumerable<AlmaResult> results =
IReadOnlyList<AlmaResult> results =
quotes.GetAlma(lookbackPeriods, offset, sigma);
```

Expand All @@ -37,7 +37,7 @@ You must have at least `N` periods of `quotes` to cover the warmup periods.
## Response

```csharp
IEnumerable<AlmaResult>
IReadOnlyList<AlmaResult>
```

- This method returns a time series of all available indicator values for the `quotes` provided.
Expand All @@ -47,7 +47,7 @@ IEnumerable<AlmaResult>

### AlmaResult

**`Date`** _`DateTime`_ - Date from evaluated `TQuote`
**`Timestamp`** _`DateTime`_ - date from evaluated `TQuote`

**`Alma`** _`double`_ - Arnaud Legoux Moving Average

Expand Down
Loading

0 comments on commit 0605107

Please sign in to comment.