From ecdcff10c4bf2cc8672741b27085c8276d43d1f5 Mon Sep 17 00:00:00 2001 From: Dave Skender <8432125+DaveSkender@users.noreply.github.com> Date: Wed, 1 Jan 2020 17:20:01 -0500 Subject: [PATCH] semantic versioning in build (#6) --- .vscode/launch.json | 27 +++++++++++++++++ .vscode/settings.json | 13 ++++++++ .vscode/tasks.json | 42 ++++++++++++++++++++++++++ CONTRIBUTING.md | 14 ++++++--- Indicators/GUIDE.md => GUIDE.md | 2 +- Indicators/BollingerBands/README.md | 2 +- Indicators/Ema/README.md | 2 +- Indicators/HeikinAshi/README.md | 2 +- Indicators/Indicators.csproj | 20 +++++++----- Indicators/Macd/README.md | 2 +- Indicators/ParabolicSar/README.md | 2 +- Indicators/Rsi/README.md | 2 +- Indicators/Sma/README.md | 2 +- Indicators/Stoch/README.md | 2 +- Indicators/Ulcer/README.md | 2 +- IndicatorsTests/IndicatorsTests.csproj | 2 +- README.md | 10 +++--- StockIndicators.sln | 1 + gitversion.yml | 9 ++++++ 19 files changed, 131 insertions(+), 27 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 .vscode/settings.json create mode 100644 .vscode/tasks.json rename Indicators/GUIDE.md => GUIDE.md (99%) create mode 100644 gitversion.yml diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..dd3546cf9 --- /dev/null +++ b/.vscode/launch.json @@ -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}" + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..f1d2eff63 --- /dev/null +++ b/.vscode/settings.json @@ -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 + } +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 000000000..6a624a23d --- /dev/null +++ b/.vscode/tasks.json @@ -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" + } + ] +} \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ff11eab78..b8f08862f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 @@ -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 @@ -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 diff --git a/Indicators/GUIDE.md b/GUIDE.md similarity index 99% rename from Indicators/GUIDE.md rename to GUIDE.md index 49190d2f9..891452d21 100644 --- a/Indicators/GUIDE.md +++ b/GUIDE.md @@ -27,4 +27,4 @@ IEnumerable history = GetHistoryFromFeed("SPY"); // preclean history = Cleaners.PrepareHistory(history); -``` \ No newline at end of file +``` diff --git a/Indicators/BollingerBands/README.md b/Indicators/BollingerBands/README.md index ee323aa2a..f3d36e26e 100644 --- a/Indicators/BollingerBands/README.md +++ b/Indicators/BollingerBands/README.md @@ -12,7 +12,7 @@ IEnumerable 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 diff --git a/Indicators/Ema/README.md b/Indicators/Ema/README.md index 41679625f..0aaf4d272 100644 --- a/Indicators/Ema/README.md +++ b/Indicators/Ema/README.md @@ -12,7 +12,7 @@ IEnumerable 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 diff --git a/Indicators/HeikinAshi/README.md b/Indicators/HeikinAshi/README.md index 4315a5919..08b5ee794 100644 --- a/Indicators/HeikinAshi/README.md +++ b/Indicators/HeikinAshi/README.md @@ -11,7 +11,7 @@ IEnumerable 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 diff --git a/Indicators/Indicators.csproj b/Indicators/Indicators.csproj index 226448c4f..215bfcc3c 100644 --- a/Indicators/Indicators.csproj +++ b/Indicators/Indicators.csproj @@ -2,21 +2,21 @@ netcoreapp2.2;netcoreapp3.1;netstandard2.0;netstandard2.1;net462;net472;net48 - true - 0.0.4-preview + false + 0.0.0 Dave Skender - Stock Indicators - Stock indicators. Send stock market historical data in and you get desired indicators (such as moving average, relative strength, etc) out. Nothing more. + Stock indicators. Send stock market historical data in and get desired indicators (such as moving average, relative strength, etc) out. Nothing more. true https://dev.azure.com/skender/Stock.Indicators https://github.com/DaveSkender/Stock.Indicators GitHub (Git) Skender.Stock.Indicators - This software is currently in active pre-release development. - Stock.Indicators - 0.0.4.0 - 0.0.4.0 + This software is currently in active pre-release development. +Please contribute to help us get to v1.0.0 + Skender.Stock.Indicators + 0.0.0.0 + 0.0.0.0 @2020 Dave Skender Skender.Stock.Indicators 8.0 @@ -26,6 +26,10 @@ + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Indicators/Macd/README.md b/Indicators/Macd/README.md index 6bdadf860..7f7b877fd 100644 --- a/Indicators/Macd/README.md +++ b/Indicators/Macd/README.md @@ -12,7 +12,7 @@ IEnumerable 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. diff --git a/Indicators/ParabolicSar/README.md b/Indicators/ParabolicSar/README.md index bd5b56f9a..d46ae9fda 100644 --- a/Indicators/ParabolicSar/README.md +++ b/Indicators/ParabolicSar/README.md @@ -12,7 +12,7 @@ IEnumerable 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 diff --git a/Indicators/Rsi/README.md b/Indicators/Rsi/README.md index f8a6ca3e8..bc6c094d0 100644 --- a/Indicators/Rsi/README.md +++ b/Indicators/Rsi/README.md @@ -13,7 +13,7 @@ IEnumerable 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 diff --git a/Indicators/Sma/README.md b/Indicators/Sma/README.md index 6d8f8f4b8..1fc87dfb9 100644 --- a/Indicators/Sma/README.md +++ b/Indicators/Sma/README.md @@ -12,7 +12,7 @@ IEnumerable 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 diff --git a/Indicators/Stoch/README.md b/Indicators/Stoch/README.md index 2e322c8c1..159635344 100644 --- a/Indicators/Stoch/README.md +++ b/Indicators/Stoch/README.md @@ -12,7 +12,7 @@ IEnumerable 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. diff --git a/Indicators/Ulcer/README.md b/Indicators/Ulcer/README.md index 028059318..eb951104f 100644 --- a/Indicators/Ulcer/README.md +++ b/Indicators/Ulcer/README.md @@ -12,7 +12,7 @@ IEnumerable 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 diff --git a/IndicatorsTests/IndicatorsTests.csproj b/IndicatorsTests/IndicatorsTests.csproj index 02ff908c2..db9187e29 100644 --- a/IndicatorsTests/IndicatorsTests.csproj +++ b/IndicatorsTests/IndicatorsTests.csproj @@ -1,7 +1,7 @@ - netcoreapp2.2 + netcoreapp3.1 false diff --git a/README.md b/README.md index 887245cfb..25d8cbad2 100644 --- a/README.md +++ b/README.md @@ -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; @@ -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) @@ -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. diff --git a/StockIndicators.sln b/StockIndicators.sln index fe5def107..faa0d1364 100644 --- a/StockIndicators.sln +++ b/StockIndicators.sln @@ -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 diff --git a/gitversion.yml b/gitversion.yml new file mode 100644 index 000000000..bdb324a14 --- /dev/null +++ b/gitversion.yml @@ -0,0 +1,9 @@ +mode: Mainline +next-version: 0.0.0 +branches: + feature: + tag: preview + master: + tag: '' +ignore: + sha: [] \ No newline at end of file