Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathhello_world.py
More file actions
Latest commit
21 lines (15 loc) · 871 Bytes
/
Copy pathhello_world.py
File metadata and controls
21 lines (15 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
importbookmapasbm
defhandle_subscribe_instrument(addon, alias, full_name, is_crypto, pips, size_multiplier, instrument_multiplier, supported_features):
print("Hello world from "+alias, flush=True)
print("Features: "+str(supported_features), flush=True)
defhandle_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)