Skip to content

Commit

Permalink
Merge pull request #45 from mraniki/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
mraniki authored Apr 26, 2023
2 parents 8bf18e6 + 6cf1e95 commit 30c4ffe
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
34 changes: 17 additions & 17 deletions findmyorder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,24 +65,24 @@ def get_order(self,mystring: str = None,):
parsed_order = identify_order(mystring)
self.logger.info(msg=f"parsed_order: {parsed_order}")

order_raw = mystring.split()
self.logger.info(msg=f"Order identified: {order_raw}")

order = {}
order['market'] = 'Any'
order['exchange'] = 'Any'
order['timestamp'] = datetime.utcnow()
order['leverage'] = 1
order['ordertype'] = 'spot'
order['direction'] = 'BUY'
order['symbol'] = 'EURUSD'
order['quantity'] = 10
order['amount'] = 100
order['stoploss'] = 1000
order['takeprofit'] = {'tp1':1, 'tp2':10, 'tp3':100, 'tp4':1000, 'tp5':1000}
order['comments'] = 'findmyorder'
# order_raw = mystring.split()
# self.logger.info(msg=f"Order identified: {order_raw}")

# order = {}
# order['market'] = 'Any'
# order['exchange'] = 'Any'
# order['timestamp'] = datetime.utcnow()
# order['leverage'] = 1
# order['ordertype'] = 'spot'
# order['direction'] = 'BUY'
# order['symbol'] = 'EURUSD'
# order['quantity'] = 10
# order['amount'] = 100
# order['stoploss'] = 1000
# order['takeprofit'] = {'tp1':1, 'tp2':10, 'tp3':100, 'tp4':1000, 'tp5':1000}
# order['comments'] = 'findmyorder'

return order
return parsed_order

except Exception as e:
self.logger.debug(f"error {e}")
Expand Down
10 changes: 5 additions & 5 deletions tests/examples/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@ async def main():
order = fmo.search(msg_order)
logger.debug(f"search 1: {order}")
order = fmo.get_order(msg_order)
logger.debug(f"get_order 1: {order}")
logger.info(f"get_order 1: {order}")

msg_order = "buy btc"

order = fmo.get_order(msg_order)
logger.debug(msg=f"get_order 2: {order}")
logger.info(msg=f"get_order 2: {order}")

msg_order = "SELL BTC 1%"
order = fmo.get_order(msg_order)
logger.debug(f"get_order 3 : {order}")
logger.info(f"get_order 3 : {order}")

msg_order = "SELL BTCUSDT 1%"
order = fmo.get_order(msg_order)
logger.debug(f"get_order 4 : {order}")
logger.info(f"get_order 4 : {order}")

msg_order = "buy EURUSD sl=1000 tp=1000 q=1 comment=FOMC"
order = fmo.get_order(msg_order)
logger.debug(f"get_order 5 : {order}")
logger.info(f"get_order 5 : {order}")


await asyncio.sleep(10000)
Expand Down

0 comments on commit 30c4ffe

Please sign in to comment.