Skip to content

Commit

Permalink
Engine: Fixed issue with initial setting of PortfolioManagerDelay par…
Browse files Browse the repository at this point in the history
…am from flags (thrasher-corp#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 <[email protected]>
  • Loading branch information
vazha and Vazha Bezhanishvili authored Nov 25, 2020
1 parent 3ee99f0 commit 46747c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion engine/portfolio.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 46747c1

Please sign in to comment.