Support
Quality
Security
License
Reuse
kandi has reviewed freqtrade and discovered the below as its top functions. This is intended to give you an instant insight into freqtrade implemented functionality, and help decide if they suit your requirements.
[x] Based on Python 3.8+: For botting on any operating system - Windows, macOS and Linux.
[x] Persistence: Persistence is achieved through sqlite.
[x] Dry-run: Run the bot without paying money.
[x] Backtesting: Run a simulation of your buy/sell strategy.
[x] Strategy Optimization by machine learning: Use machine learning to optimize your buy/sell strategy parameters with real exchange data.
[x] Edge position sizing Calculate your win rate, risk reward ratio, the best stoploss and adjust your position size before taking a position for each specific market. Learn more.
[x] Whitelist crypto-currencies: Select which crypto-currency you want to trade or use dynamic whitelists.
[x] Blacklist crypto-currencies: Select which crypto-currency you want to avoid.
[x] Builtin WebUI: Builtin web UI to manage your bot.
[x] Manageable via Telegram: Manage the bot with Telegram.
[x] Display profit/loss in fiat: Display your profit/loss in fiat currency.
[x] Performance status report: Provide a performance status of your current trades.
Bot commands
usage: freqtrade [-h] [-V]
{trade,create-userdir,new-config,new-strategy,download-data,convert-data,convert-trade-data,list-data,backtesting,edge,hyperopt,hyperopt-list,hyperopt-show,list-exchanges,list-hyperopts,list-markets,list-pairs,list-strategies,list-timeframes,show-trades,test-pairlist,install-ui,plot-dataframe,plot-profit,webserver}
...
Free, open source crypto trading bot
positional arguments:
{trade,create-userdir,new-config,new-strategy,download-data,convert-data,convert-trade-data,list-data,backtesting,edge,hyperopt,hyperopt-list,hyperopt-show,list-exchanges,list-hyperopts,list-markets,list-pairs,list-strategies,list-timeframes,show-trades,test-pairlist,install-ui,plot-dataframe,plot-profit,webserver}
trade Trade module.
create-userdir Create user-data directory.
new-config Create new config
new-strategy Create new strategy
download-data Download backtesting data.
convert-data Convert candle (OHLCV) data from one format to
another.
convert-trade-data Convert trade data from one format to another.
list-data List downloaded data.
backtesting Backtesting module.
edge Edge module.
hyperopt Hyperopt module.
hyperopt-list List Hyperopt results
hyperopt-show Show details of Hyperopt results
list-exchanges Print available exchanges.
list-hyperopts Print available hyperopt classes.
list-markets Print markets on exchange.
list-pairs Print pairs on exchange.
list-strategies Print available strategies.
list-timeframes Print available timeframes for the exchange.
show-trades Show trades.
test-pairlist Test your pairlist configuration.
install-ui Install FreqUI
plot-dataframe Plot candles with indicators.
plot-profit Generate plot showing profits.
webserver Webserver module.
optional arguments:
-h, --help show this help message and exit
-V, --version show program's version number and exit
How to make a Dockerfile and run it for multiple Python files?
FROM python:3.8
RUN pip install numpy
RUN pip install python-binance
RUN pip install pandas
RUN pip install backtrader
RUN pip install matplotlib
RUN pip install websocket_client
# TA-Lib
RUN wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz && \
tar -xvzf ta-lib-0.4.0-src.tar.gz && \
cd ta-lib/ && \
./configure --prefix=/usr && \
make && \
make install
RUN rm -R ta-lib ta-lib-0.4.0-src.tar.gz
RUN pip install freqtrade
COPY trader1.py ./
Locate files written by a python script in a container that is not running anymore
docker ps -a
docker cp CONTAINER_ID:absolute/path/to/file ./host/target/path
docker run -v "$(pwd)"/relative/host_dir:/absolute/container_dir my_image
-----------------------
docker ps -a
docker cp CONTAINER_ID:absolute/path/to/file ./host/target/path
docker run -v "$(pwd)"/relative/host_dir:/absolute/container_dir my_image
-----------------------
docker ps -a
docker cp CONTAINER_ID:absolute/path/to/file ./host/target/path
docker run -v "$(pwd)"/relative/host_dir:/absolute/container_dir my_image
ValueError: Length of values (1) does not match length of index index (12797) - Indexes are the same length
dataframe.loc[:, 'st_12'] = st12['ST']
how to do string formatting in python for this specific example
pair = ['BTC/USD', 'ETH/BTC', 'ABC/DEF']
time_from = 20200101
time_to = 20200120
message = "'" + "' '".join(pair) + "'"
cmd = "freqtrade download-data -d /home/datarepo -p %pair% -t 1h --timerange '%time_to%-%time_from%' --exchange bittrex -vv"
cmd = cmd.replace('%pair%', message).replace('%time_to%', str(time_to)).replace('%time_from%', str(time_from))
print(cmd)
# "freqtrade download-data -d /home/datarepo -p 'BTC/USD' 'ETH/BTC' 'ABC/DEF' -t 1h --timerange '20200120-20200101' --exchange bittrex -vv"
QUESTION
How to make a Dockerfile and run it for multiple Python files?
Asked 2022-Jan-23 at 18:40So, I'm new to Docker. I want to use Ta-Lib and freqtrade libraries for a bot I want to build. The problem is that I don't want to build the Dockerfile over and over again. I have been copying my python code in the Dockerfile as shown below but as soon as I change the python code, I have to rebuild the Dockerfile because I changed the copied python script. Each build takes over 10 minutes to complete and this makes my life very difficult to test the bot. Is there a way that I build the Dockerfile with all the dependencies and requirements first and then simply run my script using the image made? So that I don't have to rebuild the entire thing just after adding one line of code? The Dockerfile is as shown below
FROM python:3.8
COPY trader1.py ./
RUN pip install numpy
RUN pip install python-binance
RUN pip install pandas
RUN pip install backtrader
RUN pip install matplotlib
RUN pip install websocket_client
# TA-Lib
RUN wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz && \
tar -xvzf ta-lib-0.4.0-src.tar.gz && \
cd ta-lib/ && \
./configure --prefix=/usr && \
make && \
make install
RUN rm -R ta-lib ta-lib-0.4.0-src.tar.gz
RUN pip install freqtrade
Thank you in advance!
ANSWER
Answered 2022-Jan-23 at 18:20First, you should copy your python file as late as possible.
FROM python:3.8
RUN pip install numpy
RUN pip install python-binance
RUN pip install pandas
RUN pip install backtrader
RUN pip install matplotlib
RUN pip install websocket_client
# TA-Lib
RUN wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz && \
tar -xvzf ta-lib-0.4.0-src.tar.gz && \
cd ta-lib/ && \
./configure --prefix=/usr && \
make && \
make install
RUN rm -R ta-lib ta-lib-0.4.0-src.tar.gz
RUN pip install freqtrade
COPY trader1.py ./
The docker containers are layered, every line is one layer, when recreating a container, docker rebuild the container only from the changing layer.
Second, you could create a volume
If you use docker-compose, you could create a volume in your current folder, or subfolder, in order to have your file automatically synced with your host. (then you don't need the COPY)
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
No vulnerabilities reported
Save this library and start creating your kit
Explore Related Topics
Save this library and start creating your kit