TradeLockerBot Python package Docker Image: Build and Upload

Webhook TradingView Bot for Automated Position Management

TradeLocker is a webhook bot designed to seamlessly integrate with TradingView, enabling automated opening and closing of trading positions.

Install

Update Code

If you update the code, run the following command to delete the previous image:

docker rmi -f ghcr.io/akinzou/tradelocker_bot:latest

Pull the Latest Image

Download the latest image using the command:

docker pull ghcr.io/akinzou/tradelocker_bot:latest

Verify Download

Check if the image has been downloaded:

docker images

You should see:

ghcr.io/akinzou/tradelocker_bot   latest

Run the Container

Run the container with the following command:

docker run -p 443:443 -e username=your_username -e password=your_password -e server=your_server -e env=demo/live --rm ghcr.io/akinzou/tradelocker_bot:latest

Verification

After running the container, you should see green text indicating successful authentication:

+[INFO] tradelocker.tradelocker_api 2024-05-30 11:25:31,834 tradelocker_api _auth_with_password: 665 Successfully fetched authentication tokens

Access the Webhook Bot

You can now access the webhook bot at:

http://localhost:443/strategy

or

http://yourIP:443/strategy

You should see the following message on the site:

{"detail":"Method Not Allowed"}

Cahnge URL:

Run Container with addtional argument

-e url=/your_url

Adding webhook alert to your strategy:

Use this format

XAUUSD
{{strategy.order.action}}
0.01
500
1000
{{strategy.order.alert_message}}

where

XAUUSD -> name of tradable instrument
{{strategy.order.action}} -> "buy"/"sell"
0.01 -> lot
500 -> take profit (offset mode)
1000 -> stop loss (offset mode)
{{strategy.order.alert_message}} -> "Open" for opening a position and closing the previous one, "Close" for only closing a position on the specific instrument

Remember

Remember to configure Nginx or another appropriate software to enable access to HTTPS. You will be able to use, for example

https://localhost/strategy

Note:

This program is provided "as is" without any warranty. Use it at your own risk. Before using this program in a live trading environment, thoroughly test it on a demo account to ensure its correctness and reliability.