Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support timeframe config for binance #128

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

0x46656C6978
Copy link

While trying to making a bot with binance I found this error occurred

<APIError> code=-1105, msg=Parameter 'interval' was empty.

Digging deeper into souce code I see that we are missing the Interval value when call Binance API. With this PR, the .bot_config.yaml file will have extra time_frame config like this. For now this ony fixed for GetCandles function. We can add more for functions that use KLineServices to get candles data.

simulation_mode: true
exchange_configs:
- exchange: binance
  public_key: 
  secret_key: 
  deposit_addresses:
    USDT: 
  fake_balances:
    USDT: 100
strategies:
- strategy: MyStrategy
  markets:
  - market: BTC-USDT
    bindings:
    - exchange: binance
      market_name: BTCUSDT
      time_frame: 4h

@@ -46,6 +46,7 @@ type MarketConfig struct {
type ExchangeBindingsConfig struct {
Name string `yaml:"exchange"` // Represents the name of the exchange.
MarketName string `yaml:"market_name"` // Represents the name of the market as seen from the exchange.
TimeFrame string `yaml:"time_frame"`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a doc comment for this struct field?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants