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

✨ Improve Signal format handling to simplify parsing and increase entry options #41

Open
mraniki opened this issue Feb 26, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@mraniki
Copy link
Owner

mraniki commented Feb 26, 2023

Try to support parsing of message in the following format
Symbol
Entry targets
Take-Profit targets
Stop targets
Leverage
Trade type (Regular or Breakout)
Short/Long

@mraniki mraniki added the enhancement New feature or request label Feb 26, 2023
@mraniki
Copy link
Owner Author

mraniki commented Feb 26, 2023

Example 1 - CORNIX type
⚡️⚡️ #BNB/USDT ⚡️⚡️
Exchanges: ByBit USDT, Binance Futures
Signal Type: Regular (Long)
Leverage: Cross (20.0X)

Entry Targets:

  1. 308.7 - 20.0%
  2. 299 - 20.0%
  3. 297 - 60.0%

Take-Profit Targets:

  1. 312
  2. 322
  3. 338
  4. 376

Stop Targets:

  1. 296

Trailing Configuration:
Stop: Breakeven -
Trigger: Target (2)

@mraniki
Copy link
Owner Author

mraniki commented Feb 26, 2023

Example 2
⚫BUY
💱CAKE
🔵1.7509, 1.8509, 1.9509, 2.7509
🛑1.5558
📏1
⚡5
🏦PANCAKE
🚧XXX
🏁100

Description Identifier Example Required Options
DIRECTION BUY Y LONG SHORT BUY SELL
SYMBOL or TICKER 💱 CAKE Y CAKE CAKEUSDT
TAKE PROFIT TARGET 🔵 1.7509, 1.8509, 1.9509, 2.7509 N
STOP LOSS 🛑 1.5558 N
SIZE 📏 1 N
LEVERAGE 5 N
EXCHANGE 🏦 PANCAKE N
OTHER PARAMS 🚧 TBD N
TRAILING STRATEGY 🏁 100 N

@mraniki mraniki changed the title Improve Signal format handling Improve Signal format handling to simplify parsing and increase entry options Feb 26, 2023
@mraniki
Copy link
Owner Author

mraniki commented Feb 26, 2023

Example 3
buy BTCUSD sl=10000 tp=1000 q=1%

@mraniki
Copy link
Owner Author

mraniki commented Feb 26, 2023

Example 4
buy BTCUSD

@mraniki mraniki transferred this issue from mraniki/tt Apr 26, 2023
@mraniki mraniki changed the title Improve Signal format handling to simplify parsing and increase entry options ✨ Improve Signal format handling to simplify parsing and increase entry options Aug 8, 2023
@mraniki mraniki added this to Talky Aug 8, 2023
@mraniki
Copy link
Owner Author

mraniki commented Aug 10, 2023

Grammar
class TradingGrammar:
def init(self):
self.action = self._action()
self.instrument = self._instrument()
self.exchange = self._exchange()

grammar = TradingGrammar()

new_order_grammar = (
grammar.currency_pair
+ grammar.exchange
+ grammar.take_profit_targets
)
CORNIX type
currency_pair = Combine(Suppress("#") + Word(alphas + "/") + Word(alphas))
.set_results_name("currency_pair")
exchange = Group(Suppress("Exchanges:")

  • delimitedList(
    Word(alphas + " "),
    delim=", ")
    ).set_results_name("exchanges")
    signal_type = Group(
    Suppress("Signal Type:")
  • Word(alphas + " ()"))
    .set_results_name("signal_type")
    leverage = Group(
    Suppress("Leverage:")
  • Word(alphas + " (.)"))
    .set_results_name("leverage")
    entry_targets = Group(Suppress("Entry Targets:")
  • OneOrMore(Group(Word(nums
  • ".")
  • Suppress("-")
  • Word(nums + ".%")))).set_results_name("entry_targets")
    take_profit_targets = Group(
    Suppress("Take-Profit Targets:")
  • OneOrMore(Word(nums + "."))).set_results_name("take_profit_targets")
    stop_targets = Group(
    Suppress("Stop Targets:")
  • OneOrMore(Word(nums + "."))).set_results_name("stop_targets")
    trailing_config = Group(
    Suppress("Trailing Configuration:")
  • Group(Word(alphas + ":")
  • Word(alphas + "-")
  • Suppress("Trigger:")
  • Word(alphas + " ()"))).set_results_name("trailing_config")

new_order_grammar = (
currency_pair
+ exchange
+ signal_type
+ leverage
+ entry_targets
+ take_profit_targets
+ stop_targets
+ trailing_config
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

1 participant