hubov / gocryptobot

A bot to automatically trade cryptocurrencies on the Binance.com
GNU General Public License v3.0
7 stars 5 forks source link

Amount #8

Open vulnz opened 1 year ago

vulnz commented 1 year ago

Hello my mate. Thanks for your bot. Can you please let me know how to switch strategy and what strategy is used now? How to set-up amount?

thanks

hubov commented 1 year ago

Hi @vulnz,

you can set your own strategy up in the file: gocryptobot/internal/strategy/strategy.go You have to make changes in the following methods: GetData() - which is responsible for getting the data required by your strategy via Binance API. By default it gets data for 15m and 1D candles. You can adjust it to your needs. The method should be actually simplified but I need some time to refactor the code and make it clearer. Calculate() - it is responsible for all the calculations required by your strategy. Here you should use the indicators (goCryptoBot utilizes a package for indicators https://github.com/cinar/indicator you can check there what are available) than you have a couple of methods responsible for buy/sell actions where you should set triggers based on calculated indicators values: LongLimit(), LongStop, ShortLimit, ShortStop - exiting a position SingalOrderLong(), SignalOrderShort() - opening a position SingalCloseLong(), SingalCloseShort() - closing a position

The amount used by the script is always 100% of the balance available. To use it for multiple trading pairs on one Binance account you can use isolated margin (there is a limit of 10 concurrent pairs) or you need a higher tier account to be allowed to create sub-accounts.