11 KiB
11 KiB
V2
Done
Adaptive mode
- Create a risk mode 'Adaptive' to be able to not use save moneymanagement settings
- Adaptive mode will force Bot to determine SL by getting the previous highest price on the period (prevent choppy price on good entry)
- Create account (type, exchange, key, secret)
- Update trading bot to handle one account
- Remove exchange from bot. Exchange will be set on the account
- Update ftxClient to not use Managingbot subaccount
- Update exchangeService to handle account
- Dynamic Ticker selection base on best volumes on the exchanges
- Create endpoint to get the ticker list for the frontend
- Create method in application to get best bid and best ask
- Submit only limit with IOC
- Implement Poly to have a retry policy for limit order ioc execution => Unsure position is open
- For openOrder inject a parameter to select the ioc mode. If risk is adaptive we just place the order a the price without forcing the position opening
- Integrate STC signals
Web3
- Integrate wallet management from backend side
- Integrate wagmi/connectkit
- Sign message with connectkit
- On wallet connect, check if token is not expired
- User can have multiple address
- User can create an account base on evm exchange
- Hide key/secret if evm exchange is selected
- Generate pub/priv key on evm account creation and store it into mongo
- Get balance for an address
- Handle multi-chain
- Add arbitrum testnet for backend
- User can withdraw found to the connected address of the user
- Implement get balance with chainlink feed
- Abstract subgraph management
- Get price from multiple price feeds subgraph
- Add to ExchangeService GetAvailableTicker()
- Add get token list method to EvmManager
- Setup worker to save candles into db
- Open trade -> CreateIncreaseOrder
- Close trade -> CreateDecreasePosition
- Close all orders
- Create SL & TP -> CreateDecreaseOrder
- Get Fees -> Estimate Tx cost
- Adapt GetBalance to retrieve stablecoin amount
- Create worker to fetch GMX leaderboard -> LeaderboardWorker
- Leaderboard will create PositionUpdate message bus to deposit a message with all information to open a trade
- Create bot type CopyTrading to receive PositionUpdate bus message and open position based on criteria
- CopyTrading bot will send an OpenPosition button on Discord if he's set to watchOnly
- Fix : Trim address, give name to address, decrease amount bug,
- Display best last backtests ran by backtester workers
- Refactor GetAccounts/GetAccount to handle the user
- AccountType : Binance/EvmTrador/EvmWatch/EvmPersonal
- Make better abstration of the Database projects (influx, mongodb) to Remove the link between Application and Infrastructure
- Implement strategy pattern for exchange processors
- Use cache for position and signal
- Don't run update Signal and manage position if no new candle
Workers
- Add Influxdb
- Create workers for scrap data (per ticker, per exchange, per timeframe)
- Use candle from influxdb for backtests and bots
- Create a worker that get a daily top 15 of ticker volume
- Scrap candle only for crypto with high volume
- Create a worker that run backtest and save it in db
Front-end
- Return list of balances with tokens/chains data
- On account line click, display tokens by chain available
- Call Available ticker to produce the droplist
- Display multipanes https://github.com/qwpto/lightweight-charts-panels / https://codesandbox.io/s/react-typescript-forked-mxek17?file=/src/App.tsx / https://github.com/Rassibassi/multipane_tradingview
- Display last open position with lines (add SL and TP)
- Fix double charts problem (has been fixed by removing strict mode)
- Try to pass the tailwind current theme color to the chart
- List all open position for every trading account
- Create button to force close position
- Open Position button
- Improve position message -> Create message buildor
- Create channel handler for address watcher
- Add input to specify the account balance. If not set, it will use the selected account balance
The rest
Part 1 : Adaptive trading
- From backtests list : Determine TP and Stop loss % by getting average profit and average lost for a signal
- Modify bot to use MoneyManagement object instead of using the risk associated to the signal.
- Bot object should return MoneyManagement object
- Strategy can return a suggested trade that will give the best orders to execute
Part 2 : Workflows builder
- Create a workflow type that will encapsulate a list of flows
- Each flow will have parameters, inputs and outputs that will be used by the children flows
- Flow can handle multiple parents
- Run Simple bot base on a workflow
- Run backtest based on a workflow
- Add flows : ClosePosition, Scenario
Part 2 : Strategies optimisation
- Optimize all strategies with more data (funding rate trend, bbwp, etc..)
- Optimize entry by getting last ask price and place an order limit to match directly with it
- Add bbwp indicator => PR example : https://github.com/DaveSkender/Stock.Indicators/pull/893/files#diff-df1cd2a99846f7328c9fc3db4d2c164380a0fa943cdcad2ece01b886cac68137
- Create strategies types from signal (a divergence) / trend (stoch long or short) / context (high vol/low vol)
- Create a trend strategy on fundinrate -> long trend if negativ fr / short trend if positiv fr
- Add entry/exit price to signal for adaptive risk
- MACD: Open only when candle is not a big move to avoid late entry (only enter when low vol)
- Improve strategy composability by using delegate pattern
Part 3 : Backtests automation
- Create a worker that determine best TP and SL
- Create a page 'Analyze' to show the best TP and SL for multiple backtest result
- Implement reverseSignal to close and flip the trade
- Load signal from database
- Create a bot to update signal into database that still in pending
- Signal return best SL and TP
- Combine multi-timeframe to detect better signals => Adapt risk on the lowest timeframe based on upper timeframe
- Remove candles from the backtestResult
- Save start/end time and timeframe into the result
- On GET backtest -> Retrieve the candle from cache or database
Phase 2 - Web3
1 - Wallet management
- User can deposit token to and evm account with a QR code or clicking on button to copy the address
- Add account abstraction to level up security
2 - Track address
- Create a snapshot of the account balances with BalancesWorker
- Display balance in $ evolution per token hold on the account page
3 - Settings Link
- Save theme into database
- Call GET Settings/Theme to retrieve the theme used by the user
4 - Trading desk Link
- Live data position hub
- Live candles
- Open position from desk
5 - Live liquidation map
- Create worker to aggregate binance/okx liquidation
- Render liquidation map with a hub subscription to get live update
- Live data signal
- Display massive liquidation on TradeChartWidget
6 - Metrics Link
- Create a worker that get top 5 cryptos by scenario
- Create worker to store portofolio evolution
- Display portofolio evolution
- Create a worker to scrap funding fees over time (per ticker, per exchange)
7 - Improvement Link
- Handling user on every object => Use the JWT token to inject the userName
- Extract BacktestReport from tests to a Tools projects
- Factorize amount management for GMX Service
- Remove link betweend Domain object to EVM project
- GMX Service should handle only Nethereum object, not Domain.Models
- Compute backtests pagination on backend side
- Store webapp into docker
- Make possible to force close all positionpositions of a bot
- Save bot config to easily relaunch a bot and also analyze data
- Bot can handle limit order position -> fetch if order is still open then check if position of open
- Create method to update the money management use by the bot
- Implement from/to tickers array pattern
- Extract all managing trade method into a TradingBox class => Create composable trading bot type easily
- Bot backup worker: Every x, get saved bots and check if still running. If not running call api to reboot bot.
- Create worker to fetch the biggest spread between long\short funding rate and send alert when most profitable delta neutral position is found
Front-end
Improve Account page
- Display total balances (only trader account) on Settings->Accounts Page
- On Token Account details line -> Add button to withdraw money (this will open a Modal to prompt the address/amount that will receive the money)
Charts
- Add multi-timeframe options
- Display optionnal indicators on charts
- Display current selected position (when i click on a Position in the list)
Trading desk
- WAIT - Create a button to open a hedge on option market
- Get global exposure ((total position / total balances *) 100)
- Display multiple tab to show different tickers
Scenarios
- Create a blocky-like editor to create scenarios https://google.github.io/blockly-samples/
Bots
- Add button to display money management use by the bot
- On the modal, When simple bot selected, show only a select for the workflow
Backtests
- Display the money management used by the backtest
Technical front-end :
- Implement alias to reduce 'import' lines https://github.com/subwaytime/vite-aliases
- Make Get Accounts List as a store
- Replace all html-tag Modals (ex: BacktestPlayground.tsx)
- Refactoring Components :
- organism : Put all the code related to the app (Trade charts etc). This folder should be delete when the project is forked
- mollecules : Put aggregate of atoms to create forms/modal/table
- atoms : Put all basic html tag components (List, Select, Slider...)
Workflow
- List all workflow saved in
- Use https://reactflow.dev/ to display a workflow (map flow to nodes and children to edges)
- On update Nodes : https://codesandbox.io/s/dank-waterfall-8jfcf4?file=/src/App.js
- Save workflow
- Reset workflow
- Add flows : Close Position, SendMessage
- On Flow.tsx : Display inputs/outputs names on the node
- Setup file tree UI for available flows : https://codesandbox.io/s/nlzui
Technicals
- Remove mediator
- Check Traefik : https://www.cloudbees.com/blog/setting-up-traefik-as-a-reverse-proxy-for-asp-net-applications
- Implement IHostedService/BackgroundService to run bot in background https://www.youtube.com/watch?v=fw-n2RkzOMI
- Implement Microsoft Orleans