New indicator not importing. #1055
Closed
Alpha23-Ltd
started this conversation in
General
Replies: 2 comments 1 reply
-
I see the issue is closed, were you able to solve the problem in the end? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Cython doesn't seem to play so nicely with PyCharm at times, particularly imports and definitions. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have created a new indicator (see code below), both the .pyx and .pyd files.
I do
make build
after this and the .so and .c files are created. So Cythonize seems to be working. There are no error messages.In my strategy .py file I am not able to import the Indicator as per this line:
from nautilus_trader.indicators.weighted_mid import WeightedMid
I dont think it's a problem with the code, since even if i duplicate an existing indicator and rename it, it still wont import.
Do the Cython indicators need to be declared elsewhere?
thanks
`from nautilus_trader.core.correctness cimport Condition
from nautilus_trader.indicators.base.indicator cimport Indicator
from nautilus_trader.model.data.tick cimport QuoteTick
from nautilus_trader.model.identifiers cimport InstrumentId
from nautilus_trader.model.objects cimport Price
cdef class WeightedMid(Indicator):
"""
Provides a weighted mid price by quantities on top level.
`
Beta Was this translation helpful? Give feedback.
All reactions