帮助用户了解如何以程序化方式进行交易。
blockbid.io - Australian crypto exchange, no KYC required
We thought it would be useful to show our users how to trade programatically at Blockbid. This repo will eventually contain a series of tutorials ranging from super beginner to advanced. Please use issues to suggest ideas about what you would like to see.
After you have cloned the repo.
stragies/safeMargins.js to add your new API keynpm i
npm run startThis tutorial will show you how to periodically set orders with high margins based off the average global market price.
It is actually quite easy to write trading bots, and this one in particular is really only around 30-40 lines of code.
It expects you to have two currencies e.g. BTC TUSD
It will then place one sell order and one buy order every minute with fluctuating prices on the BTCTUSD market.
We call it safe because the script is set to place orders 20% above and below market price, ensuring no one will likely match them, but if they do you should be happy.
The code is fully documentated and you should be able to read it even if you have no programming experience.
We love all feedback!
Successful output should look like:
Starting safe margin limit order strategy
Fetching current orders on BTC/TUSD
Cancelling current orders on BTC/TUSD
Finished cancelling 2 open orders
Fetching the global average price for BTC/TUSD
The global average price for BTC/TUSD is 10055.30417295
By our calculations we want to
Buy 0.0003019033084706648 BTC when the price is 8044.24333836
Sell 0.0011350974232612501 TUSD when the price is 12066.36500754
Successfully placed ordersHere is the contents of the script
…暂无开放 Issues,或尚未同步最近议题。