mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-14 08:16:56 +08:00
feat: migrate to CoinAnk API and improve chart UI
- Chart improvements: professional styling, popular symbols quick selection, simplified B/S legend - Data source migration: use CoinAnk API exclusively for all kline data - Code cleanup: remove Binance WebSocket cache and related code (websocket_client.go, combined_streams.go, monitor.go) - Log optimization: reduce hook spam, suppress 404 errors, increase P&L diff threshold - Lighter integration: add order sync functionality, fix market order precision - Remove ticker merge logic for simplicity
This commit is contained in:
@@ -25,6 +25,7 @@ type Store struct {
|
||||
position *PositionStore
|
||||
strategy *StrategyStore
|
||||
equity *EquityStore
|
||||
order *OrderStore
|
||||
|
||||
// Encryption functions
|
||||
encryptFunc func(string) string
|
||||
@@ -153,6 +154,9 @@ func (s *Store) initTables() error {
|
||||
if err := s.Equity().initTables(); err != nil {
|
||||
return fmt.Errorf("failed to initialize equity tables: %w", err)
|
||||
}
|
||||
if err := s.Order().InitTables(); err != nil {
|
||||
return fmt.Errorf("failed to initialize order tables: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -277,6 +281,16 @@ func (s *Store) Equity() *EquityStore {
|
||||
return s.equity
|
||||
}
|
||||
|
||||
// Order gets order storage
|
||||
func (s *Store) Order() *OrderStore {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
if s.order == nil {
|
||||
s.order = NewOrderStore(s.db)
|
||||
}
|
||||
return s.order
|
||||
}
|
||||
|
||||
// Close closes database connection
|
||||
func (s *Store) Close() error {
|
||||
return s.db.Close()
|
||||
|
||||
Reference in New Issue
Block a user