Skip to content

Commit

Permalink
semantic versioning in build (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveSkender authored Jan 1, 2020
1 parent cd444ef commit ecdcff1
Show file tree
Hide file tree
Showing 19 changed files with 131 additions and 27 deletions.
27 changes: 27 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/IndicatorsTests/bin/Debug/netcoreapp3.1/IndicatorsTests.dll",
"args": [],
"cwd": "${workspaceFolder}/IndicatorsTests",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
13 changes: 13 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"files.exclude": {
"**/.vs/**": true,
"**/bin/**": true,
"**/obj/**": true,
"**/TestResults/**": true
},
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 3000,
"search.exclude": {
// auto includes files.exclude
}
}
42 changes: 42 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/IndicatorsTests/IndicatorsTests.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/IndicatorsTests/IndicatorsTests.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"${workspaceFolder}/IndicatorsTests/IndicatorsTests.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
}
]
}
14 changes: 10 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ We are not accepting things that should be done in your own extension code:
- Personal customizations and preferences
- Modified or augmented outputs that are not backed by standard definitions

## Reporting bugs
## Reporting bug or feature requests

If you are reporting a bug, please submit an Issue with a detailed description of the problem. Be sure to include steps to reproduce, code samples, and any reference materials.
If you are reporting a bug or feature request, please [submit an Issue](https://github.com/DaveSkender/Stock.Indicators/issues) with a detailed description of the problem or recommended feature. For bugs, be sure to include steps to reproduce, code samples, and any reference materials.

## Developing

Expand All @@ -23,7 +23,6 @@ If you are reporting a bug, please submit an Issue with a detailed description o
- If you are adding a new indicator, the easiest way to do this is to copy the folder of an existing indicator and rename everything using the same naming conventions and taxonomy.
- All new indicators should include unit tests.
- Update the main README file if you're adding a new indicator, and the README file for the individual indicator. This is our only user documentation.
- Increment the Package and Assembly versions in the Indicators project properties (see the Symantic Versioning link below for guidance).
- Do not comingle multiple contributions. Please keep changes small and separate.

## Testing
Expand Down Expand Up @@ -53,9 +52,16 @@ For the NuGet packaging, we're using:
- [Symantic Version 2.0](https://semver.org/)
- [NuGet best practices](https://docs.microsoft.com/en-us/dotnet/standard/library-guidance/nuget)

## About versioning

- We use the `GitVersion` tool for versioning. It is mostly auto generated in the [Azure DevOps build](https://dev.azure.com/skender/Stock.Indicators/_build?definitionId=18)
- Adding `+semver: major` as a commit message will increment the major x.-.- element
- Adding `+semver: minor` as a commit message will increment the minor -.x.- element
- Adding `+semver: patch` as a commit message will increment the minor -.-.x element. Patch element auto-increments, so you'd only need to do this to override the next value.

## Questions?

Contact me through my GitHub profile (preferred) or submit an Issue with your question if it may be relevant for others.
Contact us through the NuGet [Contact Owners](https://www.nuget.org/packages/Skender.Stock.Indicators) method (preferred) or [submit an Issue](https://github.com/DaveSkender/Stock.Indicators/issues) with your question if it is publicly relevant.

Thanks,
Dave Skender
2 changes: 1 addition & 1 deletion Indicators/GUIDE.md → GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ IEnumerable<Quote> history = GetHistoryFromFeed("SPY");

// preclean
history = Cleaners.PrepareHistory(history);
```
```
2 changes: 1 addition & 1 deletion Indicators/BollingerBands/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ IEnumerable<BollingerBandsResult> results = Indicator.GetBollingerBands(history,

| name | type | notes
| -- |-- |--
| `history` | IEnumerable\<[Quote](../GUIDE.md#Quote)\> | Historical Quotes data should be at any consistent frequency (day, hour, minute, etc). You must supply at least `N` periods of `history`.
| `history` | IEnumerable\<[Quote](/GUIDE.md#Quote)\> | Historical Quotes data should be at any consistent frequency (day, hour, minute, etc). You must supply at least `N` periods of `history`.
| `lookbackPeriod` | int | Number of periods (`N`) for the center line moving average
| `standardDeviation` | int | Width of bands. Standard deviations (`D`) from the moving average

Expand Down
2 changes: 1 addition & 1 deletion Indicators/Ema/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ IEnumerable<EmaResult> results = Indicator.GetEma(history, lookbackPeriod);

| name | type | notes
| -- |-- |--
| `history` | IEnumerable\<[Quote](../GUIDE.md#Quote)\> | Historical Quotes data should be at any consistent frequency (day, hour, minute, etc). You must supply at least 2×`N` periods of `history`. Since this uses a smoothing technique, we recommend you use at least 250 data points prior to the intended usage date for maximum precision.
| `history` | IEnumerable\<[Quote](/GUIDE.md#Quote)\> | Historical Quotes data should be at any consistent frequency (day, hour, minute, etc). You must supply at least 2×`N` periods of `history`. Since this uses a smoothing technique, we recommend you use at least 250 data points prior to the intended usage date for maximum precision.
| `lookbackPeriod` | int | Number of periods (`N`) in the moving average.

## Response
Expand Down
2 changes: 1 addition & 1 deletion Indicators/HeikinAshi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ IEnumerable<HeikinAshiResult> results = Indicator.GetHeikinAshi(history);

| name | type | notes
| -- |-- |--
| `history` | IEnumerable\<[Quote](../GUIDE.md#Quote)\> | Historical Quotes data should be at any consistent frequency (day, hour, minute, etc).
| `history` | IEnumerable\<[Quote](/GUIDE.md#Quote)\> | Historical Quotes data should be at any consistent frequency (day, hour, minute, etc).

## Response

Expand Down
20 changes: 12 additions & 8 deletions Indicators/Indicators.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

<PropertyGroup>
<TargetFrameworks>netcoreapp2.2;netcoreapp3.1;netstandard2.0;netstandard2.1;net462;net472;net48</TargetFrameworks>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.0.4-preview</Version>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<Version>0.0.0</Version>
<Authors>Dave Skender</Authors>
<Company></Company>
<Product>Stock Indicators</Product>
<Description>Stock indicators. Send stock market historical data in and you get desired indicators (such as moving average, relative strength, etc) out. Nothing more.</Description>
<Description>Stock indicators. Send stock market historical data in and get desired indicators (such as moving average, relative strength, etc) out. Nothing more.</Description>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageProjectUrl>https://dev.azure.com/skender/Stock.Indicators</PackageProjectUrl>
<RepositoryUrl>https://github.com/DaveSkender/Stock.Indicators</RepositoryUrl>
<RepositoryType>GitHub (Git)</RepositoryType>
<PackageId>Skender.Stock.Indicators</PackageId>
<PackageReleaseNotes>This software is currently in active pre-release development.</PackageReleaseNotes>
<AssemblyName>Stock.Indicators</AssemblyName>
<AssemblyVersion>0.0.4.0</AssemblyVersion>
<FileVersion>0.0.4.0</FileVersion>
<PackageReleaseNotes>This software is currently in active pre-release development.
Please contribute to help us get to v1.0.0</PackageReleaseNotes>
<AssemblyName>Skender.Stock.Indicators</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<FileVersion>0.0.0.0</FileVersion>
<Copyright>@2020 Dave Skender</Copyright>
<RootNamespace>Skender.Stock.Indicators</RootNamespace>
<LangVersion>8.0</LangVersion>
Expand All @@ -26,6 +26,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="GitVersionTask" Version="5.1.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
2 changes: 1 addition & 1 deletion Indicators/Macd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ IEnumerable<MacdResult> results = Indicator.GetMacd(history, fastPeriod, slowPer

| name | type | notes
| -- |-- |--
| `history` | IEnumerable\<[Quote](../GUIDE.md#Quote)\> | Historical Quotes data should be at any consistent frequency (day, hour, minute, etc). You must supply at least slow period + signal period worth of `history`. Since this uses a smoothing technique, we recommend you use at least 250 data points prior to the intended usage date for maximum precision.
| `history` | IEnumerable\<[Quote](/GUIDE.md#Quote)\> | Historical Quotes data should be at any consistent frequency (day, hour, minute, etc). You must supply at least slow period + signal period worth of `history`. Since this uses a smoothing technique, we recommend you use at least 250 data points prior to the intended usage date for maximum precision.
| `fastPeriod` | int | Number of periods (`N`) for the faster moving average.
| `slowPeriod` | int | Number of periods (`N`) for the slower moving average.
| `signalPeriod` | int | Number of periods (`N`) for the moving average of MACD.
Expand Down
2 changes: 1 addition & 1 deletion Indicators/ParabolicSar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ IEnumerable<ParabolicSarResult> results = Indicator.GetParabolicSar(history, acc

| name | type | notes
| -- |-- |--
| `history` | IEnumerable\<[Quote](../GUIDE.md#Quote)\> | Historical Quotes data should be at any consistent frequency (day, hour, minute, etc). Provide sufficient history to capture prior trend reversals, before your usage period.
| `history` | IEnumerable\<[Quote](/GUIDE.md#Quote)\> | Historical Quotes data should be at any consistent frequency (day, hour, minute, etc). Provide sufficient history to capture prior trend reversals, before your usage period.
| `accelerationStep` | decimal | Incremental step size
| `maxAccelerationFactor` | decimal | Maximimum step limit

Expand Down
2 changes: 1 addition & 1 deletion Indicators/Rsi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ IEnumerable<RsiResult> results = Indicator.GetRsi(history, lookbackPeriod);

| name | type | notes
| -- |-- |--
| `history` | IEnumerable\<[Quote](../GUIDE.md#Quote)\> | Historical Quotes data should be at any consistent frequency (day, hour, minute, etc). You must supply at least `N` periods of `history`. Since this uses a smoothing technique, we recommend you use at least 250 data points prior to the intended usage date for maximum precision.
| `history` | IEnumerable\<[Quote](/GUIDE.md#Quote)\> | Historical Quotes data should be at any consistent frequency (day, hour, minute, etc). You must supply at least `N` periods of `history`. Since this uses a smoothing technique, we recommend you use at least 250 data points prior to the intended usage date for maximum precision.
| `lookbackPeriod` | int | Number of periods (`N`) in the lookback period.

## Response
Expand Down
2 changes: 1 addition & 1 deletion Indicators/Sma/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ IEnumerable<SmaResult> results = Indicator.GetSma(history, lookbackPeriod);

| name | type | notes
| -- |-- |--
| `history` | IEnumerable\<[Quote](../GUIDE.md#Quote)\> | Historical Quotes data should be at any consistent frequency (day, hour, minute, etc). You must supply at least `N` periods of `history`.
| `history` | IEnumerable\<[Quote](/GUIDE.md#Quote)\> | Historical Quotes data should be at any consistent frequency (day, hour, minute, etc). You must supply at least `N` periods of `history`.
| `lookbackPeriod` | int | Number of periods (`N`) in the moving average.

## Response
Expand Down
2 changes: 1 addition & 1 deletion Indicators/Stoch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ IEnumerable<StochResult> results = Indicator.GetStoch(history, lookbackPeriod, s

| name | type | notes
| -- |-- |--
| `history` | IEnumerable\<[Quote](../GUIDE.md#Quote)\> | Historical Quotes data should be at any consistent frequency (day, hour, minute, etc). You must supply at least `N` periods of `history`.
| `history` | IEnumerable\<[Quote](/GUIDE.md#Quote)\> | Historical Quotes data should be at any consistent frequency (day, hour, minute, etc). You must supply at least `N` periods of `history`.
| `lookbackPeriod` | int | Number of periods (`N`) in the lookback period to calculate the Oscillator (%K)
| `signalPeriod` | int | Lookback period for the signal (%D)
| `smoothingPeriod` | int | Smoothes the Oscillator (%K). "Slow" stochastic uses 3, "Fast" stochastic uses 1. You can specify as needed here.
Expand Down
2 changes: 1 addition & 1 deletion Indicators/Ulcer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ IEnumerable<UlcerIndexResult> results = Indicator.GetUlcerIndex(history, lookbac

| name | type | notes
| -- |-- |--
| `history` | IEnumerable\<[Quote](../GUIDE.md#Quote)\> | Historical Quotes data should be at any consistent frequency (day, hour, minute, etc). You must supply at least `N` periods of `history`.
| `history` | IEnumerable\<[Quote](/GUIDE.md#Quote)\> | Historical Quotes data should be at any consistent frequency (day, hour, minute, etc). You must supply at least `N` periods of `history`.
| `lookbackPeriod` | int | Number of periods (`N`) for review.

## Response
Expand Down
2 changes: 1 addition & 1 deletion IndicatorsTests/IndicatorsTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

[Skender.Stock.Indicators](https://www.nuget.org/packages/Skender.Stock.Indicators) is a multi-targeting framework .NET library that produces stock indicators. Send in stock history and get back the desired indicators. Nothing more.

![Build Status](https://dev.azure.com/skender/Stock.Indicators/_apis/build/status/Stock.Indicators?branchName=master)

## Installation and setup

Find and install the [Skender.Stock.Indicators](https://www.nuget.org/packages/Skender.Stock.Indicators) package into your Project. See [more help](https://www.google.com/search?q=install+nuget+package) for installing NuGet packages;
Expand All @@ -18,11 +20,11 @@ using Skender.Stock.Indicators;

## How to use for individual indicators

- [Simple Moving Average (SMA)](/Indicators/Sma/README.md)
- [Exponential Moving Average (EMA)](/Indicators/Ema/README.md)
- [Simple Moving Average](/Indicators/Sma/README.md)
- [Exponential Moving Average](/Indicators/Ema/README.md)
- [Moving Average Convergence/Divergence (MACD)](/Indicators/Macd/README.md)
- [Relative Strength Index (RSI)](/Indicators/Rsi/README.md)
- [Stochastic Oscillator (STOCH)](/Indicators/Stoch/README.md)
- [Stochastic Oscillator](/Indicators/Stoch/README.md)
- [Heikin-Ashi](/Indicators/HeikinAshi/README.md)
- [Bollinger Bands](/Indicators/BollingerBands/README.md)
- [Ulcer Index](/Indicators/Ulcer/README.md)
Expand All @@ -33,7 +35,7 @@ using Skender.Stock.Indicators;
Most indicators require that you provide historical quote data and additional configuration parameters.

You can get historical quotes from your favorite stock data provider.
Historical data is an `IEnumerable` of the `Quote` class. [More info...](/Indicators/GUIDE.md#Quotes)
Historical data is an `IEnumerable` of the `Quote` class. [More info...](/GUIDE.md#Quote)

For additional configuration parameters, default values are provided when there is an industry standard.
You can, of course, override these and provide your own values.
Expand Down
1 change: 1 addition & 0 deletions StockIndicators.sln
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
.gitattributes = .gitattributes
.gitignore = .gitignore
CONTRIBUTING.md = CONTRIBUTING.md
gitversion.yml = gitversion.yml
LICENSE.md = LICENSE.md
README.md = README.md
EndProjectSection
Expand Down
9 changes: 9 additions & 0 deletions gitversion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
mode: Mainline
next-version: 0.0.0
branches:
feature:
tag: preview
master:
tag: ''
ignore:
sha: []

0 comments on commit ecdcff1

Please sign in to comment.