mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-18 18:48:05 +00:00
test_python
This commit is contained in:
+1
-1
@@ -9,7 +9,7 @@
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Python.Included" Version="3.11.1" />
|
||||
<PackageReference Include="Python.Included" Version="3.10.0-preview5" />
|
||||
<PackageReference Include="pythonnet" Version="3.0.1" />
|
||||
<PackageReference Include="xunit" Version="2.4.2" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
|
||||
|
||||
@@ -25,13 +25,16 @@ public class PandasTA : IDisposable
|
||||
|
||||
Installer.InstallPath = Path.GetFullPath(path: ".");
|
||||
Installer.SetupPython().Wait();
|
||||
Installer.TryInstallPip().Wait();
|
||||
Installer.PipInstallModule(module_name: "numpy").Wait();
|
||||
Installer.PipInstallModule(module_name: "pandas").Wait();
|
||||
Installer.PipInstallModule(module_name: "pandas-ta").Wait();
|
||||
dllpath = Installer.InstallPath + "\\" + Installer.InstallDirectory + "\\" + Runtime.PythonDLL;
|
||||
Installer.TryInstallPip();
|
||||
Installer.PipInstallModule(module_name: "numpy");
|
||||
Installer.PipInstallModule(module_name: "pandas");
|
||||
Installer.PipInstallModule(module_name: "pandas-ta");
|
||||
dllpath = Installer.InstallPath + "\\" + Installer.InstallDirectory + "\\" + Runtime.PythonDLL;
|
||||
|
||||
Runtime.PythonDLL = dllpath;
|
||||
PythonEngine.Initialize();
|
||||
//Runtime.PythonDLL = "python.dll";
|
||||
|
||||
PythonEngine.Initialize();
|
||||
|
||||
np = Py.Import(name: "numpy");
|
||||
pd = Py.Import(name: "pandas");
|
||||
@@ -65,7 +68,7 @@ public class PandasTA : IDisposable
|
||||
|
||||
}
|
||||
}
|
||||
/*
|
||||
|
||||
[Fact] void ADOSC() {
|
||||
ADOSC_Series QL = new(bars);
|
||||
var pta = df.ta.adosc(high: df.high, low: df.low, close: df.close, volume: df.volume);
|
||||
@@ -122,7 +125,7 @@ public class PandasTA : IDisposable
|
||||
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
[Fact]
|
||||
void CMO() {
|
||||
CMO_Series QL = new(bars.Close, period, false);
|
||||
@@ -133,7 +136,7 @@ public class PandasTA : IDisposable
|
||||
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
[Fact] void DEMA() {
|
||||
DEMA_Series QL = new(bars.Close, period, false);
|
||||
var pta = df.ta.dema(close: df.close, length: period);
|
||||
@@ -428,5 +431,5 @@ public class PandasTA : IDisposable
|
||||
Assert.InRange(PanTA_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
@@ -470,6 +470,7 @@ public class Tulip_Test
|
||||
Assert.InRange(TU_item! - QL_item, -Math.Exp(-digits), Math.Exp(-digits));
|
||||
}
|
||||
}
|
||||
/*
|
||||
[Fact]
|
||||
public void TRIX() {
|
||||
double[][] arrin = { inclose };
|
||||
@@ -482,6 +483,7 @@ public class Tulip_Test
|
||||
Assert.InRange(TU_item! - QL_item, -Math.Exp(-digits+2), Math.Exp(-digits+2));
|
||||
}
|
||||
}
|
||||
*/
|
||||
[Fact]
|
||||
public void VAR() {
|
||||
double[][] arrin = { inclose };
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
pytz
|
||||
six
|
||||
python-dateutil
|
||||
numpy
|
||||
pandas
|
||||
pandas-ta
|
||||
Reference in New Issue
Block a user