Error message: Function is not callable, not sure what is wrong?
up vote
-1
down vote
favorite
def smaShort(self):
while True:
ohlcv_candles = bitmex2.bitmex.fetch_ohlcv(self, symbol= 'XBTUSD', timeframe= '5m')
mas =
mas = ohlcv_candles.rolling(window=5).mean()
return mas#[-1]
when trying to call smaShort function
logger.info("sma short value:" (self.smaShort()))
I get the error smaShort is not callable, anybody know what I am doing wrong?
python algorithm bitmex
add a comment |
up vote
-1
down vote
favorite
def smaShort(self):
while True:
ohlcv_candles = bitmex2.bitmex.fetch_ohlcv(self, symbol= 'XBTUSD', timeframe= '5m')
mas =
mas = ohlcv_candles.rolling(window=5).mean()
return mas#[-1]
when trying to call smaShort function
logger.info("sma short value:" (self.smaShort()))
I get the error smaShort is not callable, anybody know what I am doing wrong?
python algorithm bitmex
3
The code you posted is not runnable, we can't verify the error.
– timgeb
Nov 10 at 22:31
i used the ccxt bitmex library to get the fetch_ohlcv function, i hope this helps clarify a bit
– Varun Reddy
Nov 10 at 22:35
You also dont have a break, you have an infinite loop
– Mitchel Paulin
Nov 10 at 22:36
2
@VarunReddy The code you posted is not runnable, we can't verify the error.
– timgeb
Nov 10 at 22:36
Did you define an instance attribute with the same name?
– chepner
Nov 11 at 17:37
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
def smaShort(self):
while True:
ohlcv_candles = bitmex2.bitmex.fetch_ohlcv(self, symbol= 'XBTUSD', timeframe= '5m')
mas =
mas = ohlcv_candles.rolling(window=5).mean()
return mas#[-1]
when trying to call smaShort function
logger.info("sma short value:" (self.smaShort()))
I get the error smaShort is not callable, anybody know what I am doing wrong?
python algorithm bitmex
def smaShort(self):
while True:
ohlcv_candles = bitmex2.bitmex.fetch_ohlcv(self, symbol= 'XBTUSD', timeframe= '5m')
mas =
mas = ohlcv_candles.rolling(window=5).mean()
return mas#[-1]
when trying to call smaShort function
logger.info("sma short value:" (self.smaShort()))
I get the error smaShort is not callable, anybody know what I am doing wrong?
python algorithm bitmex
python algorithm bitmex
asked Nov 10 at 22:29
Varun Reddy
1
1
3
The code you posted is not runnable, we can't verify the error.
– timgeb
Nov 10 at 22:31
i used the ccxt bitmex library to get the fetch_ohlcv function, i hope this helps clarify a bit
– Varun Reddy
Nov 10 at 22:35
You also dont have a break, you have an infinite loop
– Mitchel Paulin
Nov 10 at 22:36
2
@VarunReddy The code you posted is not runnable, we can't verify the error.
– timgeb
Nov 10 at 22:36
Did you define an instance attribute with the same name?
– chepner
Nov 11 at 17:37
add a comment |
3
The code you posted is not runnable, we can't verify the error.
– timgeb
Nov 10 at 22:31
i used the ccxt bitmex library to get the fetch_ohlcv function, i hope this helps clarify a bit
– Varun Reddy
Nov 10 at 22:35
You also dont have a break, you have an infinite loop
– Mitchel Paulin
Nov 10 at 22:36
2
@VarunReddy The code you posted is not runnable, we can't verify the error.
– timgeb
Nov 10 at 22:36
Did you define an instance attribute with the same name?
– chepner
Nov 11 at 17:37
3
3
The code you posted is not runnable, we can't verify the error.
– timgeb
Nov 10 at 22:31
The code you posted is not runnable, we can't verify the error.
– timgeb
Nov 10 at 22:31
i used the ccxt bitmex library to get the fetch_ohlcv function, i hope this helps clarify a bit
– Varun Reddy
Nov 10 at 22:35
i used the ccxt bitmex library to get the fetch_ohlcv function, i hope this helps clarify a bit
– Varun Reddy
Nov 10 at 22:35
You also dont have a break, you have an infinite loop
– Mitchel Paulin
Nov 10 at 22:36
You also dont have a break, you have an infinite loop
– Mitchel Paulin
Nov 10 at 22:36
2
2
@VarunReddy The code you posted is not runnable, we can't verify the error.
– timgeb
Nov 10 at 22:36
@VarunReddy The code you posted is not runnable, we can't verify the error.
– timgeb
Nov 10 at 22:36
Did you define an instance attribute with the same name?
– chepner
Nov 11 at 17:37
Did you define an instance attribute with the same name?
– chepner
Nov 11 at 17:37
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
import pandas as pd
import ccxt
exchange = ccxt.bitmex(
'enableRateLimit': True, # required by the Manual
)
ohlcv = exchange.fetch_ohlcv('BTC/USD', '1m')
df = pd.DataFrame (ohlcv)
df[4].rolling(window=5).mean() # OHLCV, C (closing price) has index 4
- Bitmex does not have a
XBTUSD
symbol, it's a market id not a symbol, as explained in the Manual: https://github.com/ccxt/ccxt/wiki/Manual#symbols-and-market-ids. The correct symbol isBTC/USD
. - Also, according to CCXT Manual, the call to
bitmex.fetch_ohlcv
will return the following structure: https://github.com/ccxt/ccxt/wiki/Manual#ohlcv-structure. - The ohlcv structure is a plain array/list of arrays with OHLCV candle values, not a Pandas DataFrame, so you can't call
.rolling(window=5).mean()
on a list, you have to convert it to a DataFrame first, like shown above (or in any other way supported by Pandas).
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
import pandas as pd
import ccxt
exchange = ccxt.bitmex(
'enableRateLimit': True, # required by the Manual
)
ohlcv = exchange.fetch_ohlcv('BTC/USD', '1m')
df = pd.DataFrame (ohlcv)
df[4].rolling(window=5).mean() # OHLCV, C (closing price) has index 4
- Bitmex does not have a
XBTUSD
symbol, it's a market id not a symbol, as explained in the Manual: https://github.com/ccxt/ccxt/wiki/Manual#symbols-and-market-ids. The correct symbol isBTC/USD
. - Also, according to CCXT Manual, the call to
bitmex.fetch_ohlcv
will return the following structure: https://github.com/ccxt/ccxt/wiki/Manual#ohlcv-structure. - The ohlcv structure is a plain array/list of arrays with OHLCV candle values, not a Pandas DataFrame, so you can't call
.rolling(window=5).mean()
on a list, you have to convert it to a DataFrame first, like shown above (or in any other way supported by Pandas).
add a comment |
up vote
0
down vote
import pandas as pd
import ccxt
exchange = ccxt.bitmex(
'enableRateLimit': True, # required by the Manual
)
ohlcv = exchange.fetch_ohlcv('BTC/USD', '1m')
df = pd.DataFrame (ohlcv)
df[4].rolling(window=5).mean() # OHLCV, C (closing price) has index 4
- Bitmex does not have a
XBTUSD
symbol, it's a market id not a symbol, as explained in the Manual: https://github.com/ccxt/ccxt/wiki/Manual#symbols-and-market-ids. The correct symbol isBTC/USD
. - Also, according to CCXT Manual, the call to
bitmex.fetch_ohlcv
will return the following structure: https://github.com/ccxt/ccxt/wiki/Manual#ohlcv-structure. - The ohlcv structure is a plain array/list of arrays with OHLCV candle values, not a Pandas DataFrame, so you can't call
.rolling(window=5).mean()
on a list, you have to convert it to a DataFrame first, like shown above (or in any other way supported by Pandas).
add a comment |
up vote
0
down vote
up vote
0
down vote
import pandas as pd
import ccxt
exchange = ccxt.bitmex(
'enableRateLimit': True, # required by the Manual
)
ohlcv = exchange.fetch_ohlcv('BTC/USD', '1m')
df = pd.DataFrame (ohlcv)
df[4].rolling(window=5).mean() # OHLCV, C (closing price) has index 4
- Bitmex does not have a
XBTUSD
symbol, it's a market id not a symbol, as explained in the Manual: https://github.com/ccxt/ccxt/wiki/Manual#symbols-and-market-ids. The correct symbol isBTC/USD
. - Also, according to CCXT Manual, the call to
bitmex.fetch_ohlcv
will return the following structure: https://github.com/ccxt/ccxt/wiki/Manual#ohlcv-structure. - The ohlcv structure is a plain array/list of arrays with OHLCV candle values, not a Pandas DataFrame, so you can't call
.rolling(window=5).mean()
on a list, you have to convert it to a DataFrame first, like shown above (or in any other way supported by Pandas).
import pandas as pd
import ccxt
exchange = ccxt.bitmex(
'enableRateLimit': True, # required by the Manual
)
ohlcv = exchange.fetch_ohlcv('BTC/USD', '1m')
df = pd.DataFrame (ohlcv)
df[4].rolling(window=5).mean() # OHLCV, C (closing price) has index 4
- Bitmex does not have a
XBTUSD
symbol, it's a market id not a symbol, as explained in the Manual: https://github.com/ccxt/ccxt/wiki/Manual#symbols-and-market-ids. The correct symbol isBTC/USD
. - Also, according to CCXT Manual, the call to
bitmex.fetch_ohlcv
will return the following structure: https://github.com/ccxt/ccxt/wiki/Manual#ohlcv-structure. - The ohlcv structure is a plain array/list of arrays with OHLCV candle values, not a Pandas DataFrame, so you can't call
.rolling(window=5).mean()
on a list, you have to convert it to a DataFrame first, like shown above (or in any other way supported by Pandas).
answered Nov 11 at 17:31
Igor Kroitor
32146
32146
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53244059%2ferror-message-function-is-not-callable-not-sure-what-is-wrong%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
3
The code you posted is not runnable, we can't verify the error.
– timgeb
Nov 10 at 22:31
i used the ccxt bitmex library to get the fetch_ohlcv function, i hope this helps clarify a bit
– Varun Reddy
Nov 10 at 22:35
You also dont have a break, you have an infinite loop
– Mitchel Paulin
Nov 10 at 22:36
2
@VarunReddy The code you posted is not runnable, we can't verify the error.
– timgeb
Nov 10 at 22:36
Did you define an instance attribute with the same name?
– chepner
Nov 11 at 17:37