Skip to content

Commit 1d2f509

Browse files
committed
cython strategy
1 parent 9a3e8d3 commit 1d2f509

File tree

10 files changed

+43699
-13
lines changed

10 files changed

+43699
-13
lines changed

cytrader/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757

5858
from .writer import *
5959

60-
from .signal import *
60+
from .btsignal import *
6161

6262
from .cerebro import *
6363
from .timer import *

cytrader/btrun/btrun.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def btrun(pargs=''):
111111
# get and add signals
112112
signals = getobjects(args.signals, bt.Indicator, bt.signals, issignal=True)
113113
for sig, kwargs, sigtype in signals:
114-
stype = getattr(bt.signal, 'SIGNAL_' + sigtype.upper())
114+
stype = getattr(bt.btsignal, 'SIGNAL_' + sigtype.upper())
115115
cerebro.add_signal(stype, sig, **kwargs)
116116

117117
# get and add strategies
File renamed without changes.

cytrader/setup.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from distutils.core import setup
2+
from distutils.extension import Extension
3+
from Cython.Build import cythonize
4+
import Cython.Compiler.Options
5+
Cython.Compiler.Options.annotate = True
6+
import numpy as np
7+
8+
extensions = [
9+
Extension("strategy", sources=["strategy.pyx"], include_dirs=[np.get_include()])
10+
]
11+
12+
setup(
13+
name="strategy",
14+
ext_modules = cythonize(extensions, annotate=True),
15+
)

0 commit comments

Comments
 (0)