Skip to content

Commit

Permalink
🔧 update default_settings.toml and main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mraniki committed Jul 9, 2024
1 parent f8a4f4a commit 69b4d94
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 39 deletions.
74 changes: 37 additions & 37 deletions findmyorder/default_settings.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,44 +19,44 @@
# Module Enable/Disable
findmyorder_enabled = true

# [default.findmyorder.template]
# parser_library = "standard"
# enabled = true
# # Keyword to be use to identify an order
# action_identifier = "BUY SELL LONG SHORT"
# # Keyword identifier for stoploss
# stop_loss_identifier = "sl="
# # Keyword identifier for take-profit
# take_profit_identifier = 'tp='
# # Keyword identifier for quantity
# quantity_identifier = 'q='
# # Keyword identifier for order type
# order_type_identifier = "spot future margin"
# # Keyword identifier for leverage
# leverage_type_identifier = "cross isolated"
# # Keyword identifier for comments
# comment_identifier = "comment="
# # Stoploss default value is none is provided
# stop_loss = 1000
# # Take-Profit default value is none is provided
# take_profit = 1000
# # Quantity default value is none is provided
# quantity = 1
# # Settings to enable or disable
# # instrument mapping
# instrument_mapping = true
# # instrument mapping to use and alternative
# # symbol when generating the order
# mapping = [
# { id = "GOLD", alt = "XAUUSD" },
# { id = "SILVER", alt = "XAGUSD" },
# { id = "BTC", alt = "WBTC" },
# { id = "ETH", alt = "WETH" },
# ]
[default.findmyorder.template]
parser_library = "standard"
enabled = true
# Keyword to be use to identify an order
action_identifier = "BUY SELL LONG SHORT DEFAULT"
# Keyword identifier for stoploss
stop_loss_identifier = "sl="
# Keyword identifier for take-profit
take_profit_identifier = 'tp='
# Keyword identifier for quantity
quantity_identifier = 'q='
# Keyword identifier for order type
order_type_identifier = "spot future margin"
# Keyword identifier for leverage
leverage_type_identifier = "cross isolated"
# Keyword identifier for comments
comment_identifier = "comment="
# Stoploss default value is none is provided
stop_loss = 1000
# Take-Profit default value is none is provided
take_profit = 1000
# Quantity default value is none is provided
quantity = 1
# Settings to enable or disable
# instrument mapping
instrument_mapping = true
# instrument mapping to use and alternative
# symbol when generating the order
mapping = [
{ id = "GOLD", alt = "XAUUSD" },
{ id = "SILVER", alt = "XAGUSD" },
{ id = "BTC", alt = "WBTC" },
{ id = "ETH", alt = "WETH" },
]

# # Instrument to be ignored
# # when generating an order
# ignore_instrument = "US500 DOGE"
# Instrument to be ignored
# when generating an order
ignore_instrument = "US500 DOGE"

########################################
### END OF DEFAULT SETTINGS ###
Expand Down
6 changes: 4 additions & 2 deletions findmyorder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,18 @@ def __init__(
Returns:
None
"""
"""

self.enabled = settings.findmyorder_enabled
self.settings = settings.findmyorder
logger.debug("Settings: {}", self.settings)
if not self.enabled:
logger.info("Module is disabled. No Client will be created.")
return
self.client_classes = self.get_all_client_classes()
self.clients = []
# Create a client for each client in settings.findmyorder
for name, client_config in settings.findmyorder.items():
for name, client_config in self.settings.items():
if (
# Skip empty client configs
client_config is None
Expand Down

0 comments on commit 69b4d94

Please sign in to comment.