Error with number of positional arguments

Custom indicators, trading strategies, data export and recording and more...
amollo
Posts: 1
Joined: Thu Oct 20, 2022 9:16 pm

Error with number of positional arguments

Post by amollo » Fri Nov 24, 2023 4:07 pm

Hello,

When I try to implement the "Hello world" example provided in the Python API add-on, an error pops up stating that "handle_subscribe_instrument() takes 7 positional arguments but 8 were given"... any clue how to solve this?? It seems to me as if there are only 7 arguments...

The code is below:
 

Code: Select all

 
import bookmap as bm





def handle_subscribe_instrument(addon, alias, fullname, is_crypto, pips, size_multiplier, instrument_multiplier):

    print("Hello world from " + alias, flush=True)





def handle_unsubscribe_instrument(addon, alias):

    print("Goodbye world from " + alias, flush=True)





if __name__ == "__main__":

    addon = bm.create_addon()

    # start addon, requires 3 arguments - addon itself, handler for subscribe event

    # and handler for unsubscribe event

    bm.start_addon(addon, handle_subscribe_instrument,

                   handle_unsubscribe_instrument)

    # block python execution giving control over the script to Bookmap only, so you

    # do not risk, that your script will be turned off earlier that you decide

    bm.wait_until_addon_is_turned_off(addon)




 

romanpav
Posts: 1
Joined: Mon Nov 27, 2023 1:04 pm

Re: Error with number of positional arguments

Post by romanpav » Mon Nov 27, 2023 1:07 pm

Hi, that was a problem in the examples provided on GitHub. It is already fixed, you can check updated examples here https://github.com/BookmapAPI/python-ap ... r/examples

Post Reply