mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-18 10:38:05 +00:00
Documentation
This commit is contained in:
+1
-1
@@ -18,7 +18,7 @@
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0-preview-20221221-03" />
|
||||
<PackageReference Include="TALib.NETCore" Version="0.4.4" />
|
||||
<PackageReference Include="Skender.Stock.Indicators" Version="2.4.6" />
|
||||
<PackageReference Include="Skender.Stock.Indicators" Version="2.4.7" />
|
||||
<PackageReference Include="Tulip.NETCore" Version="0.8.0.1" />
|
||||
<PackageReference Include="System.Text.Json" Version="7.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using Xunit;
|
||||
using System;
|
||||
using QuanTAlib;
|
||||
@@ -392,4 +391,4 @@ public class PandasTA : IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -414,7 +414,7 @@ public class Skender
|
||||
{
|
||||
T3_Series QL = new(source: bars.Close, period: period, vfactor: 0.7, false);
|
||||
var SK = quotes.GetT3(lookbackPeriods: period, volumeFactor: 0.7).Select(i => i.T3.Null2NaN()!);
|
||||
for (int i = QL.Length; i > skip; i--)
|
||||
for (int i = QL.Length; i > period*15; i--)
|
||||
{
|
||||
double QL_item = Math.Round(QL[i - 1].v, digits: digits);
|
||||
double SK_item = Math.Round(SK.ElementAt(i - 1), digits: digits);
|
||||
@@ -425,7 +425,7 @@ public class Skender
|
||||
public void TRIX() {
|
||||
TRIX_Series QL = new(bars.Close, period, false);
|
||||
var SK = quotes.GetTrix(period).Select(i => i.Trix.Null2NaN()!);
|
||||
for (int i = QL.Length; i > skip; i--) {
|
||||
for (int i = QL.Length; i > period*12; i--) {
|
||||
double QL_item = Math.Round(QL[i - 1].v, digits: digits);
|
||||
double SK_item = Math.Round(SK.ElementAt(i - 1), digits: digits);
|
||||
Assert.InRange(SK_item! - QL_item, -Math.Pow(10, -digits), Math.Pow(10, -digits));
|
||||
|
||||
@@ -141,7 +141,7 @@ public class Ta_Lib
|
||||
{
|
||||
DEMA_Series QL = new(bars.Close, period, false, useSMA: false);
|
||||
Core.Dema(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period);
|
||||
for (int i = QL.Length - 1; i > skip*2; i--)
|
||||
for (int i = QL.Length - 1; i > period*10; i--)
|
||||
{
|
||||
double QL_item = Math.Round(QL[i].v, digits: digits);
|
||||
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits);
|
||||
@@ -397,7 +397,7 @@ public class Ta_Lib
|
||||
{
|
||||
T3_Series QL = new(source: bars.Close, period: period, vfactor: 0.7, useNaN: false);
|
||||
Core.T3(inReal: inclose, startIdx: 0, endIdx: bars.Count - 1, outReal: TALIB, outBegIdx: out int outBegIdx, outNbElement: out _, optInTimePeriod: period, optInVFactor: 0.7);
|
||||
for (int i = QL.Length - 1; i > skip; i--)
|
||||
for (int i = QL.Length - 1; i > period*10; i--)
|
||||
{
|
||||
double QL_item = Math.Round(QL[i].v, digits: digits);
|
||||
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits);
|
||||
@@ -444,7 +444,7 @@ public class Ta_Lib
|
||||
public void TRIX() {
|
||||
TRIX_Series QL = new(bars.Close, period, useNaN: false, useSMA: true);
|
||||
Core.Trix(inclose, 0, bars.Count - 1, TALIB, out int outBegIdx, out _, period);
|
||||
for (int i = QL.Length - 1; i > skip; i--) {
|
||||
for (int i = QL.Length - 1; i > period*10; i--) {
|
||||
double QL_item = Math.Round(QL[i].v, digits: digits);
|
||||
double TA_item = Math.Round(TALIB[i - outBegIdx], digits: digits);
|
||||
Assert.InRange(TA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
|
||||
|
||||
@@ -442,11 +442,11 @@ public class Tulip_Test
|
||||
public void TRIX() {
|
||||
double[][] arrin = { inclose };
|
||||
double[][] arrout = { outdata };
|
||||
TRIX_Series QL = new(bars.Close, period, false);
|
||||
TRIX_Series QL = new(bars.Close, period);
|
||||
Tulip.Indicators.trix.Run(inputs: arrin, options: new double[] { period }, outputs: arrout);
|
||||
for (int i = QL.Length - 1; i > skip; i--) {
|
||||
for (int i = QL.Length - 1; i > period*10; i--) {
|
||||
double QL_item = QL[i].v;
|
||||
double TU_item = arrout[0][i - period +1];
|
||||
double TU_item = arrout[0][i - (period*3) + 2];
|
||||
Assert.InRange(TU_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user