Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development update #98

Merged
merged 3 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions autotrader/autobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ def __init__(
"instrument": self.instrument,
"broker": self._broker,
"notifier": self._notifier,
"logger_kwargs": self._logger_kwargs,
}

# Instantiate Strategy
Expand Down
1 change: 1 addition & 0 deletions autotrader/brokers/ccxt.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,7 @@ def _modify_order(self, order: Order):
type=None,
amount=order.size,
price=order.order_limit_price,
params=order.ccxt_params,
)
except Exception as e:
modified_order = e
Expand Down
5 changes: 5 additions & 0 deletions autotrader/strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def __init__(
instrument: str,
broker: Broker,
notifier: Notifier,
logger_kwargs: dict[str, any],
*args,
**kwargs
) -> None:
Expand All @@ -36,6 +37,10 @@ def __init__(
notifier : Notifier | None
The notifier object. If notify is not set > 0, then this will be a NoneType object.
logger_kwargs : dict[str, any]
The logger configuration for this instance of AutoTrader. This can be unpacked
into the get_logger() utility function when creating strategy loggers.
"""
super().__init__()

Expand Down
2 changes: 1 addition & 1 deletion autotrader/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ def get_logger(
# Check log directory exists
if not os.path.exists(log_dir):
os.mkdir(log_dir)
logfile_path = os.path.join(log_dir, f"{name}.log")
logfile_path = os.path.join(log_dir, f"{name.replace(os.sep, '_')}.log")
fh = logging.FileHandler(logfile_path, mode="a")
fh.setLevel(file_level)
fh.setFormatter(logging.Formatter(CustomLoggingFormatter.default_fmt))
Expand Down
Loading