Finish implementing active management hooks
This commit is contained in:
@@ -1,17 +1,9 @@
|
||||
from datetime import time
|
||||
from decimal import Decimal as D
|
||||
from os import getenv
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
from core.models import (
|
||||
Account,
|
||||
Hook,
|
||||
OrderSettings,
|
||||
RiskModel,
|
||||
Signal,
|
||||
Strategy,
|
||||
TradingTime,
|
||||
User,
|
||||
)
|
||||
from core.models import Account, OrderSettings, RiskModel, Strategy, TradingTime, User
|
||||
|
||||
|
||||
# Create patch mixin to mock out the Elastic client
|
||||
@@ -48,7 +40,7 @@ class SymbolPriceMock:
|
||||
cls.patcher = patch("core.exchanges.common.get_symbol_price")
|
||||
patcher = cls.patcher.start()
|
||||
|
||||
patcher.return_value = 1
|
||||
patcher.return_value = D(1)
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
@@ -141,7 +133,7 @@ class StrategyMixin:
|
||||
max_loss_percent=50,
|
||||
max_risk_percent=10,
|
||||
max_open_trades=10,
|
||||
max_open_trades_per_symbol=2,
|
||||
max_open_trades_per_symbol=5,
|
||||
)
|
||||
|
||||
self.strategy = Strategy.objects.create(
|
||||
|
||||
Reference in New Issue
Block a user