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?










share|improve this question

















  • 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














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?










share|improve this question

















  • 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












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?










share|improve this question













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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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












  • 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












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


  1. 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 is BTC/USD.

  2. 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.

  3. 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).





share|improve this answer




















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    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

























    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


    1. 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 is BTC/USD.

    2. 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.

    3. 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).





    share|improve this answer
























      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


      1. 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 is BTC/USD.

      2. 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.

      3. 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).





      share|improve this answer






















        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


        1. 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 is BTC/USD.

        2. 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.

        3. 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).





        share|improve this answer












        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


        1. 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 is BTC/USD.

        2. 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.

        3. 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).






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 11 at 17:31









        Igor Kroitor

        32146




        32146



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            Top Tejano songwriter Luis Silva dead of heart attack at 64

            政党

            天津地下鉄3号線