A Google Sheet utilizing ProfitView Trading Bots
In order to use this code you must Sign-up with ProfitView and choose at least the Hobbyist plan. This will give access to the Trading Bots tab.
- Clone this repo into an appropriate directory
- Log in to ProfitView and go to the Trading Bots tab
- Open
src/example/BotSheet.py
in an editor and copy it into your chosen ProfitView Trading Bots editor entirely replacing the code there.- Start the Bot (it will not store any data since you haven't yet chosen any symbols)
- Click the "lightning" icon and copy the URL for
latest_trades
. Paste it somewhere and copy the "token" (the text betweentrading/bot/
and/latest_trades
).
- Open Google Sheets
- Choose "Blank"
- File>Import>Upload>Browse and choose
src/example/BotSheet.xlsx
from thebotsheet
directory you just cloned. - Paste your token from above into cell
H2
- NOTE you might have to create the buttons (they may not appear on upload of the XLSX file)
- Insert>Drawing
- Shape toolbar item and choose rounded rectangle
- Create a button-like rectangle and add text e.g. "Clear" and choose colors etc
- Save and Close
- Right-click and position the button
- Repeat for other buttons
- In the sheet's menus go to Extensions>Apps Script
- Open and copy all of
src/example/botsheet.gs
from the (recently cloned)botsheet
directory and paste it into the Apps Script code window so that it replaces any text there. - Replace "Untitled project" with "BotSheet" (or similar) for the name of the project.
- Click the save icon.
- Open and copy all of
- Back in the Google Sheet
- Right-click on the Clear "button"
- Left-click on the triple-dot and choose Assign Script. Choose
clearData
. Similarly for the "Get Trades" button choosegetTrades
.- Note that it may take a few minutes for the script's functions to replicate and be available in the sheet. Be patient
- Finally, click the lightning symbol again and now under Market Streams, in the BitMEX section (or that of the exchange you are using) choose some symbols.
- Stop and re-deploy your bot - then click Start Bot.
Wait a few minutes after the bot has been started - depending on market activity for the symbols you choose.
Click "Get Trades" - you should see the list of most recent trades under the src
(Source - i.e. exchange), sym
(Symbol or coin), price
, side
and time
. Time is in milliseconds since 1970. A column date-time
is added using Sheets EPOCHTODATE()
function.
On the right side near the Get Trades button entries src
, sym
and side
allow the output to be restricted to whatever is placed below these cells. E.g. change J7
to ETHUSD
or similar.
By default (empty cells) there is no restriction.
To the right of side
you see num
. Place the number of lines of output you want below this. The default is 10.
The Clear button will delete all accumulated data and clear the screen.