Closed phbrgnomo closed 3 years ago
@aarmoa & @keithbaum a reminder that once the refactor is finished, we should remove the dev
from the strategy name to make it available on master/docker install.
But this strategy is also still a simple example for external devs, so add/keep comments on it where you see fit to explain what each parameter part of the strategy is doing.
What?
The
dev_4_twap
was first implemented as strategy creation demo for external developers and haven't been touched in a long time. Currently the strategy is partialy woking.The strategy must be refactored to update the code to make proper use of the current code base, but also to work as stand-alone public strategies that are available on the
master
branch.Curent state
TWAP
order_type
=market
doesn't work. Orders aren't being created with the configorder_amount
asks for a "preferred quantity". It isn't clear if this value is the amount of each single order or the maximum amount that the bot will be allowed to buyWhy?
The code of these strategies must be updated to the most recent framework of the code base.
These strategies are also widely used by traders that need to negotiate big volumes.
Making them public available allows to demostrante different ways that hummingbot can be used by big players.
Due to it's simplicity, they are good examples for developers on how to build new strategies.
How?
TWAP
Configurations/Variables needed:
trading_pair
- What is the trading pair the strategy will be executedtarget_asset_amount
- What is the total amount that will be bought/soldorder_step_size
- What is the size of each individual orderorder_delay_time
- how long the bot must wait between each individual orderend_timer
- for how long the bot must run. (-1 option must be enabled to disable the timed execution) # to be implemented on a follow-up issueorders_price
- The maximum/minimum price of all the individual orderstrade_side
- (buy or sell) which side of the trade the orders will be executedNote:
Strategy prompts
What is the trading pair?
User select the trading pair market ->tradig_pair
What operation will be executed? (buy/sell)
User chooses if it will buy or sell the asset ->trade_side
What is the total amount of <base asset> to be traded?
This option setstarget_asset_amount
that must limit the maximum amount the bot will be allowed to tradeAt what price the orders will be created?
This setsorders_price
.What is the size of each individual order (in <base asset>)?
This setsorder_step_size
How long must the bot wait between each order (in seconds)?
This setsorders_delay_time
Execution
When the strategy
start
, the bot will create a LIMIT order, with theorder_step_size
amount, everyorders_delay_time
seconds, until the total amount of orders filled is equal totarget_asset_amount
Performance stats
status
must show:target_asset_amount - amount_traded
)history
target_asset_amount
(optional)order_step_size
xorders_price
) with the current real value (Qt of trades x filled order amount x average execution price)Impact?
A proper TWAP strategy creates an easy tool for traders to sell/buy a big amount of capital on the markets without moving prices. This expands the use of hummingbot as a professional trading tool beyond market-making and provides acessibility to this automated strategy to more people.
Alternatives?
New stories will be created as follow up to improve this strategy:
References
Research sources
TWAP
https://empirica.io/blog/twap-strategy/
https://blog.quantinsti.com/twap/