mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-16 23:16:48 +00:00
Engine: Fixed issue with initial setting of PortfolioManagerDelay param from flags (#598)
* GetClosedOrder implemented for Kraken and Binance, fixed Binance MARKET order creaton, added rate, fee and cost fileds on SubmitOrder responce * return Trades on Binance SubmitOrder, new validation methods on Binance and kraken GetClosedOrderInfo * removed the Binance extra method GetClosedOrder * func description corrected * removed price, fee and cost from SimulateOrder response, as we get all necessary info in response to calculate them on client side * GetClosedOrder implementation moved to GetOrderInfo * changed GetOrderInfo params * removed Canceled order.Type used for Kraken * update QueryOrder in gctscript * add missed params to QueryOrder validator (gctscript) * fixed testing issues * GetClosedOrder implemented for Kraken and Binance, fixed Binance MARKET order creaton, added rate, fee and cost fileds on SubmitOrder responce * return Trades on Binance SubmitOrder, new validation methods on Binance and kraken GetClosedOrderInfo * removed the Binance extra method GetClosedOrder * func description corrected * removed price, fee and cost from SimulateOrder response, as we get all necessary info in response to calculate them on client side * GetClosedOrder implementation moved to GetOrderInfo * changed GetOrderInfo params * removed Canceled order.Type used for Kraken * update QueryOrder in gctscript * add missed params to QueryOrder validator (gctscript) * fixed testing issues * pull previous changes * linter issues fix * updated query_order exmple in gctscript, fixed params check * removed orderPair unnecessary conversion * added wsCancelAllOrders, fixed bugs * fixed Kraken wsAddOrder method * cleanup * CancelBatchOrders implementation * changed CancelBatchOrders signature * fixed tests and wrappers * btcmarkets_test fix * cleanup * cleanup * changed CancelBatchOrders signature * fmt * Update configtest.json * Update configtest.json * rollback configtest * refactored Kraken wsHandleData to allow tests * removed unnecessary error test in TestWsAddOrderJSON * dependencies updates * fixed issue with PortfolioSleepDelay set on startup Co-authored-by: Vazha Bezhanishvili <vazha.bezhanishvili@elegro.eu>
This commit is contained in:
@@ -145,7 +145,7 @@ func validateSettings(b *Engine, s *Settings, flagSet map[string]bool) {
|
||||
b.Settings.EnablePortfolioManager = s.EnablePortfolioManager
|
||||
b.Settings.WithdrawCacheSize = s.WithdrawCacheSize
|
||||
if b.Settings.EnablePortfolioManager {
|
||||
if b.Settings.PortfolioManagerDelay != time.Duration(0) && s.PortfolioManagerDelay > 0 {
|
||||
if b.Settings.PortfolioManagerDelay == time.Duration(0) && s.PortfolioManagerDelay > 0 {
|
||||
b.Settings.PortfolioManagerDelay = s.PortfolioManagerDelay
|
||||
} else {
|
||||
b.Settings.PortfolioManagerDelay = PortfolioSleepDelay
|
||||
|
||||
@@ -51,7 +51,7 @@ func (p *portfolioManager) Stop() error {
|
||||
func (p *portfolioManager) run() {
|
||||
log.Debugln(log.PortfolioMgr, "Portfolio manager started.")
|
||||
Bot.ServicesWG.Add(1)
|
||||
tick := time.NewTicker(PortfolioSleepDelay)
|
||||
tick := time.NewTicker(Bot.Settings.PortfolioManagerDelay)
|
||||
defer func() {
|
||||
atomic.CompareAndSwapInt32(&p.stopped, 1, 0)
|
||||
atomic.CompareAndSwapInt32(&p.started, 1, 0)
|
||||
|
||||
Reference in New Issue
Block a user