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

⬆️ 🛠️(deps): update dependency iamlistening to v5.1.0 #1388

Merged
merged 4 commits into from
Mar 27, 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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ asyncz = "^0.5.0"
nicegui = "^1.3.15"
ping3 = "^4.0.4"
talkytrend = "2.0.7"
iamlistening = "5.0.3"
iamlistening = "5.1.0"
findmyorder = "1.9.17"
dxsp = "8.0.1"
cefi = "4.2.0"
Expand Down
9 changes: 8 additions & 1 deletion tt/plugins/plugin_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,12 +285,19 @@ def should_handle_timeframe(self):
bool
"""
if settings.trading_control:
logger.debug("Trading control enabled")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (performance): Consider consolidating debug logs for efficiency.

Merging this log with the subsequent detailed log could reduce overhead and improve readability.

current_time = datetime.now().time()
current_day = datetime.now().strftime("%a").lower()

start_time = datetime.strptime(settings.trading_hours_start, "%H:%M").time()
end_time = datetime.strptime(settings.trading_hours_end, "%H:%M").time()

logger.debug(
"Current time: {}, Current day: {}, Start time: {}, End time: {}",
current_time,
current_day,
start_time,
end_time,
)
return (
current_day in settings.trading_days_allowed
and start_time <= current_time <= end_time
Expand Down
38 changes: 37 additions & 1 deletion tt/talky_settings.toml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ helper_commands = """

# Enable/Disable Trading
trading_enabled = true
trading_control = false
trading_control = true
trading_days_allowed = ["tue", "wed", "thu"]
trading_hours_start = "08:00"
trading_hours_end = "16:00"
Expand Down Expand Up @@ -621,6 +621,8 @@ myllm_enabled = true
# mapping = [
# { id = "BTC", alt = "BTC/USDT" },
# ]
# balance_limit = false
# balance_limit_value = 10

# # CEFI example using ccxt binance
# protocol = "ccxt"
Expand All @@ -641,6 +643,40 @@ myllm_enabled = true
# mapping = [
# { id = "BTC", alt = "BTC/USDT" },
# ]
# balance_limit = true
# balance_limit_value = 10

# [default.cex.capital]
# protocol = "capital"
# enabled = false
# user_id = "12345678"
# api_key= "myapi_DEADBEEF"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 issue (security): Hard-coded API key detected.

Storing API keys in the source code can lead to security vulnerabilities. Consider using environment variables or a secure vault.

# password = "12345678"
# testmode = false
# defaulttype = ""
# ordertype = ""
# leverage_type = ""
# leverage = 1
# trading_risk_percentage = true
# trading_risk_amount = 10
# trading_slippage = 2
# trading_amount_threshold = 0
# trading_asset = "USD"
# trading_asset_separator = ""
# mapping = [
# { id = "EURUSD", alt = "EURUSD" },
# { id = "BTC", alt = "BTCUSD" },
# { id = "ETH", alt = "ETHUSD" },
# { id = "CRUDE", alt = "OIL_CRUDE" },
# { id = "BRENT", alt = "OIL_BRENT" },
# { id = "GOLD", alt = "GOLD" },
# { id = "SILVER", alt = "SILVER" },
# { id = "US500", alt = "US500" },
# ]
# balance_limit = false
# balance_limit_value = 10


########################################
### END OF DEFAULT SETTINGS ###
########################################
Loading