-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import unittest | ||
|
||
from talipp.indicators import McGinleyDynamic | ||
|
||
from TalippTest import TalippTest | ||
|
||
|
||
class Test(TalippTest): | ||
def setUp(self) -> None: | ||
self.input_values = list(TalippTest.CLOSE_TMPL) | ||
|
||
def test_init(self): | ||
ind = McGinleyDynamic(14, self.input_values) | ||
|
||
print(ind) | ||
|
||
self.assertAlmostEqual(ind[-3], 8.839868, places = 5) | ||
self.assertAlmostEqual(ind[-2], 8.895229, places = 5) | ||
self.assertAlmostEqual(ind[-1], 8.944634, places = 5) | ||
|
||
def test_update(self): | ||
self.assertIndicatorUpdate(McGinleyDynamic(14, self.input_values)) | ||
|
||
def test_delete(self): | ||
self.assertIndicatorDelete(McGinleyDynamic(14, self.input_values)) | ||
|
||
def test_purge_oldest(self): | ||
self.assertIndicatorPurgeOldest(McGinleyDynamic(14, self.input_values)) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |