Skip to content

Commit

Permalink
Merge branch 'main' into v3
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveSkender committed Nov 29, 2024
2 parents 5cf7165 + e3e3a57 commit b86593b
Show file tree
Hide file tree
Showing 14 changed files with 45 additions and 157 deletions.
38 changes: 35 additions & 3 deletions docs/examples/.editorconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
# code analysis for EXAMPLES only
root = false
# top-most EditorConfig file
# isolated for distro
root = true

# global baselines
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

indent_style = space
indent_size = 2
tab_width = 2

max_line_length = 150

[*.cs]
dotnet_diagnostic.CS1591.severity = none # Missing XML comment for public members

tab_width = 4
indent_size = 4

# File headers are disabled
file_header_template = unset

# Organize 'using' directives
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = false

# Allow singular 'using' directive
dotnet_style_namespace_match_folder = false:none

# Suppress intentional syntax that would
# otherwise trigger a diagnostic message
dotnet_diagnostic.IDE0058.severity = none
dotnet_diagnostic.IDE0305.severity = none
dotnet_diagnostic.CA1859.severity = none
2 changes: 1 addition & 1 deletion docs/examples/Backtest/Backtest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Skender.Stock.Indicators" Version="2.5.1" />
<PackageReference Include="Skender.Stock.Indicators" Version="2.6.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/ConsoleApp/ConsoleApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Skender.Stock.Indicators" Version="2.5.1" />
<PackageReference Include="Skender.Stock.Indicators" Version="2.6.0" />
</ItemGroup>

<ItemGroup>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Skender.Stock.Indicators" Version="2.5.1" />
<PackageReference Include="Skender.Stock.Indicators" Version="2.6.0" />
</ItemGroup>

</Project>
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Skender.Stock.Indicators" Version="2.5.1" />
<PackageReference Include="Skender.Stock.Indicators" Version="2.6.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\CustomIndicators\CustomIndicatorsLibrary.csproj" />
<ProjectReference Include="..\CustomIndicatorsLibrary\CustomIndicatorsLibrary.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
18 changes: 0 additions & 18 deletions docs/examples/CustomIndicatorsUsage/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,3 @@
// only showing first 30 records for brevity
Console.WriteLine($"ATR WMA on {r.Date:u} was ${r.AtrWma:N3}");
}

// optional: demo of a converter (nulls to NaN)

Console.WriteLine();
Console.WriteLine("ATR WMA Results with NaN (optional) -------");

// TIP: converting ToList() and using For loops is faster to iterate
List<AtrWmaResult> resultsList = results
.Take(30)
.ToList();

for (int i = 0; i < resultsList.Count; i++)
{
AtrWmaResult r = resultsList[i];
r.AtrWma = r.AtrWma.Null2NaN();

Console.WriteLine($"ATR WMA on {r.Date:u} was ${r.AtrWma:N3}");
}
6 changes: 1 addition & 5 deletions docs/examples/Examples.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleApp", "ConsoleApp\Co
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Backtest", "Backtest\Backtest.csproj", "{21707592-8CB6-40DB-8183-E1D107559EDB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CustomIndicatorsLibrary", "CustomIndicators\CustomIndicatorsLibrary.csproj", "{D201089E-E9F6-4A67-A763-4164C8318E04}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CustomIndicatorsLibrary", "CustomIndicatorsLibrary\CustomIndicatorsLibrary.csproj", "{D201089E-E9F6-4A67-A763-4164C8318E04}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CustomIndicatorsUsage", "CustomIndicatorsUsage\CustomIndicatorsUsage.csproj", "{4C6528AB-8311-4F10-99D2-83A2AB2DFB53}"
EndProject
Expand Down Expand Up @@ -42,10 +42,6 @@ Global
{4C6528AB-8311-4F10-99D2-83A2AB2DFB53}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4C6528AB-8311-4F10-99D2-83A2AB2DFB53}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4C6528AB-8311-4F10-99D2-83A2AB2DFB53}.Release|Any CPU.Build.0 = Release|Any CPU
{5FAD383B-DFCD-42FD-A847-53D772876595}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5FAD383B-DFCD-42FD-A847-53D772876595}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5FAD383B-DFCD-42FD-A847-53D772876595}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5FAD383B-DFCD-42FD-A847-53D772876595}.Release|Any CPU.Build.0 = Release|Any CPU
{E6B2E0AE-6457-47F3-9BA5-01F4AA84118A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E6B2E0AE-6457-47F3-9BA5-01F4AA84118A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E6B2E0AE-6457-47F3-9BA5-01F4AA84118A}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
14 changes: 0 additions & 14 deletions docs/examples/ObserveStream/ObserveStream.csproj

This file was deleted.

107 changes: 0 additions & 107 deletions docs/examples/ObserveStream/Program.cs

This file was deleted.

5 changes: 2 additions & 3 deletions docs/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ layout: page

# {{ page.title }}

To help you get started, here are a few minimalist [.NET 8.0](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) C# projects that you can review. They are complete working examples.
To help you get started, here are a few minimalist [.NET 9.0](https://dotnet.microsoft.com/en-us/download/dotnet/9.0) C# projects that you can review. They are complete working examples.

- `ConsoleApp` is a minimalist example of how to use the library (start here)
- `Backtest` is a slightly more complicated example of how to analyze results
- `CustomIndicatorsLibrary` shows how you can [create your own custom indicators]({{site.baseurl}}/custom-indicators/#content)
- `CustomIndicatorsUsage` shows how you'd use a custom indicator just like any other in the main library
- `ObserveStream` [preview] shows how you'd use live quotes from WebSocket, using the Alpaca SDK for .NET
- `CustomIndicatorsUsage` shows how you'd use custom indicators just like any other in the main library
- `UseQuoteApi` shows how you'd get quotes from an API quote source, using the Alpaca SDK for .NET

For more information on how to use this library overall, see the [Guide and Pro Tips]({{site.baseurl}}/guide/#content).
Expand Down
Binary file modified docs/examples/Skender.Stock.Indicators-Examples.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions docs/examples/UseQuoteApi/UseQuoteApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Alpaca.Markets" Version="7.1.3" />
<PackageReference Include="Skender.Stock.Indicators" Version="2.5.1" />
<PackageReference Include="Alpaca.Markets" Version="7.1.4" />
<PackageReference Include="Skender.Stock.Indicators" Version="2.6.0" />
</ItemGroup>

</Project>

0 comments on commit b86593b

Please sign in to comment.