Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .DS_Store
Binary file not shown.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
/src/build/*
/src/dist/*
/src/*.egg-info
dist
8 changes: 0 additions & 8 deletions .idea/cython_indicator_functions.iml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/inspectionProfiles/profiles_settings.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/misc.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

55 changes: 0 additions & 55 deletions .idea/workspace.xml

This file was deleted.

2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
## Currently provide support for:
* BB - [Bolinger Bands](https://www.investopedia.com/articles/technical/102201.asp)

* EMA -[Exponential Moving Average](https://www.investopedia.com/terms/e/ema.asp)

* FIB - [Upper Fibonacci Retracement Levels](https://www.investopedia.com/terms/f/fibonacciretracement.asp)

* FIB_BB - [Fibonacci Bolinger Bands](https://www.motivewave.com/studies/bollinger_bands_fib_ratios.htm)
Expand Down
Binary file not shown.
Binary file not shown.
File renamed without changes.
39 changes: 39 additions & 0 deletions build/lib.macosx-10.9-x86_64-3.7/test/test_functions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import unittest
import testindicators
import numpy as np
values = np.array([12.0, 14.0, 64.0, 32.0, 53.0])

float_format = lambda number: float("{:.2f}".format(number))

class TestFunctions(unittest.TestCase):

def testSMA(self):
expected = 40.75
actual = testindicators.SMA(values, 4)
self.assertEqual(expected, actual)

def testMOMENTUM(self):
expected = 39
actual = testindicators.MOMENTUM(values, 3)
self.assertEqual(expected, actual)

def testSDV(self):
expected = 22.23
actual = testindicators.SDV(values, 4)
self.assertAlmostEquals(expected, float_format(actual))

def testBB(self):
a1, a2, a3 = testindicators.BOLINGER_BANDS(values, 4)
self.assertEqual([float_format(a1), float_format(a2), float_format(a3)], [ 40.75, 85.21, -3.71])

def testFIBONACCI(self):
expected = [51.728, 44.135999999999996, 31.863999999999997]
print("values ", values)
a1, a2, a3 = testindicators.FIB(values, values.shape[0])
self.assertListEqual(expected, [a1, a2, a3])


def testWMA(self):
expected = 89.2
actual = testindicators.WMA(np.array([90.0, 89.0, 88.0, 89.0]), 4, 10)
self.assertEqual(expected, float_format(actual))
Binary file removed build/temp.macosx-10.7-x86_64-3.7/src/indicators.o
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion cython_indicators.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: cython-indicators
Version: 0.0.6
Version: 0.0.3
Summary: Indicator functions using cython
Home-page: https://github.com/epociask/cython_indicator_functions.git
Author: Ethen Pociask
Expand Down
1 change: 1 addition & 0 deletions cython_indicators.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ cython_indicators.egg-info/dependency_links.txt
cython_indicators.egg-info/requires.txt
cython_indicators.egg-info/top_level.txt
src/indicators.pyx
test/__init__.py
test/test_functions.py
2 changes: 1 addition & 1 deletion cython_indicators.egg-info/requires.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Cython==0.29.17
Cython
setuptools
numpy
1 change: 1 addition & 0 deletions cython_indicators.egg-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
indicators
test
Binary file not shown.
Binary file added dist/cython_indicators-0.0.3.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Cython==0.29.17
Cython
setuptools
numpy
33 changes: 12 additions & 21 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,27 @@
from Cython.Distutils import build_ext
import setuptools
import os
import subprocess
from setuptools import setup, Extension

from setuptools import Extension
thelibFolder = os.path.dirname(os.path.realpath(__file__))
requirementPath = 'requirements.txt'
install_requires = []
if os.path.isfile(requirementPath):
with open(requirementPath) as f:
install_requires = f.read().splitlines()
cmdclass = {}
ext_modules = [Extension("indicators", ["src/indicators.pyx"])]
cmdclass.update({'build_ext': build_ext})

# cmdclass = {}
# ext_modules = [Extension("indicators", ["src/indicators.pyx"])]
# cmdclass.update({'build_ext': build_ext})

setup(
setup_requires=[
'setuptools>=18.0',
'cython',
],
setuptools.setup(
name="cython_indicators",
version="0.0.6",
version="0.0.3",
author="Ethen Pociask",
author_email="epociask@volatrade.com",
description="Indicator functions using cython",
long_description="TO BE ADDED",
long_description_content_type="text/markdown",
url="https://github.com/epociask/cython_indicator_functions.git",
# packages=setuptools.find_packages(),
packages=setuptools.find_packages(),
install_requires=install_requires,
include_package_data=True,
classifiers=[
Expand All @@ -35,12 +30,8 @@
"Operating System :: OS Independent",
],
python_requires='>=3.6',
# cmdclass=cmdclass,
ext_modules=[
Extension(
'indicators',
sources=['src/indicators.pyx'],
),
],
cmdclass = cmdclass,
ext_modules = ext_modules,

)

Loading