TradeLocker is a webhook bot designed to seamlessly integrate with TradingView, enabling automated opening and closing of trading positions.
If you update the code, run the following command to delete the previous image:
docker rmi -f ghcr.io/akinzou/tradelocker_bot:latest
Download the latest image using the command:
docker pull ghcr.io/akinzou/tradelocker_bot:latest
Check if the image has been downloaded:
docker images
You should see:
ghcr.io/akinzou/tradelocker_bot latest
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
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
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"}
Run Container with addtional argument
-e url=/your_url
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 to configure Nginx or another appropriate software to enable access to HTTPS. You will be able to use, for example
https://localhost/strategy
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.