Skip to content

Commit 197d14b

Browse files
committed
Services
1 parent f4af3b8 commit 197d14b

File tree

13 files changed

+420
-30
lines changed

13 files changed

+420
-30
lines changed

Libs/Estimator.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<PropertyGroup>
88
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
9-
<Version>1.0.3</Version>
9+
<Version>1.0.4</Version>
1010
<Description>Statistics and performance metrics in trading, CAGR, Sharpe, MAE, MFE, and others.</Description>
1111
<Authors>artemiusgreat</Authors>
1212
<Copyright>indemos.com</Copyright>
@@ -15,5 +15,9 @@
1515
<PackageTags>finance trading metrics forex performance-metrics stock-market stocks futures strategies backtestings</PackageTags>
1616
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1717
</PropertyGroup>
18+
19+
<ItemGroup>
20+
<PackageReference Include="MathNet.Numerics" Version="5.0.0" />
21+
</ItemGroup>
1822

1923
</Project>

Libs/Estimators/CAGR/CAGR.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using Estimator.Extensions;
21
using Estimator.Models;
32
using System;
43
using System.Collections.Generic;
@@ -21,6 +20,6 @@ public class CAGR
2120
/// <summary>
2221
/// Calculate
2322
/// </summary>
24-
public virtual double Calculate() => (Math.Pow(Items.Sum(o => o.Value), 1.0 / Count) - 1.0).Round();
23+
public virtual double Calculate() => Math.Pow(Items.Sum(o => o.Value), 1.0 / Count) - 1.0;
2524
}
2625
}

Libs/Estimators/Edge/EdgeRatio.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using Estimator.Extensions;
21
using Estimator.Models;
2+
using System;
33
using System.Collections.Generic;
44

55
namespace Estimator.Estimators
@@ -19,7 +19,7 @@ public virtual double Calculate()
1919
var averageGain = new MFE { Items = Items }.Calculate();
2020
var averageLoss = new MAE { Items = Items }.Calculate();
2121

22-
return (averageGain / averageLoss).Round();
22+
return averageGain / averageLoss;
2323
}
2424
}
2525
}

Libs/Estimators/Kestner/KestnerRatio.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using Estimator.Extensions;
21
using Estimator.Models;
32
using System;
43
using System.Collections.Generic;
@@ -26,7 +25,7 @@ public virtual double Calculate()
2625
error = 1.0;
2726
}
2827

29-
return (slope / error).Round();
28+
return slope / error;
3029
}
3130
}
3231
}

Libs/Estimators/MAE/MAE.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using Estimator.Extensions;
21
using Estimator.Models;
2+
using System;
33
using System.Collections.Generic;
44
using System.Linq;
55

@@ -15,6 +15,6 @@ public class MAE
1515
/// <summary>
1616
/// Calculate
1717
/// </summary>
18-
public virtual double Calculate() => Items.Average(o => o.Value - o.Min).Round();
18+
public virtual double Calculate() => Items.Average(o => o.Value - o.Min);
1919
}
2020
}

Libs/Estimators/MFE/MFE.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using Estimator.Extensions;
21
using Estimator.Models;
2+
using System;
33
using System.Collections.Generic;
44
using System.Linq;
55

@@ -15,6 +15,6 @@ public class MFE
1515
/// <summary>
1616
/// Calculate
1717
/// </summary>
18-
public virtual double Calculate() => Items.Average(o => o.Max - o.Value).Round();
18+
public virtual double Calculate() => Items.Average(o => o.Max - o.Value);
1919
}
2020
}

Libs/Estimators/PF/PF.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using Estimator.Extensions;
21
using Estimator.Models;
32
using System;
43
using System.Collections.Generic;
@@ -26,7 +25,7 @@ public virtual double Calculate()
2625
gains = 1.0;
2726
}
2827

29-
return Math.Abs(gains / losses).Round();
28+
return Math.Abs(gains / losses);
3029
}
3130
}
3231
}

Libs/Estimators/RAR/RAR.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using Estimator.Extensions;
21
using Estimator.Models;
32
using System;
43
using System.Collections.Generic;
@@ -70,7 +69,7 @@ public virtual double Calculate()
7069
denominator = 1.0;
7170
}
7271

73-
return (Math.Sqrt(Count) * (mean - Rate) / denominator).Round();
72+
return Math.Sqrt(Count) * (mean - Rate) / denominator;
7473
}
7574
}
7675
}

Libs/Estimators/Regression/Regression.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using Estimator.Extensions;
21
using Estimator.Models;
32
using System;
43
using System.Collections.Generic;

Libs/Estimators/StandardScore/StandardScore.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using Estimator.Extensions;
21
using Estimator.Models;
32
using System;
43
using System.Collections.Generic;
@@ -48,7 +47,7 @@ public virtual double Calculate()
4847
deviation = 1.0;
4948
}
5049

51-
return ((seriesCount - mean - 0.5) / deviation).Round();
50+
return (seriesCount - mean - 0.5) / deviation;
5251
}
5352
}
5453
}

0 commit comments

Comments
 (0)