BUGFIX: GateIO candle retrieval, backtester formatting (#715)

* Fixes gateio candle retrieval. Fixes backtester exch & currency lookups

* Fixes strat whoopsie

* Using a helper function instead

* shadowy lint figures defeated

* Fixes fodmap typo

Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>

Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
This commit is contained in:
Scott
2021-07-19 11:48:52 +10:00
committed by GitHub
parent 0965678fbf
commit 6182dd6fbc
4 changed files with 14 additions and 2 deletions

View File

@@ -135,6 +135,15 @@ func NewFromConfig(cfg *config.Config, templatePath, output string, bot *engine.
cfg.CurrencySettings[i].Base+cfg.CurrencySettings[i].Quote,
err)
}
exch := bot.ExchangeManager.GetExchangeByName(cfg.CurrencySettings[i].ExchangeName)
b := exch.GetBase()
var pFmt currency.PairFormat
pFmt, err = b.GetPairFormat(a, true)
if err != nil {
return nil, fmt.Errorf("could not format currency %v, %w", curr, err)
}
curr = curr.Format(pFmt.Delimiter, pFmt.Uppercase)
portfolioRisk.CurrencySettings[cfg.CurrencySettings[i].ExchangeName][a][curr] = &risk.CurrencySettings{
MaximumOrdersWithLeverageRatio: cfg.CurrencySettings[i].Leverage.MaximumOrdersWithLeverageRatio,
MaxLeverageRate: cfg.CurrencySettings[i].Leverage.MaximumLeverageRate,